Jump to content

outbound HTTP connection not from base IP address


Tim Net
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
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...