How to fake source ip-address of a udp-packet?

raisyn picture raisyn · Mar 22, 2010 · Viewed 33.3k times · Source

Think about the following:
Your ISP offers you a dynamic ip-address (for example 123.123.123.123).

My question is simple (the answer may not be):

Is it possible to send a single udp-packet with an outer source-ip (for example 124.124.124.124) to a fixed-ip server? I don't need to get an answer from the server. I just want to know if/how this one way communication can be done, using a faked source-ip address.

The server and no one else should not be able to find out the real client ip.

Answer

Jacob Schoen picture Jacob Schoen · Mar 22, 2010

The UDP packet does not actually have the source (your) IP address. The source IP address is part of the packet it is sent in. So you would have to modify the packet it is enclosed in. So while it is non-trivial, it is possible. The packet structure for UDP, and the enclosing packets for reference.