OS Manuals

/usr/bin/hping3

hping3 is a command-line network tool that builds and sends custom TCP/IP packets (TCP, UDP, ICMP, raw IP) and shows the target's replies, much like ping does with ICMP. It supports fragmentation, arbitrary packet sizes and payloads, traceroute-style probing over any supported protocol, firewalking, OS fingerprinting, port scanning (--scan) and TCP/IP stack auditing. It captures packets through libpcap.

From hping3 3.0.0_alpha1_git20141105-r0 (enterprise-packages), captured 2026-11-08 by running hping3 --help (exit 0). permalink

usage: hping host [options]
  -h  --help      show this help
  -v  --version   show version
  -c  --count     packet count
  -i  --interval  wait (uX for X microseconds, for example -i u1000)
      --fast      alias for -i u10000 (10 packets for second)
      --faster    alias for -i u1000 (100 packets for second)
      --flood	   sent packets as fast as possible. Don't show replies.
  -n  --numeric   numeric output
  -q  --quiet     quiet
  -I  --interface interface name (otherwise default routing interface)
  -V  --verbose   verbose mode
  -D  --debug     debugging info
  -z  --bind      bind ctrl+z to ttl           (default to dst port)
  -Z  --unbind    unbind ctrl+z
      --beep      beep for every matching packet received
Mode
  default mode     TCP
  -0  --rawip      RAW IP mode
  -1  --icmp       ICMP mode
  -2  --udp        UDP mode
  -8  --scan       SCAN mode.
                   Example: hping --scan 1-30,70-90 -S www.target.host
  -9  --listen     listen mode
IP
  -a  --spoof      spoof source address
  --rand-dest      random destionation address mode. see the man.
  --rand-source    random source address mode. see the man.
  -t  --ttl        ttl (default 64)
  -N  --id         id (default random)
  -W  --winid      use win* id byte ordering
  -r  --rel        relativize id field          (to estimate host traffic)
  -f  --frag       split packets in more frag.  (may pass weak acl)
  -x  --morefrag   set more fragments flag
  -y  --dontfrag   set dont fragment flag
  -g  --fragoff    set the fragment offset
  -m  --mtu        set virtual mtu, implies --frag if packet size > mtu
  -o  --tos        type of service (default 0x00), try --tos help
  -G  --rroute     includes RECORD_ROUTE option and display the route buffer
  --lsrr           loose source routing and record route
  --ssrr           strict source routing and record route
  -H  --ipproto    set the IP protocol field, only in RAW IP mode
ICMP
  -C  --icmptype   icmp type (default echo request)
  -K  --icmpcode   icmp code (default 0)
      --force-icmp send all icmp types (default send only supported types)
      --icmp-gw    set gateway address for ICMP redirect (default 0.0.0.0)
      --icmp-ts    Alias for --icmp --icmptype 13 (ICMP timestamp)
      --icmp-addr  Alias for --icmp --icmptype 17 (ICMP address subnet mask)
      --icmp-help  display help for others icmp options
UDP/TCP
  -s  --baseport   base source port             (default random)
  -p  --destport   [+][+]<port> destination port(default 0) ctrl+z inc/dec
  -k  --keep       keep still source port
  -w  --win        winsize (default 64)
  -O  --tcpoff     set fake tcp data offset     (instead of tcphdrlen / 4)
  -Q  --seqnum     shows only tcp sequence number
  -b  --badcksum   (try to) send packets with a bad IP checksum
                   many systems will fix the IP checksum sending the packet
                   so you'll get bad UDP/TCP checksum instead.
  -M  --setseq     set TCP sequence number
  -L  --setack     set TCP ack
  -F  --fin        set FIN flag
  -S  --syn        set SYN flag
  -R  --rst        set RST flag
  -P  --push       set PUSH flag
  -A  --ack        set ACK flag
  -U  --urg        set URG flag
  -X  --xmas       set X unused flag (0x40)
  -Y  --ymas       set Y unused flag (0x80)
  --tcpexitcode    use last tcp->th_flags as exit code
  --tcp-timestamp  enable the TCP timestamp option to guess the HZ/uptime
Clock skew detection
  --clock-skew     enable clock skew detection. Try with -S against open port
  --clock-skew-win window of time (in seconds) for CS detection. Default 300
  --clock-skew-shift timestamp samples to use for error correction. Default 5
  --clock-skew-packets-per-sample # of packets to extract a sample. Default 10
Common
  -d  --data       data size                    (default is 0)
  -E  --file       data from file
  -e  --sign       add 'signature'
  -j  --dump       dump packets in hex
  -J  --print      dump printable characters
  -B  --safe       enable 'safe' protocol
  -u  --end        tell you when --file reached EOF and prevent rewind
  -T  --traceroute traceroute mode              (implies --bind and --ttl 1)
  --tr-stop        Exit when receive the first not ICMP in traceroute mode
  --tr-keep-ttl    Keep the source TTL fixed, useful to monitor just one hop
  --tr-no-rtt	    Don't calculate/show RTT information in traceroute mode
ARS packet description (new, unstable)
  --apd-send       Send the packet described with APD (see docs/APD.txt)
Options (82)
OptionDescriptionSource
-h --helpShow an help screen on standard output, so you can pipe to less.help + man
-v --versionShow version information and API used to access to data link layer, linux sock packet or libpcap.help + man
-c --countStop after sending (and receiving) count response packets.help + man
-i --intervalWait the specified number of seconds or micro seconds between sending each packet.help + man
--fastalias for -i u10000 (10 packets for second)help + man
--fasteralias for -i u1000 (100 packets for second)help + man
--floodSent packets as fast as possible, without taking care to show incoming replies.help + man
-n --numericNumeric output only, No attempt will be made to lookup symbolic names for host addresses.help + man
-q --quiet--quiet quiethelp + man
-I --interfaceBy default on linux and BSD systems hping2 uses default routing interface.help + man
-V --verbose--verbose verbose modehelp + man
-D --debugEnable debug mode, it's useful when you experience some problem with hping2.help + man
-z --bindBind CTRL+Z to time to live (TTL) so you will able to increment/decrement ttl of outgoing packets pressing CTRL+Z once or twice.help + man
-Z --unbindUnbind CTRL+Z so you will able to stop hping2.help + man
--beepBeep for every matching received packet (but not for ICMP errors).help + man
-0--rawip RAW IP modehelp
-1--icmp ICMP modehelp
-2--udp UDP modehelp
-8--scan SCAN mode.help
-9--listen listen modehelp
-a --spoofUse this option in order to set a fake IP source address, this option ensures that target will not gain your real address.help + man
--rand-destThis option enables the random destination mode.help + man
--rand-sourceThis option enables the random source mode.help + man
-t --ttlUsing this option you can set TTL (time to live) of outgoing packets, it's likely that you will use this with --traceroute or --bind options.help + man
-N --id--id id (default random)help + man
-W --winidid from Windows systems before Win2k has different byte ordering, if this option is enable hping2 will properly display id replies from those Windows.help + man
-r --rel--rel relativize id field (to estimate host traffic)help + man
-f --fragSplit packets in more fragments, this may be useful in order to test IP stacks fragmentation performance and to test if some packet filter is so weak that can be passed using tiny fragments…help + man
-x --morefragSet more fragments IP flag, use this option if you want that target host send an ICMP time-exceeded during reassembly.help + man
-y --dontfragSet don't fragment IP flag, this can be used to perform MTU path discovery.help + man
-g --fragoff--fragoff set the fragment offsethelp + man
-m --mtuSet different 'virtual mtu' than 16 when fragmentation is enabled.help + man
-o --tosSet Type Of Service (TOS), for more information try --tos help.help + man
-G --rroute--rroute includes RECORD_ROUTE option and display the route bufferhelp + man
--lsrrloose source routing and record routehelp
--ssrrstrict source routing and record routehelp
-H --ipproto--ipproto set the IP protocol field, only in RAW IP modehelp + man
-C --icmptypeSet icmp type, default is ICMP echo request (implies --icmp).help + man
-K --icmpcodeSet icmp code, default is 0 (implies --icmp).help + man
--icmp-gwset gateway address for ICMP redirect (default 0.0.0.0)help
--icmp-tsAlias for --icmptype 13 (to send ICMP timestamp requests).help + man
--icmp-addrAlias for --icmptype 17 (to send ICMP address mask requests).help + man
--icmp-helpdisplay help for others icmp optionshelp
-s --baseporthping2 uses source port in order to guess replies sequence number.help + man
-p--destport [+][+]<port> destination port(default 0) ctrl+z inc/dechelp
-k--keep keep still source porthelp
-w --win--win winsize (default 64)help + man
-O --tcpoff--tcpoff set fake tcp data offset (instead of tcphdrlen / 4)help + man
-Q --seqnumThis option can be used in order to collect sequence numbers generated by target host.help + man
-b --badcksum--badcksum (try to) send packets with a bad IP checksum many systems will fix the IP checksum sending the packet so you'll get bad UDP/TCP checksum instead.help + man
-M --tcpseq--setseq set TCP sequence numberhelp + man
-L --tcpack--setack set TCP ackhelp + man
-F --fin--fin set FIN flaghelp + man
-S --syn--syn set SYN flaghelp + man
-R --rst--rst set RST flaghelp + man
-P --push--push set PUSH flaghelp + man
-A --ack--ack set ACK flaghelp + man
-U --urg--urg set URG flaghelp + man
-X --xmas--xmas set X unused flag (0x40)help + man
-Y --ymas--ymas set Y unused flag (0x80)help + man
--tcpexitcodeExit with last received packet tcp->th_flag as exit code.help + man
--tcp-timestampEnable the TCP timestamp option, and try to guess the timestamp update frequency and the remote system uptime.help + man
--clock-skewenable clock skew detection.help
-d --data--data data size (default is 0)help + man
-E --fileUse filename contents to fill packet's data.help + man
-e --signFill first signature length bytes of data with signature.help + man
-j --dumpDump received packets in hex.help + man
-J --printDump received packets' printable characters.help + man
-B --safeEnable safe protocol, using this option lost packets in file transfers will be resent.help + man
-u --endIf you are using --file filename option, tell you when EOF has been reached.help + man
-T --traceroute--traceroute traceroute mode (implies --bind and --ttl 1)help + man
--tr-stopIf this option is specified hping will exit once the first packet that isn't an ICMP time exceeded is received.help + man
--tr-keep-ttlKeep the TTL fixed in traceroute mode, so you can monitor just one hop in the route.help + man
--tr-no-rttDon't calculate/show RTT information in traceroute modehelp + man
--apd-sendSend the packet described with APD (see docs/APD.txt)help
--icmp-ipverSet IP version of IP header contained into ICMP data, default is 4. (in the manual page but not in --help)man
--icmp-iphlenSet IP header length of IP header contained into ICMP data, default is 5 (5 words of 32 bits). (in the manual page but not in --help)man
--icmp-iplenSet IP packet length of IP header contained into ICMP data, default is the real length. (in the manual page but not in --help)man
--icmp-ipidSet IP id of IP header contained into ICMP data, default is random. (in the manual page but not in --help)man
--icmp-ipprotoSet IP protocol of IP header contained into ICMP data, default is TCP. (in the manual page but not in --help)man
--icmp-cksumSet ICMP checksum, for default is the valid checksum. (in the manual page but not in --help)man
--keepkeep still source port, see --baseport for more information. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.