LinuxCommandLibrary

hping

network packet crafting tool that sends custom TCP, UDP, ICMP, or raw IP

TLDR

Send ICMP ping

$ hping3 -1 [host]
copy
Send TCP SYN to port
$ hping3 -S -p [80] [host]
copy
Send UDP packets
$ hping3 -2 -p [53] [host]
copy
Traceroute mode
$ hping3 --traceroute -1 [host]
copy
Specify packet count
$ hping3 -c [5] -1 [host]
copy
Set source IP (spoofing)
$ hping3 -a [source-ip] -S -p [80] [host]
copy
Port scan
$ hping3 -8 [1-100] -S [host]
copy

SYNOPSIS

hping3 [options] host

DESCRIPTION

hping3 is a network packet crafting tool that sends custom TCP, UDP, ICMP, or raw IP packets and displays replies. Use it for firewall testing, port scanning, network performance testing, path MTU discovery, and OS fingerprinting. Supports packet fragmentation and arbitrary body content.

PARAMETERS

-1

ICMP mode (default echo request).
-2
UDP mode.
-S
TCP SYN flag.
-p port
Destination port.
-c count
Number of packets.
-a address
Spoof source IP.
-8 range
Port scan mode.
--traceroute
Traceroute mode.
-C type
Set ICMP type.
-K code
Set ICMP code.

CAVEATS

Requires root privileges. Some features may be blocked by firewalls or IDS systems.

SEE ALSO

ping(1), nmap(1), traceroute(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community