hping
has such horrible documentation and seemingly many different types of syntaxes.
I would like to know what the hping
command would be to send a TCP packet with a source IP of 192.168.0.2, a source port of 9455, a destination IP of 192.168.0.1, a destination port of 80, and a payload file named "payload.txt".
I can get by with knowing this, but if you know of a good tutorial for hping (which I'm not sure exists), I could use that too.
I believe this should be the syntax you're looking for:
And if you'd prefer it with "long options", you could use this command line:
Note: Make sure that the source IP you're using exists on the machine you're running it from. If you're using this to spoof an IP that doesn't exist on your box, it will fail (TCP handshake requires bi-directional traffic to work, and it won't with spoofed IPs). Also, if you don't run this as root, you'll likely need to run it under
sudo
.