Sign in to follow this  
Followers 0
erezlevi

help with TCPreceive please.

2 posts in this topic

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?

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0