Concepts / Active reconnaissance

Active reconnaissance

Packet crafting

Also called hping3, nping, packet crafting, crafted packet

Building one packet by hand — choosing every flag and field — to probe a target a single reply at a time.

One SYN, three possible answers
One SYN, three possible answers

A SYN-ACK means a program listens, a reset means the port is refused, and silence means a firewall dropped the packet. No connection is ever completed.

Packet crafting is building one packet by hand, choosing every flag and field, and reading the single reply. hping3 and nping do it over raw sockets, so they need root. A lone SYN (hping3 -S) draws a SYN-ACK (flags=SA) from an open port, a [[tcp-reset|reset]] (flags=RA) from a refused one, and nothing from a dropped one: the firewall's policy, read off the wire ([[drop-vs-reject]]). No connection is ever completed.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab