Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, a source port of 9455, a destination IP of, 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.

share|improve this question

migrated from Nov 9 '10 at 19:30

This question came from our site for professional and enthusiast programmers.

what's yer OS ? If Windows, you may want to look at first. – David J. Liszewski Nov 9 '10 at 19:12
Operating system is Windows. – Donald Taylor Nov 9 '10 at 20:35

I believe this should be the syntax you're looking for:

hping -a -E payload.txt -d $(wc -l payload.txt | cut -d' ' -f1) -k -s 9455 -p 80

And if you'd prefer it with "long options", you could use this command line:

hping --spoof --file payload.txt --data $(wc -l payload.txt | cut -d' ' -f1) --keep --baseport 9455 --destport 80

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.