hping
Ping hosts using custom TCP/IP packets
TLDR
View documentation for the original command
SYNOPSIS
hping[options] target
PARAMETERS
-h
Show help.
-v
Verbose mode.
-q
Quiet mode.
-I interface
Listen on interface.
-V
Show hping version.
-c count
Packet count.
-i interval
Interval between packets (uX = X usec, i.e. -i u1000 = 1 msec).
-n
Numeric output.
-z
Keep source port.
--rand-source
Random source address. Useful for DOS testing.
--rand-dest
Random destination address. Useful for DOS testing (only for raw IP mode).
-p port
Destination port.
+port
Increment destination port.
++port
Keep incrementing, starting at specified port.
-s port
Source port.
-k
Keep source port.
-a onoff
Antiflood mode. Send packets more quickly.
-t ttl
Time to live.
-N
Use tcp only.
-H
Use udp only.
-1
ICMP protocol.
-2
UDP protocol.
--icmp-ipver
Set IP version for ICMP packets.
--icmp-ts
Alias for --icmp-timestamp
--icmp-addr
Alias for --icmp-address
DESCRIPTION
hping is a command-line packet crafting tool for network testing and security auditing.
It allows users to craft custom TCP/IP packets to probe network devices, firewall rules, and host behaviors. Unlike ping, which primarily sends ICMP echo requests, hping supports various protocols, including TCP, UDP, ICMP, and RAW IP, providing greater flexibility in network diagnosis and penetration testing. hping can be used for port scanning, tracerouting, firewall testing, OS fingerprinting, and denial-of-service simulations. Its ability to customize packet headers and content makes it a powerful tool for advanced network analysis and security assessments.
CAVEATS
hping requires root privileges to craft raw packets. Incorrect use can disrupt network services or be interpreted as malicious activity. Use responsibly and only on networks you have explicit permission to test.
MODES OF OPERATION
hping supports multiple modes, each with a specific default protocol. You can force a particular protocol with options like -1 (ICMP), -2 (UDP), or by using TCP flags. Understanding the default behavior and available options is crucial for effective packet crafting.
TCP FLAGS
hping allows you to set specific TCP flags (SYN, ACK, RST, FIN, URG, PSH) to simulate different connection states or attack vectors. Mastering TCP flag manipulation is essential for advanced network testing scenarios.
SECURITY CONSIDERATIONS
When using hping, be aware of the legal and ethical implications. Always obtain proper authorization before conducting network scans or penetration tests. Misusing hping can lead to legal consequences and reputational damage.
HISTORY
hping was originally developed by Salvatore Sanfilippo (aka Antirez) to test and audit firewall implementations. Over time, it has evolved into a versatile network testing tool used by security professionals and network administrators worldwide. Its continuous development and active community support have contributed to its widespread adoption.
SEE ALSO
ping(8), traceroute(8), nmap(1)