hping
Legacy TCP/IP packet crafting and analysis tool, the predecessor to hping3
TLDR
SYNOPSIS
hping [options] host
DESCRIPTION
hping (also known as hping2) is a command-line tool that crafts and sends custom TCP, UDP, ICMP, or raw IP packets and displays the target's replies, similar to how ping shows ICMP echo replies. It supports fragmentation, arbitrary packet bodies, and can be used for firewall testing, port scanning, path MTU discovery, traceroute-like probing over arbitrary protocols, and TCP/IP stack auditing.hping3 superseded this version by adding Tcl scripting support, but reuses the same underlying packet-generation code, so hping's command-line flags carry over almost unchanged. Most current Linux distributions only package hping3; the plain hping binary is largely a legacy name kept for compatibility and may not be installed by default.
PARAMETERS
-0, --rawip
Raw IP mode.-1, --icmp
ICMP mode.-2, --udp
UDP mode.-8, --scan range
Port scan mode.-S, --syn
Set TCP SYN flag.-A, --ack
Set TCP ACK flag.-p, --destport port
Destination port.-s, --baseport port
Source port.-c, --count count
Number of packets to send.-i, --interval wait
Interval between packets.-a, --spoof host
Spoof the source address.-T, --traceroute
Traceroute mode.-C type
Set ICMP type.-K code
Set ICMP code.
INSTALL
CAVEATS
Requires root privileges to craft raw packets. hping is unmaintained; new deployments should use hping3 instead, which receives the (limited) ongoing upkeep. Spoofed packets and aggressive scanning may be illegal without authorization and can trigger firewalls or IDS systems.
HISTORY
hping was created by Salvatore Sanfilippo ("antirez", also the creator of Redis) in the late 1990s as a packet generator and analyzer for TCP/IP protocols. Sanfilippo used it to develop the idle scan technique later adopted by Nmap. hping3, released in 2005, replaced it as the actively developed version by adding a Tcl scripting engine on top of the same core packet-crafting code.
SEE ALSO
hping3(8), nmap(1), ping(1), traceroute(1)
