OS Manuals

/usr/bin/hping2

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 hping2 --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 (75)
OptionDescriptionSource
-h--help show this helphelp
-v--version show versionhelp
-c--count packet counthelp
-i--interval wait (uX for X microseconds, for example -i u1000)help
--fastalias for -i u10000 (10 packets for second)help
--fasteralias for -i u1000 (100 packets for second)help
--floodsent packets as fast as possible.help
-n--numeric numeric outputhelp
-q--quiet quiethelp
-I--interface interface name (otherwise default routing interface)help
-V--verbose verbose modehelp
-D--debug debugging infohelp
-z--bind bind ctrl+z to ttl (default to dst port)help
-Z--unbind unbind ctrl+zhelp
--beepbeep for every matching packet receivedhelp
-0--rawip RAW IP modehelp
-1--icmp ICMP modehelp
-2--udp UDP modehelp
-8--scan SCAN mode.help
-9--listen listen modehelp
-a--spoof spoof source addresshelp
--rand-destrandom destionation address mode.help
--rand-sourcerandom source address mode.help
-t--ttl ttl (default 64)help
-N--id id (default random)help
-W--winid use win* id byte orderinghelp
-r--rel relativize id field (to estimate host traffic)help
-f--frag split packets in more frag.help
-x--morefrag set more fragments flaghelp
-y--dontfrag set dont fragment flaghelp
-g--fragoff set the fragment offsethelp
-m--mtu set virtual mtu, implies --frag if packet size > mtuhelp
-o--tos type of service (default 0x00), try --tos helphelp
-G--rroute includes RECORD_ROUTE option and display the route bufferhelp
--lsrrloose source routing and record routehelp
--ssrrstrict source routing and record routehelp
-H--ipproto set the IP protocol field, only in RAW IP modehelp
-C--icmptype icmp type (default echo request)help
-K--icmpcode icmp code (default 0)help
--icmp-gwset gateway address for ICMP redirect (default 0.0.0.0)help
--icmp-tsAlias for --icmp --icmptype 13 (ICMP timestamp)help
--icmp-addrAlias for --icmp --icmptype 17 (ICMP address subnet mask)help
--icmp-helpdisplay help for others icmp optionshelp
-s--baseport base source port (default random)help
-p--destport [+][+]<port> destination port(default 0) ctrl+z inc/dechelp
-k--keep keep still source porthelp
-w--win winsize (default 64)help
-O--tcpoff set fake tcp data offset (instead of tcphdrlen / 4)help
-Q--seqnum shows only tcp sequence numberhelp
-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.help
-M--setseq set TCP sequence numberhelp
-L--setack set TCP ackhelp
-F--fin set FIN flaghelp
-S--syn set SYN flaghelp
-R--rst set RST flaghelp
-P--push set PUSH flaghelp
-A--ack set ACK flaghelp
-U--urg set URG flaghelp
-X--xmas set X unused flag (0x40)help
-Y--ymas set Y unused flag (0x80)help
--tcpexitcodeuse last tcp->th_flags as exit codehelp
--tcp-timestampenable the TCP timestamp option to guess the HZ/uptimehelp
--clock-skewenable clock skew detection.help
-d--data data size (default is 0)help
-E--file data from filehelp
-e--sign add 'signature'help
-j--dump dump packets in hexhelp
-J--print dump printable charactershelp
-B--safe enable 'safe' protocolhelp
-u--end tell you when --file reached EOF and prevent rewindhelp
-T--traceroute traceroute mode (implies --bind and --ttl 1)help
--tr-stopExit when receive the first not ICMP in traceroute modehelp
--tr-keep-ttlKeep the source TTL fixed, useful to monitor just one hophelp
--tr-no-rttDon't calculate/show RTT information in traceroute modehelp
--apd-sendSend the packet described with APD (see docs/APD.txt)help

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