Web Hosting Talk







View Full Version : PHP: Spoofing sender address


UrlGuy
12-03-2005, 11:30 PM
Hi there,

Anyone know if its possible to spoof sender address of a packet with PHP?

For example... if I send 'Hello there' with PHP using fsockopen(); to my server, is it possible to spoof the servers IP where it origins from?

Let's say my servers IP was for example 85.164.120.35, and I had my script on it, which were able to send packets to another server by specifying packet content, remote ip and port.

The server that recieved that packet would see in their logs that they recieved that packet from 85.164.120.35. Is there any way to spoof that IP?

Thanks!

Burhan
12-04-2005, 01:51 AM
Use a proxy.

Moogabytes
12-04-2005, 03:31 AM
Using a proxy will do the job like fyrestrtr said!

Slidey
12-04-2005, 12:58 PM
can do this in C, but i suspect php doesnt work at a low enough level to do this

UrlGuy
12-05-2005, 02:59 AM
Okay thanks for replies guys.
But are you sure when client using a proxy it wouldnt send servers address?
Or would I need some kind of proxy with my PHP script?
Or does regular proxy client-side work fine?

Thanks!

Jason.NXH
12-05-2005, 07:45 AM
You would need your PHP script to connect to the proxy then send the requests through that. A client-side proxy will just mean the visitor's IP will be hidden from anything. If a client uses a client-side proxy to activate a PHP script on the server, it would just use the servers address :)

UrlGuy
12-05-2005, 07:49 AM
Okay. I'll try that.
Thanks again for replies!