Sign in to follow this  
Followers 0
Tim Net

outbound HTTP connection not from base IP address

3 posts in this topic

I have a public server which has 13 IP addresses on it. When my scripts make an inetget or process a request using tcpsend, the traffic always sources from the base IP on the machine. How can I get my scripts to source it's traffoc from the seconds, third, fourth, etc IP bound to the NIC?

NetCat(nc.exe) can assign the source port with the -s argument. Is there any way to bind to a specific outbound source port?

Thanks,

Tim

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

TCPListen(Desired IP, port)

TCPListen(192.168.1.100, 80)

So if you want to listen on the IP address 192.168.1.104, port 80 then do

TCPListen(192.168.1.104, 80)

You can also use @IPaddress1 @IPaddress2, and so on through 4 to automatically detect the address.

Same goes for UDPBind()

Oh and next time please use the General Help forum. This forum is for example scripts.

TCPListen returns the main socket. So ultimately you will want to do

$mainsocket = TCPListen(192.168.1.104, 80)

Do

$connectedsocket = TCPAccept($mainsocket)

Until $connectedsocket <> -1

TCPSend($connectedsocket, "send data")

Edited by Zachlr

Share this post


Link to post
Share on other sites

afaik you can't do that with autoit


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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