Jump to content

help with TCPreceive please.


 Share

Recommended Posts

hi

I have the following code:

TCPStartUp()

Dim $szServerPC = "9.148.218.20"

Dim $szIPADDRESS = "9.148.218.20"
Dim $nPORT = 23
Dim $ConnectedSocket = -1

$ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT)
sleep (600)
TCPSend ($ConnectedSocket,Binary ("0xfffb18fffb1f"))
        sleep (10)
        TCPSend ($ConnectedSocket,Binary ("0xfffc20fffc23fffb27"))
        sleep (300)
        TCPSend ($ConnectedSocket,Binary ("0xfffa1f00500019fff0"))
        sleep (300)
        TCPSend ($ConnectedSocket,Binary ("0xfffa2700fff0fffa1800414e5349fff0"))
        sleep (300)
        TCPSend ($ConnectedSocket,Binary ("0xfffd03"))
        sleep (10)
        TCPSend ($ConnectedSocket,Binary ("0xfffb01fffe05fffc21"))
        sleep (300)
        tcpsend ($ConnectedSocket,Binary ("0xfffc01"))
        sleep (300)
        $r=InputBox ("","tcp source","")
        $m=TCPRecv ($r,2048)
        TCPSend ($ConnectedSocket,Binary ("0xfffd01"))
        sleep (300)
        MsgBox (0,"",$m)

the part of TCPrecv does not work for me, I can't recieve the input from the other server, so I have two questions:

a) how can I know which source port am I using, currently I am using netstat with inputbox to do that.

:D how can I get the data that the server sends to my computer using TCPrecv?

Link to comment
Share on other sites

hi

I have the following code:

TCPStartUp()

Dim $szServerPC = "9.148.218.20"

Dim $szIPADDRESS = "9.148.218.20"
Dim $nPORT = 23
Dim $ConnectedSocket = -1

$ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT)
sleep (600)
TCPSend ($ConnectedSocket,Binary ("0xfffb18fffb1f"))
        sleep (10)
        TCPSend ($ConnectedSocket,Binary ("0xfffc20fffc23fffb27"))
        sleep (300)
        TCPSend ($ConnectedSocket,Binary ("0xfffa1f00500019fff0"))
        sleep (300)
        TCPSend ($ConnectedSocket,Binary ("0xfffa2700fff0fffa1800414e5349fff0"))
        sleep (300)
        TCPSend ($ConnectedSocket,Binary ("0xfffd03"))
        sleep (10)
        TCPSend ($ConnectedSocket,Binary ("0xfffb01fffe05fffc21"))
        sleep (300)
        tcpsend ($ConnectedSocket,Binary ("0xfffc01"))
        sleep (300)
        $r=InputBox ("","tcp source","")
        $m=TCPRecv ($r,2048)
        TCPSend ($ConnectedSocket,Binary ("0xfffd01"))
        sleep (300)
        MsgBox (0,"",$m)

the part of TCPrecv does not work for me, I can't recieve the input from the other server, so I have two questions:

a) how can I know which source port am I using, currently I am using netstat with inputbox to do that.

:D how can I get the data that the server sends to my computer using TCPrecv?

Shove the TCPRecive into a while loop, and do an if statement like if $m <> "" Then ExitLoop. Should work... :P
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...