GO KALI FREE

hping3

Stress Testing

Advancedhigh risk

hping3 is a network tool able to send custom TCP/IP packets and display target replies. It is widely used for firewall testing, port scanning, network testing, and performance analysis.

Installation

sudo apt install hping3

Basic Syntax

hping3 [options] <target>

Quick Facts

Full Name
hping3
License
GNU GPL v2
Author
Salvatore Sanfilippo (antirez)
Written In
C
Platforms
Linux, macOS, BSD
Category
Stress Testing / Packet Crafting
First Release
2006
Protocols
TCP, UDP, ICMP, RAW-IP

Tool Overview

hping3 is a powerful command-line packet crafting tool that enables security professionals to construct and send custom TCP/IP packets. Unlike Nmap which follows predefined scanning patterns, hping3 gives full control over every packet field including flags, sequence numbers, window sizes, and payload content.

hping3 is widely used for firewall rule testing, port scanning, operating system fingerprinting, network performance measurement, and authorized stress testing. Its ability to craft arbitrary packets makes it invaluable for testing how network devices handle unusual or malformed traffic.

The tool supports TCP, UDP, ICMP, and RAW-IP protocols, with features for fragmentation, source IP spoofing, port scanning, and flood generation. It also includes a Tcl-based scripting engine for automated testing scenarios.

Common Commands

hping3 -S -p 80 targetSYN packet to port 80 — Test port response
hping3 --flood -S -p 80 targetSYN flood — Stress testing (authorized)
hping3 -1 targetICMP ping — Basic connectivity
hping3 -S --scan 1-1000 targetPort scan — Find open ports
hping3 -S -p 80 --spoof 1.2.3.4 targetSpoofed source — Test firewall rules
hping3 -A -p 80 targetACK scan — Probe stateful firewall inspection behavior
hping3 -2 -p 53 targetUDP mode — Send UDP packets to test port 53 (DNS)
hping3 -F -P -U -p 80 targetXmas scan — Set FIN, PUSH, and URG flags together
hping3 -S -p ++1 -c 100 targetIncrementing port — Increase destination port by 1 for each packet
hping3 -1 -C 8 targetICMP type — Send ICMP echo requests (type 8) explicitly
hping3 -S -p 80 --tcp-timestamp targetTCP timestamp — Estimate target uptime from timestamps
hping3 --flood -S -p 80 --rand-source targetRandomized flood — SYN flood with random spoofed sources (authorized)
hping3 -S -p 80 -f targetFragmentation — Split packets to test IDS/firewall handling
hping3 -1 -d 65495 targetLarge ICMP — Send oversized ICMP payload (ping-of-death style test)
hping3 -S -p 80 -a 10.0.0.5 targetFixed spoof — Set a specific spoofed source address

Step-by-Step Guide

  1. 1Ensure you have explicit permission to test the target infrastructure
  2. 2Choose your desired protocol method, such as TCP SYN or ICMP
  3. 3Configure the specific port numbers and packet flags for your test
  4. 4Execute the tool to start blasting the crafted packets
  5. 5Monitor the responses to evaluate how the network devices handle the load

Warnings

Use Cases

Firewall Testing

Verify firewall rules by sending custom packets with specific flags, ports, and source addresses.

Port Scanning

Assess open ports using SYN, ACK, FIN, or NULL scans with full control over packet headers.

Stress Testing

Simulate denial-of-service conditions with SYN floods, ICMP floods, or custom flood patterns.

OS Fingerprinting

Identify target operating systems by analyzing responses to crafted TCP/IP packets.

Spoofing Tests

Validate anti-spoofing firewall rules by sending packets with forged source IP addresses.

Path MTU Discovery

Discover maximum transmission unit along network paths using fragmented packets.

Key Features

Related Tools

Nmap

Information Gathering

Automated network scanner with service detection and scripting.

Scapy

Sniffing & Spoofing

Python packet manipulation library for programmatic packet crafting.

Slowloris

Stress Testing

Slow HTTP DoS tool for testing web server connection handling.

GoldenEye

Stress Testing

HTTP KeepAlive stress testing tool for web applications.

tcpdump

Sniffing & Spoofing

Command-line packet capture tool for analyzing hping3 test results.

Wireshark

Sniffing & Spoofing

GUI packet analysis for deep inspection of crafted packet responses.

Frequently Asked Questions

What is hping3 used for?

hping3 is a command-line packet crafting tool used for firewall testing, port scanning, network stress testing, and TCP/IP stack analysis. It allows you to send custom packets with arbitrary flags, payloads, and headers to test how network devices respond.

How do I use hping3 for port scanning?

Use hping3 -S --scan 1-1000 target_ip to SYN scan the first 1000 ports. Unlike Nmap, hping3 gives you full control over packet flags, window sizes, and TCP options. Use -S for SYN, -A for ACK, -F for FIN, and -P for PUSH scans.

Can hping3 spoof IP addresses?

Yes, use the --spoof flag to spoof the source IP address: hping3 -S -p 80 --spoof 1.2.3.4 target. This is useful for firewall rule testing to verify that spoofed traffic is properly filtered.

Is hping3 legal to use?

hping3 is a legitimate network testing tool. However, using it for flood attacks, port scanning without authorization, or any form of denial of service against systems you do not own is illegal. Always obtain explicit written permission before testing.

Tags

#stress-testing#networking#packet-crafting#scanning

Output Explanation

Outputs a stream showing the packets sent and the exact responses received, including latency metrics and TCP flag statuses.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.