Packet sending

This is a discussion on Packet sending within the Networking/Device Communication forums, part of the General Programming Boards category; Hello, I've discovered that using an application called scapy i can send network packets to any address,port, subnet. The thing ...

Packet sending

Hello, I've discovered that using an application called scapy i can send network packets to any address,port, subnet. The thing that caught my attention was the option to modify the source of the packet in the packet that was sent. I want to do that in c++. So far, all i can do is something like this:

http://beej.us/guide/bgnet/
This is also a good reference as well. The examples here are for a unix type environment, but most of it is similar. It also shows some good techniques on how to do some advanced topics.

Source spoofing is usually considered evil. Moreover, it doesn't work unless you are within the core routing network.

You can set the source IP to something that's not your real IP, but firstly, the socket layer will not allow you to bind to an IP which isn't configured on an interface, and secondly, even if you send a raw packet, your ISP's routers will detect the lie and drop the packet on the floor.

You might be able to source spoof within a LAN, if the routers are configured stupidly. Anyway, don't do it.