Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com 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 wiki.hping.org/86 first. –  David J. Liszewski Nov 9 '10 at 19:12
    
Operating system is Windows. –  Donald Taylor Nov 9 '10 at 20:35

1 Answer 1

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

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

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

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

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

 
discard

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.