NPING(1)
π nping(1) β the Nping Reference Guide, group-chat edition π
okay bestie, this is the Nping Reference Guide and honestly? it ate. π everything you need is in here β the vibe is just β¨betterβ¨ now. let's go.
β¨ NAME β¨
nping β a network packet generation tool and ping utility. that's the whole name, no notes. π¦
β¨ SYNOPSIS β¨
nping [Options] {targets}
β¨ DESCRIPTION β¨
okay so Nping is an open-source tool for network packet generation, response analysis and response time measurement. π«Ά Nping lets you generate network packets across a wide range of protocols, and it lets you tune virtually any field of the protocol headers β yes, literally any field, she's that flexible.
and like, while Nping can be used as a simple ping utility to detect active hosts (iconic, low-effort, works every time), it can also be used as a raw packet generator for network stack stress tests, ARP poisoning, Denial of Service attacks, route tracing, and other purposes. π so yeah, she contains multitudes.
ngl bestie, some of those use cases (ARP poisoning, DoS attacks) are not cute and are the kind of thing you should only ever point at your own stuff or at systems you're actually allowed to test. the manual just lists them as capabilities β it is not out here giving you permission. π
Additionally, Nping offers a special mode of operation called the "Echo Mode", that lets users see how the generated probes change in transit, revealing the differences between the transmitted packets and the packets received at the other end. See section "Echo Mode" for details. π like getting read receipts and seeing how your message got edited on the way there.
The output from Nping is a list of the packets that are being sent and received. The level of detail depends on the options used. π
A typical Nping execution is shown in Example 1. The only Nping arguments used in this example are -c, to specify the number of times to target each host, --tcp to specify TCP Probe Mode, -p 80,433 to specify the target ports; and then the two target hostnames. β
πΈ Example 1. A representative Nping execution
# nping -c 1 --tcp -p 80,433 scanme.nmap.org google.com
Starting Nping ( https://nmap.org/nping )
SENT (0.0120s) TCP 96.16.226.135:50091 > 64.13.134.52:80 S ttl=64 id=52072 iplen=40 seq=1077657388 win=1480
RCVD (0.1810s) TCP 64.13.134.52:80 > 96.16.226.135:50091 SA ttl=53 id=0 iplen=44 seq=4158134847 win=5840 <mss 1460>
SENT (1.0140s) TCP 96.16.226.135:50091 > 74.125.45.100:80 S ttl=64 id=13932 iplen=40 seq=1077657388 win=1480
RCVD (1.1370s) TCP 74.125.45.100:80 > 96.16.226.135:50091 SA ttl=52 id=52913 iplen=44 seq=2650443864 win=5720 <mss 1430>
SENT (2.0140s) TCP 96.16.226.135:50091 > 64.13.134.52:433 S ttl=64 id=8373 iplen=40 seq=1077657388 win=1480
SENT (3.0140s) TCP 96.16.226.135:50091 > 74.125.45.100:433 S ttl=64 id=23624 iplen=40 seq=1077657388 win=1480
Statistics for host scanme.nmap.org (64.13.134.52):
| Probes Sent: 2 | Rcvd: 1 | Lost: 1 (50.00%)
|_ Max rtt: 169.720ms | Min rtt: 169.720ms | Avg rtt: 169.720ms
Statistics for host google.com (74.125.45.100):
| Probes Sent: 2 | Rcvd: 1 | Lost: 1 (50.00%)
|_ Max rtt: 122.686ms | Min rtt: 122.686ms | Avg rtt: 122.686ms
Raw packets sent: 4 (160B) | Rcvd: 2 (92B) | Lost: 2 (50.00%)
Tx time: 3.00296s | Tx bytes/s: 53.28 | Tx pkts/s: 1.33
Rx time: 3.00296s | Rx bytes/s: 30.64 | Rx pkts/s: 0.67
Nping done: 2 IP addresses pinged in 4.01 seconds
The newest version of Nping can be obtained with Nmap at https://nmap.org. The newest version of this man page is available at https://nmap.org/book/nping-man.html. π₯ go get the fresh one, bestie.
β¨ OPTIONS SUMMARY β¨
This options summary is printed when Nping is run with no arguments. It helps people remember the most common options, but is no substitute for the in-depth documentation in the rest of this manual. Some obscure options aren't even included here. π so like, cute lil cheat sheet β not the whole syllabus.
Nping 0.7.92SVN ( https://nmap.org/nping )
Usage: nping [Probe mode] [Options] {target specification}
TARGET SPECIFICATION:
Targets may be specified as hostnames, IP addresses, networks, etc.
Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.*.1-24
PROBE MODES:
--tcp-connect : Unprivileged TCP connect probe mode.
--tcp : TCP probe mode.
--udp : UDP probe mode.
--icmp : ICMP probe mode.
--arp : ARP/RARP probe mode.
--tr, --traceroute : Traceroute mode (can only be used with
TCP/UDP/ICMP modes).
TCP CONNECT MODE:
-p, --dest-port <port spec> : Set destination port(s).
-g, --source-port <portnumber> : Try to use a custom source port.
TCP PROBE MODE:
-g, --source-port <portnumber> : Set source port.
-p, --dest-port <port spec> : Set destination port(s).
--seq <seqnumber> : Set sequence number.
--flags <flag list> : Set TCP flags (ACK,PSH,RST,SYN,FIN...)
--ack <acknumber> : Set ACK number.
--win <size> : Set window size.
--badsum : Use a random invalid checksum.
UDP PROBE MODE:
-g, --source-port <portnumber> : Set source port.
-p, --dest-port <port spec> : Set destination port(s).
--badsum : Use a random invalid checksum.
ICMP PROBE MODE:
--icmp-type <type> : ICMP type.
--icmp-code <code> : ICMP code.
--icmp-id <id> : Set identifier.
--icmp-seq <n> : Set sequence number.
--icmp-redirect-addr <addr> : Set redirect address.
--icmp-param-pointer <pnt> : Set parameter problem pointer.
--icmp-advert-lifetime <time> : Set router advertisement lifetime.
--icmp-advert-entry <IP,pref> : Add router advertisement entry.
--icmp-orig-time <timestamp> : Set originate timestamp.
--icmp-recv-time <timestamp> : Set receive timestamp.
--icmp-trans-time <timestamp> : Set transmit timestamp.
ARP/RARP PROBE MODE:
--arp-type <type> : Type: ARP, ARP-reply, RARP, RARP-reply.
--arp-sender-mac <mac> : Set sender MAC address.
--arp-sender-ip <addr> : Set sender IP address.
--arp-target-mac <mac> : Set target MAC address.
--arp-target-ip <addr> : Set target IP address.
IPv4 OPTIONS:
-S, --source-ip : Set source IP address.
--dest-ip <addr> : Set destination IP address (used as an
alternative to {target specification} ).
--tos <tos> : Set type of service field (8bits).
--id <id> : Set identification field (16 bits).
--df : Set Don't Fragment flag.
--mf : Set More Fragments flag.
--evil : Set Reserved / Evil flag.
--ttl <hops> : Set time to live [0-255].
--badsum-ip : Use a random invalid checksum.
--ip-options <S|R [route]|L [route]|T|U ...> : Set IP options
--ip-options <hex string> : Set IP options
--mtu <size> : Set MTU. Packets get fragmented if MTU is
small enough.
IPv6 OPTIONS:
-6, --IPv6 : Use IP version 6.
--dest-ip : Set destination IP address (used as an
alternative to {target specification}).
--hop-limit : Set hop limit (same as IPv4 TTL).
--traffic-class <class> : : Set traffic class.
--flow <label> : Set flow label.
ETHERNET OPTIONS:
--dest-mac <mac> : Set destination mac address. (Disables
ARP resolution)
--source-mac <mac> : Set source MAC address.
--ether-type <type> : Set EtherType value.
PAYLOAD OPTIONS:
--data <hex string> : Include a custom payload.
--data-string <text> : Include a custom ASCII text.
--data-length <len> : Include len random bytes as payload.
ECHO CLIENT/SERVER:
--echo-client <passphrase> : Run Nping in client mode.
--echo-server <passphrase> : Run Nping in server mode.
--echo-port <port> : Use custom <port> to listen or connect.
--no-crypto : Disable encryption and authentication.
--once : Stop the server after one connection.
--safe-payloads : Erase application data in echoed packets.
TIMING AND PERFORMANCE:
Options which take <time> are in seconds, or append 'ms' (milliseconds),
's' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m, 0.25h).
--delay <time> : Adjust delay between probes.
--rate <rate> : Send num packets per second.
MISC:
-h, --help : Display help information.
-V, --version : Display current version number.
-c, --count <n> : Stop after <n> rounds.
-e, --interface <name> : Use supplied network interface.
-H, --hide-sent : Do not display sent packets.
-N, --no-capture : Do not try to capture replies.
--privileged : Assume user is fully privileged.
--unprivileged : Assume user lacks raw socket privileges.
--send-eth : Send packets at the raw Ethernet layer.
--send-ip : Send packets using raw IP sockets.
--bpf-filter <filter spec> : Specify custom BPF filter.
OUTPUT:
-v : Increment verbosity level by one.
-v[level] : Set verbosity level. E.g: -v4
-d : Increment debugging level by one.
-d[level] : Set debugging level. E.g: -d3
-q : Decrease verbosity level by one.
-q[N] : Decrease verbosity level N times
--quiet : Set verbosity and debug level to minimum.
--debug : Set verbosity and debug to the max level.
EXAMPLES:
nping scanme.nmap.org
nping --tcp -p 80 --flags rst --ttl 2 192.168.1.1
nping --icmp --icmp-type time --delay 500ms 192.168.254.254
nping --echo-server "public" -e wlan0 -vvv
nping --echo-client "public" echo.nmap.org --tcp -p1-1024 --flags ack
SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES
π«Ά and yeah, that "SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES" line is not a joke β there's so much more coming, so keep reading instead of closing the tab. π
π― TARGET SPECIFICATION π―
Okay so bestie, here's the tea: anything on the nping command line that isn't an option or an option argument is a target host spec. That's it, that's the rule. And Nping uses the exact same target-specification syntax that Nmap does, so if you already know Nmap you're literally already winning. The simplest case is just one single target given by IP address or hostname. Easy. Slay. β¨
Nping also supports CIDR-style addressing. You append /numbits to an IPv4 address or hostname, and Nping sends probes to every IP address for which the first numbits are the same as for the reference IP or hostname you gave it. Like, for example, 192.168.10.0/24 would send probes to the 256 hosts between 192.168.10.0 (binary: 11000000 10101000 00001010 00000000) and 192.168.10.255 (binary: 11000000 10101000 00001010 11111111), inclusive. And 192.168.10.40/24 would ping exactly the same targets β same vibe, different address, no cap. Given that the host scanme.nmap.org is at the IP address 64.13.134.52, the specification scanme.nmap.org/16 would send probes to the 65,536 IP addresses between 64.13.0.0 and 64.13.255.255. The smallest allowed value is /0, which targets the whole entire Internet (iconic, terrifying, kind of a lot). The largest value is /32, which targets just the named host or IP address because all address bits are fixed. π
CIDR notation is short but not always flexible enough, and honestly sometimes you need more. For example, you might want to send probes to 192.168.0.0/16 but skip any IPs ending with .0 or .255 because they may be used as subnet network and broadcast addresses. Nping supports this through octet range addressing. Rather than specify a normal IP address, you can specify a comma-separated list of numbers or ranges for each octet. For example, 192.168.0-255.1-254 will skip all addresses in the range that end in .0 or .255, and 192.168.3-5,7.1 will target the four addresses 192.168.3.1, 192.168.4.1, 192.168.5.1, and 192.168.7.1. Either side of a range may be omitted β the default values are 0 on the left and 255 on the right. Using - by itself is the same as 0-255, but remember to use 0- in the first octet so the target specification doesn't look like a command-line option (imagine the confusion, we'd all be crying π). Ranges need not be limited to the final octets either: the specifier 0-.-.13.37 will send probes to all IP addresses on the Internet ending in .13.37. This sort of broad sampling can be useful for Internet surveys and research, iykyk. π¦
IPv6 addresses can only be specified by their fully qualified IPv6 address or hostname. CIDR and octet ranges aren't supported for IPv6 because they are rarely useful. That's just how it is, bestie. π
Nping accepts multiple host specifications on the command line, and they don't need to be the same type. So this:
nping scanme.nmap.org 192.168.0.0/8 10.0.0,1,3-7.-
does what you would expect. Mixing and matching, main character energy, we love to see it. π
βοΈ OPTION SPECIFICATION βοΈ
Nping is designed to be very flexible and fit a wide variety of needs. As with most command-line tools, its behavior can be adjusted using command-line options. These general principles apply to option arguments, unless stated otherwise. π
π’ Numbers
Options that take integer numbers can accept values specified in decimal, octal or hexadecimal base:
- When a number starts with
0x, it will be treated as hexadecimal. - When it simply starts with
0, it will be treated as octal. - Otherwise, Nping will assume the number has been specified in base 10.
Virtually all numbers that can be supplied from the command line are unsigned so, as a general rule, the minimum value is zero. Users may also specify the word random or rand to make Nping generate a random value within the expected range. Surprise! Chaos! Gamblecore. π
π IP addresses
IP addresses may be given as:
- IPv4 addresses (e.g.
192.168.1.1) - IPv6 addresses (e.g.
2001:db8:85a3::8e4c:760:7146) - hostnames, which will be resolved using the default DNS server configured in the host system
π MAC addresses
Options that take MAC addresses accept the usual colon-separated 6 hex byte format (e.g. 00:50:56:d4:01:98). Hyphens may also be used instead of colons (e.g. 00-50-56-c0-00-08). The special word random or rand sets a random address and the word broadcast or bcast sets ff:ff:ff:ff:ff:ff. Super convenient, no notes. β
π GENERAL OPERATION π
Okay so this is the part where it gets a little spicy. Unlike other ping and packet generation tools, Nping supports multiple target host and port specifications. While this provides great flexibility, it is not obvious how Nping handles situations where there is more than one host and/or more than one port to send probes to. This section explains how Nping behaves in these cases, so buckle up bestie. π«Ά
When multiple target hosts are specified, Nping rotates among them in round-robin fashion. This gives slow hosts more time to send their responses before another probe is sent to them β thoughtful king behaviour, honestly. Ports are also scheduled using round robin. So, unless only one port is specified, Nping never sends two probes to the same target host and port consecutively. Periodt. π
The loop around targets is the βinner loopβ and the loop around ports is the βouter loopβ. All targets will be sent a probe for a given port before moving on to the next port. Between probes, Nping waits a configurable amount of time called the βinter-probe delayβ, which is controlled by the --delay option. These examples show how it works β and yes the timestamps are real, look at those little increments, so satisfying:
# nping --tcp -c 2 1.1.1.1 -p 100-102
Starting Nping ( https://nmap.org/nping )
SENT (0.0210s) TCP 192.168.1.77 > 1.1.1.1:100
SENT (1.0230s) TCP 192.168.1.77 > 1.1.1.1:101
SENT (2.0250s) TCP 192.168.1.77 > 1.1.1.1:102
SENT (3.0280s) TCP 192.168.1.77 > 1.1.1.1:100
SENT (4.0300s) TCP 192.168.1.77 > 1.1.1.1:101
SENT (5.0320s) TCP 192.168.1.77 > 1.1.1.1:102
See how it cycles through 100, 101, 102 and then goes back around? That's the outer loop doing its thing. π«
# nping --tcp -c 2 1.1.1.1 2.2.2.2 3.3.3.3 -p 8080
Starting Nping ( https://nmap.org/nping )
SENT (0.0230s) TCP 192.168.0.21 > 1.1.1.1:8080
SENT (1.0240s) TCP 192.168.0.21 > 2.2.2.2:8080
SENT (2.0260s) TCP 192.168.0.21 > 3.3.3.3:8080
SENT (3.0270s) TCP 192.168.0.21 > 1.1.1.1:8080
SENT (4.0290s) TCP 192.168.0.21 > 2.2.2.2:8080
SENT (5.0310s) TCP 192.168.0.21 > 3.3.3.3:8080
And here it's the targets getting the rotation treatment, since there's only one port in play. Cute. πΈ
# nping --tcp -c 1 --delay 500ms 1.1.1.1 2.2.2.2 3.3.3.3 -p 137-139
Starting Nping ( https://nmap.org/nping )
SENT (0.0230s) TCP 192.168.0.21 > 1.1.1.1:137
SENT (0.5250s) TCP 192.168.0.21 > 2.2.2.2:137
SENT (1.0250s) TCP 192.168.0.21 > 3.3.3.3:137
SENT (1.5280s) TCP 192.168.0.21 > 1.1.1.1:138
SENT (2.0280s) TCP 192.168.0.21 > 2.2.2.2:138
SENT (2.5310s) TCP 192.168.0.21 > 3.3.3.3:138
SENT (3.0300s) TCP 192.168.0.21 > 1.1.1.1:139
SENT (3.5330s) TCP 192.168.0.21 > 2.2.2.2:139
SENT (4.0330s) TCP 192.168.0.21 > 3.3.3.3:139
Notice the --delay 500ms making everything take half a second between probes β every target gets port 137 first, then we move on to 138, then 139. Inner loop inside the outer loop, like a little nested matryoshka of packets. Ate. π₯π
β¨ PROBE MODES β¨
Okay bestie, so Nping speaks so many protocols it's basically multilingual π . And yeah, sometimes it can clock which mode you want from the options you used (she's smart like that), but honestly? Just tell her explicitly. It's giving "clear communication is the key to a healthy relationship" energy. Specify the mode. Trust me. π«Ά
--tcp-connect (TCP Connect mode)
So this one is literally the default mode when you don't have raw packet privileges β like when you're just a regular user and not the root main character π. Instead of writing raw packets like basically every other mode does, Nping just asks the underlying operating system to go establish a connection with the target machine and port by issuing the connect system call. That's the exact same high-level system call that web browsers, P2P clients, and likeβ¦ most other network-enabled applications use to connect. It's part of a programming interface known as the Berkeley Sockets API, iykyk.
So rather than reading raw packet responses off the wire, Nping uses this API to get status info on each connection attempt. Which means β sad news π β you will not be able to see the contents of the packets that are sent or received. Only status information about the TCP connection establishment taking place. That's the whole vibe. No packet peeking. π
--tcp (TCP mode)
This is the mode where you get to create and send any kind of TCP packet. TCP packets are sent embedded in IP packets, which you can also tune β so like, full customization era β¨. This mode has so many uses it's honestly iconic:
- You could try to discover open ports by sending TCP SYN messages without completing the three-way handshake. This technique is often called half-open scanning, because you don't open a full TCP connection. You send a SYN packet, as if you're about to open a real connection, then wait for a response. A SYN/ACK means the port is open, a RST means it's closed π. If no response comes back, you could assume some intermediate network device is filtering the responses.
- Another use: seeing how a remote TCP/IP stack behaves when it receives a non-RFC-compliant packet β like one with both SYN and RST flags set. Chaos energy. π₯
- And yeah, one could also do some evil π by creating custom RST packets using a spoofed IP address with the intent of closing an active TCP connection. Not saying you should. Just saying the manpage says you could.
--udp (UDP mode)
UDP mode has two whole personalities, like a dual-threat queen π¦. Under normal circumstances, it lets users create custom IP/UDP packets. But β if Nping is run by a user without raw packet privileges and no changes to the default protocol headers are requested, then Nping enters the unprivileged UDP mode, which basically just sends UDP packets to the specified target hosts and ports using the sendto system call.
Quick heads up though: in this unprivileged mode it is not possible to see low-level header information of the packets on the wire β only status info about the amount of bytes being transmitted and received. π
So what's UDP mode good for? Interacting with any UDP-based server, bestie. Examples include DNS servers, streaming servers, online gaming servers, and port knocking/single-packet authorization daemons. Versatile much? π
--icmp (ICMP mode)
This is the default mode when the user runs Nping with raw packet privileges π₯. You can create any kind of ICMP message β literally any. The default ICMP type is Echo, i.e., ping (yes, that ping, the classic π).
ICMP mode is lowkey a multitasker: from a simple request for a timestamp or a netmask, all the way to the transmission of fake destination unreachable messages, custom redirects, and router advertisements. Range queen. π
--arp (ARP/RARP mode)
ARP lets you create and send a few different ARP-related packets. These include ARP, RARP, DRARP, and InARP requests and replies. This mode can ban be used to perform low-level host discovery, and conduct ARP-cache poisoning attacks. (Yes, the original says "can ban be used" β typos are canon, we don't fix 'em ππ)
--traceroute (Traceroute mode)
Okay so important clarification: Traceroute is not a mode by itself β it's a complement to TCP, UDP, and ICMP modes. It's giving sidekick energy, not main character energy, and that's fine π«Ά.
When this option is specified, Nping sets the IP TTL value of the first probe to 1. When the next router receives the packet, it drops it because the TTL expired, and it generates an ICMP destination unreachable message. Then the next probe gets a TTL of 2, so now the first router forwards the packet and the second router is the one that drops it and generates the ICMP message. The third probe gets a TTL value of 3, and so on and so on β¨.
By examining the source addresses of all those ICMP Destination Unreachable messages, it's possible to determine the path that the probes take until they reach their final destination. It's like a breadcrumb trail but for routers. Iconic. π
π TCP CONNECT MODE π
-pport_spec,--dest-portport_spec (Target ports) β Specifies which ports you want to try to connect to. It can be a single port, a comma-separated list of ports (e.g.80,443,8080), a range (e.g.1-1023), and any combination of those (e.g.21-25,80,443,1024-2048). The beginning and/or end values of a range may be omitted, causing Nping to use1and65535, respectively. So you can specify-p-to target ports from 1 through 65535. Using port zero is allowed if you specify it explicitly. π-gportnumber,--source-portportnumber (Spoof source port) β This option asks Nping to use the specified port as source port for the TCP connections. Note that this might not work on all systems or may require root privileges π. Specified value must be an integer in the range[0β65535].
π¦ TCP MODE π¦
-pport_spec,--dest-portport_spec (Target ports) β Specifies which destination ports you want to send probes to. It can be a single port, a comma-separated list of ports (e.g.80,443,8080), a range (e.g.1-1023), and any combination of those (e.g.21-25,80,443,1024-2048). The beginning and/or end values of a range may be omitted, causing Nping to use1and65535, respectively. So you can specify-p-to target ports from 1 through 65535. Using port zero is allowed if you specify it explicitly. β¨-gportnumber,--source-portportnumber (Spoof source port) β This option asks Nping to use the specified port as source port for the TCP connections. Note that this might not work on all systems or may require root privileges π. Specified value must be an integer in the range[0β65535].--seqseqnumber (Sequence Number) β Specifies the TCP sequence number. In SYN packets this is the initial sequence number (ISN). In a normal transmission this corresponds to the sequence number of the first byte of data in the segment. seqnumber must be a number in the range[0β4294967295]. Big number energy. π’--flagsflags (TCP Flags) β This option specifies which flags should be set in the TCP packet. flags may be specified in three different ways:- As a comma-separated list of flags, e.g.
--flags syn,ack,rst - As a list of one-character flag initials, e.g.
--flags SARtells Nping to set flags SYN, ACK, and RST. - As an 8-bit hexadecimal number, where the supplied number is the exact value that will be placed in the flags field of the TCP header. The number should start with the prefix
0xand should be in the range[0x00β0xFF], e.g.--flags 0x20sets the URG flag as0x20corresponds to binary00100000and the URG flag is represented by the third bit.
- As a comma-separated list of flags, e.g.
There are 8 possible flags to set: CWR, ECN, URG, ACK, PSH, RST, SYN, and FIN. The special value ALL means to set all flags. NONE means to set no flags. β οΈ It is important that if you don't want any flag to be set, you request it explicitly, because in some cases the SYN flag may be set by default. Here's a brief description of the meaning of each flag:
- CWR (Congestion Window Reduced) β Set by an ECN-Capable sender when it reduces its congestion window (due to a retransmit timeout, a fast retransmit or in response to an ECN notification.
- ECN (Explicit Congestion Notification) β During the three-way handshake it indicates that sender is capable of performing explicit congestion notification. Normally it means that a packet with the IP Congestion Experienced flag set was received during normal transmission. See RFC 3168 for more information.
- URG (Urgent) β Segment is urgent and the urgent pointer field carries valid information.
- ACK (Acknowledgement) β The segment carries an acknowledgement and the value of the acknowledgement number field is valid and contains the next sequence number that is expected from the receiver.
- PSH (Push) β The data in this segment should be immediately pushed to the application layer on arrival.
- RST (Reset) β There was some problem and the sender wants to abort the connection.
- SYN (Synchronize) β The segment is a request to synchronize sequence numbers and establish a connection. The sequence number field contains the sender's initial sequence number.
- FIN (Finish) β The sender wants to close the connection.
--winsize (Window Size) β Specifies the TCP window size, this is, the number of octets the sender of the segment is willing to accept from the receiver at one time. This is usually the size of the reception buffer that the OS allocates for a given connection. size must be a number in the range[0β65535]. πͺ--badsum(Invalid Checksum) β Asks Nping to use an invalid TCP checksum for the packets sent to target hosts. Since virtually all host IP stacks properly drop these packets, any responses received are likely coming from a firewall or an IDS that didn't bother to verify the checksum π. For more details on this technique, seehttps://nmap.org/p60-12.html.
π UDP MODE π
Okay bestie, UDP time! Let's get those datagrams sent. β¨
-p port_spec,--dest-port port_spec(Target ports) β tells Nping which ports to yeet UDP datagrams at.port_speccan be one port, a comma-separated list like80,443,8080, a range like1-1023, or any combo of those like21-25,80,443,1024-2048. You can leave out the start and/or end of a range and Nping will use1and65535respectively, so-p-means ports1through65535. Port zero is allowed if you explicitly ask for it. Slay. π-g portnumber,--source-port portnumber(Spoof source port) β asks Nping to useportnumberas the source port for the datagrams it sends. Fair warning: this might not work on every system, and it may need root privileges. The value must be an integer in[0β65535]. π--badsum(Invalid Checksum) β asks Nping to use an invalid UDP checksum for packets sent to target hosts. Since virtually all host IP stacks properly drop these packets, any responses you get are likely coming from a firewall or an IDS that didn't bother to verify the checksum. For more details on this technique, see https://nmap.org/p60-12.html. π₯
π ICMP MODE π
ICMP mode is its own whole vibe β here's how to fine-tune every field. π¦
--icmp-type type(ICMP type) β picks which kind of ICMP message gets generated. You can supplytypetwo ways: use the official IANA[1] type numbers (like--icmp-type 8for ICMP Echo Request), or use any mnemonic from the section called βICMP Typesβ. Easy. π--icmp-code code(ICMP code) β picks which ICMP code goes into the generated messages.codecan be the official IANA[1] code number (like--icmp-code 1for Fragment Reassembly Time Exceeded), or any mnemonic from the section called βICMP Codesβ. Periodt. π--icmp-id id(ICMP identifier) β sets the identifier value used in some ICMP messages. Usually this is what matches request and reply messages.idmust be a number in the range[0β65535]. π¦--icmp-seq seq(ICMP sequence) β sets the value of the sequence number field used in some ICMP messages. Usually used to match request and reply messages.idmust be a number in the range[0β65535]. πΈ--icmp-redirect-addr addr(ICMP Redirect address) β sets the address field in ICMP Redirect messages. In other words, it sets the IP address of the router that should be used when sending IP datagrams to the original destination.addrcan be an IPv4 address or a hostname. π«Ά--icmp-param-pointer pointer(ICMP Parameter Problem pointer) β sets the pointer that indicates where the problem is in ICMP Parameter Problem messages.pointershould be a number in the range[0β255]. Normally this option is only used when ICMP code is set to 0 ("Pointer indicates the error"). π--icmp-advert-lifetime ttl(ICMP Router Advertisement Lifetime) β sets the router advertisement lifetime, aka how many seconds the info carried in an ICMP Router Advertisement can be considered valid for.ttlmust be a positive integer in the range[0β65535]. πΈ--icmp-advert-entry addr,pref(ICMP Router Advertisement Entry) β adds a Router Advertisement entry to an ICMP Router Advertisement message. The parameter must be two values separated by a comma.addris the router's IP and can be an IP address in dot-decimal notation or a hostname.prefis the preference level for that IP and must be a number in the range[0β4294967295]. Example:--icmp-advert-entry 192.168.128.1,3. π«Ά--icmp-orig-time timestamp(ICMP Originate Timestamp) β sets the Originate Timestamp in ICMP Timestamp messages. This timestamp is expressed as the number of milliseconds since midnight UTC, and it corresponds to the time the sender last touched the Timestamp message before sending it.timestampcan be a regular time (like10s,3h,1000ms) or the special stringnow. You can add or subtract values fromnow, for example--icmp-orig-time now-2s,--icmp-orig-time now+1h,--icmp-orig-time now+200ms. ππ₯--icmp-recv-time timestamp(ICMP Receive Timestamp) β sets the Receive Timestamp in ICMP Timestamp messages. It's expressed as the number of milliseconds since midnight UTC and corresponds to the time the echoer first touched the Timestamp message on receipt.timestampworks just like with--icmp-orig-time. π--icmp-trans-time timestamp(ICMP Transmit Timestamp) β sets the Transmit Timestamp in ICMP Timestamp messages. Expressed as the number of milliseconds since midnight UTC and corresponds to the time the echoer last touched the Timestamp message before sending it.timestampis as with--icmp-orig-time. β
π ICMP Types π
These identifiers work as mnemonics for the ICMP type numbers you hand to --icmp-type. In general each identifier has three forms: the full name (like destination-unreachable), the short name (like dest-unr), or the initials (like du). For ICMP types that request something, the word "request" is omitted. Obsessed with the consistency. π
echo-reply,echo-rep,erβ Echo Reply (type 0). This message is sent in response to an Echo Request message. β¨destination-unreachable,dest-unr,duβ Destination Unreachable (type 3). This message indicates that a datagram could not be delivered to its destination. π¦source-quench,sour-que,sqβ Source Quench (type 4). This message is used by a congested IP device to tell another device that is sending packets too fast that it should slow down. πΈredirect,redi,rβ Redirect (type 5). This message is normally used by routers to inform a host that there is a better route to use for sending datagrams. See also the--icmp-redirect-addroption. π«Άecho-request,echo,eβ Echo Request (type 8). This message is used to test the connectivity of another device on a network. πrouter-advertisement,rout-adv,raβ Router Advertisement (type 9). This message is used by routers to let hosts know of their existence and capabilities. See also the--icmp-advert-lifetimeoption. πrouter-solicitation,rout-sol,rsβ Router Solicitation (type 10). This message is used by hosts to request Router Advertisement messages from any listening routers. βtime-exceeded,time-exc,teβ Time Exceeded (type 11). This message is generated by some intermediate device (normally a router) to indicate that a datagram has been discarded before reaching its destination because the IP TTL expired. πparameter-problem,member-pro,ppβ Parameter Problem (type 12). This message is used when a device finds a problem with a parameter in an IP header and it cannot continue processing it. See also the--icmp-param-pointeroption. πtimestamp,time,tmβ Timestamp Request (type 13). This message is used to request a device to send a timestamp value for propagation time calculation and clock synchronization. See also the--icmp-orig-time,--icmp-recv-time, and--icmp-trans-time. πtimestamp-reply,time-rep,trβ Timestamp Reply (type 14). This message is sent in response to a Timestamp Request message. π§information,info,iβ Information Request (type 15). This message is now obsolete but it was originally used to request configuration information from another device. πinformation-reply,info-rep,irβ Information Reply (type 16). This message is now obsolete but it was originally sent in response to an Information Request message to provide configuration information. πmask-request,mask,mβ Address Mask Request (type 17). This message is used to ask a device to send its subnet mask. πΈmask-reply,mask-rep,mrβ Address Mask Reply (type 18). This message contains a subnet mask and is sent in response to a Address Mask Request message. π¦traceroute,trace,tcβ Traceroute (type 30). This message is normally sent by an intermediate device when it receives an IP datagram with a traceroute option. ICMP Traceroute messages are still experimental, see RFC 1393 for more information. π₯
π¦ ICMP Codes π¦
These identifiers work as mnemonics for the ICMP code numbers you give to --icmp-code. They're listed by the ICMP type they correspond to. π
π Destination Unreachable π
network-unreachable,netw-unr,netβ Code 0. Datagram could not be delivered to its destination network (probably due to some routing problem). πhost-unreachable,host-unr,hostβ Code 1. Datagram was delivered to the destination network but it was impossible to reach the specified host (probably due to some routing problem). πprotocol-unreachable,prot-unr,protoβ Code 2. The protocol specified in the Protocol field of the IP datagram is not supported by the host to which the datagram was delivered. πport-unreachable,port-unr,portβ Code 3. The TCP/UDP destination port was invalid. πneeds-fragmentation,need-fra,fragβ Code 4. Datagram had the DF bit set but it was too large for the MTU of the next physical network so it had to be dropped. π¦source-route-failed,sour-rou,routefailβ Code 5. IP datagram had a Source Route option but a router couldn't pass it to the next hop. πΈnetwork-unknown,netw-unk,net?β Code 6. Destination network is unknown. This code is never used. Instead, Network Unreachable is used. π«Άhost-unknown,host-unk,host?β Code 7. Specified host is unknown. Usually generated by a router local to the destination host to inform of a bad address. πhost-isolated,host-iso,isolatedβ Code 8. Source Host Isolated. Not used. βnetwork-prohibited,netw-pro,!netβ Code 9. Communication with destination network is administratively prohibited (source device is not allowed to send packets to the destination network). πhost-prohibited,host-pro,!hostβ Code 10. Communication with destination host is administratively prohibited. (The source device is allowed to send packets to the destination network but not to the destination device.) π₯network-tos,unreachable-network-tos,netw-tos,tosnetβ Code 11. Destination network unreachable because it cannot provide the type of service specified in the IP TOS field. πhost-tos,unreachable-host-tos,toshostβ Code 12. Destination host unreachable because it cannot provide the type of service specified in the IP TOS field.communication-prohibited,comm-pro,!commβ Code 13. Datagram could not be forwarded due to filtering that blocks the message based on its contents.host-precedence-violation,precedence-violation,prec-vio,violationβ Code 14. Precedence value in the IP TOS field is not permitted.precedence-cutoff,prec-cut,cutoffβ Code 15. Precedence value in the IP TOS field is lower than the minimum allowed for the network.
Redirect π¦
redirect-network,redi-net,netβ Code 0. Redirect all future datagrams with the same destination network as the original datagram, to the router specified in the Address field. The use of this code is prohibited by RFC 1812. π«redirect-host,redi-host,hostβ Code 1. Redirect all future datagrams with the same destination host as the original datagram, to the router specified in the Address field.redirect-network-tos,redi-ntos,redir-ntosβ Code 2. Redirect all future datagrams with the same destination network and IP TOS value as the original datagram, to the router specified in the Address field. The use of this code is prohibited by RFC 1812. π«redirect-host-tos,redi-htos,redir-htosβ Code 3. Redirect all future datagrams with the same destination host and IP TOS value as the original datagram, to the router specified in the Address field.
Router Advertisement π’
normal-advertisement,norm-adv,normal,zero,default,defβ Code 0. Normal router advertisement. In Mobile IP: Mobility agent can act as a router for IP datagrams not related to mobile nodes.not-route-common-traffic,not-rou,mobile-ip,!route,!commontrafficβ Code 16. Used for Mobile IP. The mobility agent does not route common traffic. All foreign agents must forward to a default router any datagrams received from a registered mobile node.
Time Exceeded β°
ttl-exceeded-in-transit,ttl-exc,ttl-transitβ Code 0. IP Time To Live expired during transit. rip πfragment-reassembly-time-exceeded,frag-exc,frag-timeβ Code 1. Fragment reassembly time has been exceeded.
Parameter Problem π
pointer-indicates-error,poin-ind,pointerβ Code 0. The pointer field indicates the location of the problem. See the--icmp-param-pointeroption.missing-required-option,miss-option,option-missingβ Code 1. IP datagram was expected to have an option that is not present.bad-length,bad-len,badlenβ Code 2. The length of the IP datagram is incorrect.
π ARP MODE π
--arp-typetype (ICMP Type) β this one picks which flavor of ARP message gets generated. type can come at you two different ways, bestie: you can use the official numbers assigned byIANA[2](like,--arp-type 1for ARP Request, slay), or you can use one of the mnemonics from the section called "ARP Types". your call π--arp-sender-macmac (Sender MAC address) β sets the Sender Hardware Address field of the ARP header. And yes, even though ARP supports many types of link layer addresses, currently Nping only supports MAC addresses. mac has to be written in the traditional MAC notation (e.g.00:0a:8a:32:f4:ae). oh and you can use hyphens as separators too (e.g.00-0a-8a-32-f4-ae) β versatile icon β¨--arp-sender-ipaddr (Sender IP address) β sets the Sender IP field of the ARP header. addr can be given as an IPv4 address or a hostname.--arp-target-macmac (target MAC address) β sets the Target Hardware Address field of the ARP header.--arp-target-ipaddr (target ip address) β sets the Target IP field of the ARP header.
π ARP Types π
these identifiers may be used as mnemonics for the ARP type numbers you hand to the --arp-type option. iykyk π«Ά
arp-request,arp,aβ ARP Request (type 1). ARP requests are used to translate network layer addresses (normally IP addresses) to link layer addresses (usually MAC addresses). Basically, and ARP request is a broadcasted message that asks the host in the same network segment that has a given IP address to provide its MAC address. it's giving "hey who are you, drop your addy" π£arp-reply,arp-rep,arβ ARP Reply (type 2). An ARP reply is a message that a host sends in response to an ARP request to provide its link layer address.rarp-request,rarp,rβ RARP Requests (type 3). RARP requests are used to translate a link layer address (normally a MAC address) to a network layer address (usually an IP address). Basically a RARP request is a broadcasted message sent by a host that wants to know his own IP address because it doesn't have any. It was the first protocol designed to solve the bootstrapping problem. However, RARP is now obsolete and DHCP is used instead. For more information about RARP see RFC 903. obsolete era, we don't stan, but the lore is important π«‘rarp-reply,rarp-rep,rrβ RARP Reply (type 4). A RARP reply is a message sent in response to a RARP request to provide an IP address to the host that sent the RARP request in the first place.drarp-request,drarp,dβ Dynamic RARP Request (type 5). Dynamic RARP is an extension to RARP used to obtain or assign a network layer address from a fixed link layer address. DRARP was used mainly in Sun Microsystems platforms in the late 90's but now it's no longer used. See RFC 1931 for more information. late 90's Sun Microsystems... vintage πdrarp-reply,drarp-rep,drβ Dynamic RARP Reply (type 6). A DRARP reply is a message sent in response to a RARP request to provide network layer address.drarp-error,drarp-err,deβ DRARP Error (type 7). DRARP Error messages are usually sent in response to DRARP requests to inform of some error. In DRARP Error messages, the Target Protocol Address field is used to carry an error code (usually in the first byte). The error code is intended to tell why no target protocol address is being returned. For more information see RFC 1931.inarp-request,inarp,iβ Inverse ARP Request (type 8). InARP requests are used to translate a link layer address to a network layer address. It is similar to RARP request but in this case, the sender of the InARP request wants to know the network layer address of another node, not its own address. InARP is mainly used in Frame Relay and ATM networks. For more information see RFC 2390.inarp-reply,inarp-rep,irβ Inverse ARP Reply (type 9). InARP reply messages are sent in response to InARP requests to provide the network layer address associated with the host that has a given link layer address.arp-nak,anβ ARP NAK (type 10). ARP NAK messages are an extension to the ATMARP protocol and they are used to improve the robustness of the ATMARP server mechanism. With ARP NAK, a client can determine the difference between a catastrophic server failure and an ATMARP table lookup failure. See RFC 1577 for more information. π catastrophic server failure vs. table lookup failure β the character development we needed
π IPV4 OPTIONS π
okay bestie, this is the part where we start poking at the actual IP header fields themselves. tiny little dials, huge drama. let's go β¨
-Saddr,--source-ipaddr (Source IP Address) β sets the source IP address. this lets you specify a custom IP address to be used as the source IP address in the packets you send, which means yes, you can spoof the sender of the packets π addr can be an IPv4 address or a hostname.--dest-ipaddr (Destination IP Address) β adds a target to Nping's target list. this option exists purely for consistency, and its use is deprecated in favor of just, like, plain target specifications. see the section called "TARGET SPECIFICATION" π«Ά--tostos (Type of Service) β sets the IP TOS field. the TOS field carries info to provide quality of service features, and it's normally used to support a technique called Differentiated Services. see RFC 2474 for more. tos must be a number in the range[0β255]π--idid (Identification) β sets the IPv4 Identification field. this field is a 16-bit value that's common to all fragments belonging to a particular message, and the receiver uses it to reassemble the original message out of all the fragments it got. id must be a number in the range[0β65535]π--df(Don't Fragment) β sets the Don't Fragment bit in sent packets. when an IP datagram has its DF flag set, intermediate devices aren't allowed to fragment it, so if it needs to travel across a network with an MTU smaller than the datagram length, the datagram has to get dropped π normally an ICMP Destination Unreachable message is generated and sent back to the sender.--mf(More Fragments) β sets the More Fragments bit in sent packets. the MF flag being set tells the receiver that the current datagram is a fragment of some larger datagram. when it's zero, that means the current datagram is either the last fragment in the set or it's the only fragment. icon behavior tbh β¨--evil(Reserved / Evil) β sets the Reserved / Evil bit in sent packets. the Evil flag helps firewalls and other network security systems tell the difference between datagrams that have malicious intent and those that are merely unusual. when set, it indicates the datagram has evil intent, instructing insecure systems to succumb π setting it to zero indicates no evil intent. this option is implied if the environmental variableSCRIPT_KIDDIEis set to a non-zero value π--ttlhops (Time To Live) β sets the IPv4 Time-To-Live (TTL) field in sent packets to the given value. the TTL field specifies how long the datagram is allowed to exist on the network. it was originally intended to represent a number of seconds, but it actually represents the number of hops a packet can traverse before being dropped. TTL tries to avoid that whole situation where undeliverable datagrams just keep getting forwarded from one router to another endlessly, forever, no cap. hops must be a number in the range[0β255]β--badsum-ip(Invalid IP checksum) β asks Nping to use an invalid IP checksum for packets sent to target hosts. note that some systems (like most Linux kernels) may fix the checksum before placing the packet on the wire, so even if Nping shows the incorrect checksum in its output, the packets may be transparently corrected by the kernel π₯ so likeβ¦ don't be shocked, bestie.
π real talk warning zone π
--ip-optionsR|S [route]|L [route]|T|U ...,--ip-optionshex string (IP Options) β the IP protocol offers several options that can be placed in packet headers. unlike the ubiquitous TCP options, IP options are rarely seen, thanks to practicality and security concerns. in fact, many Internet routers block the most dangerous options, like source routing π« but options can still be useful in some cases for determining and manipulating the network route to target machines. for example, you may be able to use the record route option to determine a path to a target even when more traditional traceroute-style approaches fail. or, if your packets are being dropped by a certain firewall, you may be able to specify a different route with the strict or loose source routing options π
the most powerful way to specify IP options is to simply pass in hexadecimal data as the argument to --ip-options. precede each hex byte value with \x. you may repeat certain characters by following them with an asterisk and then the number of times you wish them to repeat. for example, \x01\x07\x04\x00*4 is the same as \x01\x07\x04\x00\x00\x00\x00 π§
note that if you specify a number of bytes that isn't a multiple of four, an incorrect IP header length will be set in the IP packet. the reason is that the IP header length field can only express multiples of four. in those cases, the length is computed by dividing the header length by 4 and rounding down. this will affect the way the header that follows the IP header is interpreted, showing bogus information in Nping or in the output of any sniffer π although this kind of situation might be useful for some stack stress tests, users would normally want to specify explicit padding so the correct header length is set. so likeβ¦ pad it, bestie.
Nping also offers a shortcut mechanism for specifying options. simply pass the letter R, T, or U to request record-route, record-timestamp, or both options together, respectively. loose or strict source routing may be specified with an L or S followed by a space and then a space-separated list of IP addresses π¦
for more information and examples of using IP options with Nping, see the mailing list post at https://seclists.org/nmap-dev/2006/q3/0052.html.
--mtusize (Maximum Transmission Unit) β this option sets a fictional MTU in Nping so IP datagrams larger than size are fragmented before transmission. size must be specified in bytes and corresponds to the number of octets that can be carried on a single link-layer frame πΈ
π¦ IPV6 OPTIONS π¦
the future is now, bestie. or at least, the future is experimental. keep reading π
-6,--ipv6(Use IPv6) β tells Nping to use IP version 6 instead of the default IPv4. it's generally a good idea to specify this option as early as possible in the command line so Nping can parse it soon and know in advance that the rest of the parameters refer to IPv6. the command syntax is the same as usual except that you also add the-6option β¨ of course, you must use IPv6 syntax if you specify an address rather than a hostname. an address might look like3ffe:7501:4819:2000:210:f3ff:fe03:14d0, so hostnames are recommended π«Ά
while IPv6 hasn't exactly taken the world by storm, it gets significant use in some (usually Asian) countries and most modern operating systems support it. to use Nping with IPv6, both the source and target of your packets must be configured for IPv6. if your ISP (like most of them) doesn't allocate IPv6 addresses to you, free tunnel brokers are widely available and work fine with Nping. you can use the free IPv6 tunnel broker service at http://www.tunnelbroker.net π
β οΈ please note that IPv6 support is still highly experimental and many modes and options may not work with it. like, don't come for me if it acts up, okay? π
-Saddr,--source-ipaddr (Source IP Address) β sets the source IP address. this option lets you specify a custom IP address to be used as the source IP address in sent packets, which allows spoofing the sender of the packets π addr can be an IPv6 address or a hostname.--dest-ipaddr (Destination IP Address) β adds a target to Nping's target list. this option is provided for consistency but its use is deprecated in favor of plain target specifications. see the section called "TARGET SPECIFICATION" π--flowlabel (Flow Label) β sets the IPv6 Flow Label. this field is 20 bits long and is intended to provide certain quality-of-service properties for real-time datagram delivery. however, it has not been widely adopted, and not all routers or endpoints support it π check RFC 2460 for more information. label must be an integer in the range[0β1048575]--traffic-classclass (Traffic Class) β sets the IPv6 Traffic Class. this field is similar to the TOS field in IPv4, and is intended to provide the Differentiated Services method, enabling scalable service discrimination in the Internet without the need for per-flow state and signaling at every hop β check RFC 2474 for more information. class must be an integer in the range[0β255]--hop-limithops (Hop Limit) β sets the IPv6 Hop Limit field in sent packets to the given value. the Hop Limit field specifies how long the datagram is allowed to exist on the network. it represents the number of hops a packet can traverse before being dropped. as with the TTL in IPv4, IPv6 Hop Limit tries to avoid a situation in which undeliverable datagrams keep being forwarded from one router to another endlessly π hops must be a number in the range[0β255]π
β¨ ETHERNET OPTIONS β¨
Okay bestie, so most of the time Nping sends packets at the raw IP level. That means it builds its own IP packets and yeets them through a raw socket. But sometimes you gotta go lower β like raw Ethernet level low. This happens, for example, when Nping is run under Windows (because Microsoft disabled raw socket support since Windows XP SP2), or when Nping is asked to send ARP packets. Since sometimes you literally have to construct Ethernet frames, Nping gives you options to mess with the different fields. π
--dest-macmac (Ethernet Destination MAC Address) β This sets the destination MAC address that goes into outgoing Ethernet frames. Super useful when Nping canβt figure out the next hopβs MAC address, or when you want to route probes through a router that isnβt the configured default gateway. The MAC address should have the usual format of six colon-separated bytes, e.g.00:50:56:d4:01:98. Alternatively, hyphens may be used instead of colons. Use the wordrandomorrandto generate a random address, andbroadcastorbcastto useff:ff:ff:ff:ff:ff. If you set up a bogus destination MAC address your probes may not reach the intended targets. π--source-macmac (Ethernet Source MAC Address) β This sets the source MAC address that goes into outgoing Ethernet frames. Useful when Nping canβt determine your network interface MAC address, or when you want to inject traffic into the network while hiding your network cardβs real address. The syntax is the same as for--dest-mac. If you set up a bogus source MAC address you may not receive probe replies. π--ether-typetype (Ethertype) β This sets the Ethertype field of the Ethernet frame. The Ethertype is used to indicate which protocol is encapsulated in the payload. type can be supplied in two different ways. You can use the official numbers listed by the IEEE[3] (e.g.--ether-type 0x0800for IP version 4), or one of the mnemonics from the section called βEthernet Typesβ. π§
π¦ Ethernet Types π¦
These identifiers may be used as mnemonics for the Ethertype numbers given to the --arp-type option. π
ipv4,ip,4β Internet Protocol version 4 (type0x0800).ipv6,6β Internet Protocol version 6 (type0x86DD).arpβ Address Resolution Protocol (type0x0806).rarpβ Reverse Address Resolution Protocol (type0x8035).frame-relay,frelay,frβ Frame Relay (type0x0808).pppβ Point-to-Point Protocol (type0x880B).gsmpβ General Switch Management Protocol (type0x880C).mplsβ Multiprotocol Label Switching (type0x8847).mps-ual,mpsβ Multiprotocol Label Switching with Upstream-assigned Label (type0x8848).mcapβ Multicast Channel Allocation Protocol (type0x8861).pppoe-discovery,pppoe-dβ PPP over Ethernet Discovery Stage (type0x8863).pppoe-session,pppoe-sβ PPP over Ethernet Session Stage (type0x8864).ctagβ Customer VLAN Tag Type (type0x8100).eponβ Ethernet Passive Optical Network (type0x8808).pbnacβ Port-based network access control (type0x888E).stagβ Service VLAN tag identifier (type0x88A8).ethexp1β Local Experimental Ethertype 1 (type0x88B5).ethexp2β Local Experimental Ethertype 2 (type0x88B6).ethouiβ OUI Extended Ethertype (type0x88B7).preauthβ Pre-Authentication (type0x88C7).lldpβ Link Layer Discovery Protocol (type0x88CC).mac-security,mac-sec,macsecβ Media Access Control Security (type0x88E5).mvrpβ Multiple VLAN Registration Protocol (type0x88F5).mmrpβ Multiple Multicast Registration Protocol (type0x88F6).frrrβ Fast Roaming Remote Request (type0x890D).
π PAYLOAD OPTIONS π
--datahex string (Append custom binary data to sent packets) β This lets you include binary data as payload in sent packets. hex string may be specified in any of the following formats:0xAABBCCDDEEFF...,AABBCCDDEEFF...or\xAA\xBB\xCC\xDD\xEE\xFF.... Examples of use are--data 0xdeadbeefand--data \xCA\xFE\x09. Note that if you specify a number like0x00ffno byte-order conversion is performed. Make sure you specify the information in the byte order expected by the receiver. π₯--data-stringstring (Append custom string to sent packets) β This lets you include a regular string as payload in sent packets. string can contain any string. However, note that some characters may depend on your systemβs locale and the receiver may not see the same information. Also, make sure you enclose the string in double quotes and escape any special characters from the shell. Example:--data-string "Jimmy Jazz...". π--data-lengthlen (Append random data to sent packets) β This lets you include len random bytes of data as payload in sent packets. len must be an integer in the range[0β65400]. However, values higher than1400are not recommended because it may not be possible to transmit packets due to network MTU limitations. π
π ECHO MODE π
okay so, bestie, the βEcho Modeβ is a novel technique implemented by Nping that lets you see how network packets change in transit, from the host where they originated to the target machine. Basically, Echo mode turns Nping into two different pieces: the Echo server and the Echo client. The Echo server is a network service that has the ability to capture packets from the network and send a copy (βecho themβ) to the originating client through a side TCP channel. The Echo client is the part that generates such network packets, transmits them to the server, and receives their echoed version through a side TCP channel that it has previously established with the Echo server. π«Ά
This scheme lets the client see the differences between the packets that it sends and what is actually received by the server. By having the server send back copies of the received packets through the side channel, things like NAT devices become immediately apparent to the client because it notices the changes in the source IP address (and maybe even source port). Other devices like those that perform traffic shaping, changing TCP window sizes or adding TCP options transparently between hosts, turn up too. β¨
The Echo mode is also useful for troubleshooting routing and firewall issues. Among other things, it can be used to determine if the traffic generated by the Nping client is being dropped in transit and never gets to its destination or if the responses are the ones that donβt get back to it. π
Internally, client and server communicate over an encrypted and authenticated channel, using the Nping Echo Protocol (NEP), whose technical specification can be found in https://nmap.org/svn/nping/docs/EchoProtoRFC.txt.
The following paragraphs describe the different options available in Npingβs Echo mode. π
--ecpassphrase,--echo-clientpassphrase β (Run Echo client) This option tells Nping to run as an Echo client. passphrase is a sequence of ASCII characters that is used to generate the cryptographic keys needed for encryption and authentication in a given session. The passphrase should be a secret that is also known by the server, and it may contain any number of printable ASCII characters. Passphrases that contain whitespace or special characters must be enclosed in double quotes. π
When running Nping as an Echo client, most options from the regular raw probe modes apply. The client may be configured to send specific probes using flags like --tcp, --icmp or --udp. Protocol header fields may be manipulated normally using the appropriate options (e.g. --ttl, --seq, --icmp-type, etc.). The only exceptions are ARP-related flags, which are not supported in Echo mode, as protocols like ARP are closely related to the data link layer and its probes canβt pass through different network segments.
--espassphrase,--echo-serverpassphrase β (Run Echo server) This option tells Nping to run as an Echo server. passphrase is a sequence of ASCII characters that is used to generate the cryptographic keys needed for encryption and authentication in a given session. The passphrase should be a secret that is also known by the clients, and it may contain any number of printable ASCII characters. Passphrases that contain whitespace or special characters must be enclosed in double quotes. Note that although it is not recommended, it is possible to use empty passphrases, supplying--echo-server "". However, if what you want is to set up an open Echo server, it is better to use option--no-crypto. See below for details. π¦--epport,--echo-portport β (Set Echo TCP port number) This option asks Nping to use the specified TCP port number for the Echo side channel connection. If this option is used with--echo-server, it specifies the port on which the server listens for connections. If it is used with--echo-client, it specifies the port to connect to on the remote host. By default, port number9929is used. πΈ--nc,--no-cryptoβ (Disable encryption and authentication) This option asks Nping not to use any cryptographic operations during an Echo session. In practical terms, this means that the Echo side channel session data will be transmitted in the clear, and no authentication will be performed by the server or client during the session establishment phase. When--no-cryptois used, the passphrase supplied with--echo-serveror--echo-clientis ignored. π
This option must be specified if Nping was compiled without openSSL support. Note that, for technical reasons, a passphrase still needs to be supplied after the --echo-client or --echo-server flags, even though it will be ignored.
β οΈ The--no-cryptoflag might be useful when setting up a public Echo server, because it allows users to connect to the Echo server without the need for any passphrase or shared secret. However, it is strongly recommended to not use--no-cryptounless absolutely necessary. Public Echo servers should be configured to use the passphrase"public"or the empty passphrase (--echo-server "") as the use of cryptography does not only provide confidentiality and authentication but also message integrity.
--onceβ (Serve one client and quit) This option asks the Echo server to quit after serving one client. This is useful when only a single Echo session wants to be established as it eliminates the need to access the remote host to shutdown the server. β¨--safe-payloadsβ (Zero application data before echoing a packet) This option asks the Echo server to erase any application layer data found in client packets before echoing them. When the option is enabled, the Echo server parses the packets received from Echo clients and tries to determine if they contain data beyond the transport layer. If such data is found, it is overwritten with zeroes before transmitting the packets to the appropriate Echo client. π₯
Echo servers can handle multiple simultaneous clients running multiple echo sessions in parallel. In order to determine which packet needs to be echoed to which client and through which session, the Echo server uses a heuristic algorithm. Although we have taken every security measure that we could think of to prevent that a client receives an echoed packet that it did not generate, there is always a risk that our algorithm makes a mistake and delivers a packet to the wrong client. The --safe-payloads option is useful for public echo servers or critical deployments where that kind of mistake cannot be afforded. π
The following examples illustrate how Npingβs Echo mode can be used to discover intermediate devices. π
π¦ Example 2. Discovering NAT devices π¦
# nping --echo-client "public" echo.nmap.org --udp
Starting Nping ( https://nmap.org/nping )
SENT (1.0970s) UDP 10.1.20.128:53 > 178.79.165.17:40125 ttl=64 id=32523 iplen=28
CAPT (1.1270s) UDP 80.38.10.21:45657 > 178.79.165.17:40125 ttl=54 id=32523 iplen=28
RCVD (1.1570s) ICMP 178.79.165.17 > 10.1.20.128 Port unreachable (type=3/code=3) ttl=49 id=16619 iplen=56
[...]
SENT (5.1020s) UDP 10.1.20.128:53 > 178.79.165.17:40125 ttl=64 id=32523 iplen=28
CAPT (5.1335s) UDP 80.38.10.21:45657 > 178.79.165.17:40125 ttl=54 id=32523 iplen=28
RCVD (5.1600s) ICMP 178.79.165.17 > 10.1.20.128 Port unreachable (type=3/code=3) ttl=49 id=16623 iplen=56
Max rtt: 60.628ms | Min rtt: 58.378ms | Avg rtt: 59.389ms
Raw packets sent: 5 (140B) | Rcvd: 5 (280B) | Lost: 0 (0.00%)| Echoed: 5 (140B)
Tx time: 4.00459s | Tx bytes/s: 34.96 | Tx pkts/s: 1.25
Rx time: 5.00629s | Rx bytes/s: 55.93 | Rx pkts/s: 1.00
Nping done: 1 IP address pinged in 6.18 seconds
The output clearly shows the presence of a NAT device in the clientβs local network. Note how the captured packet (CAPT) differs from the SENT packet: the source address for the original packets is in the reserved 10.0.0.0/8 range, while the address seen by the server is 80.38.10.21, the Internet side address of the NAT device. The source port was also modified by the device. The line starting with RCVD corresponds to the responses generated by the TCP/IP stack of the machine where the Echo server is run. π«Ά
π Example 3. Discovering a transparent proxy π
# nping --echo-client "public" echo.nmap.org --tcp -p80
Starting Nping ( https://nmap.org/nping )
SENT (1.2160s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480
RCVD (1.2180s) TCP 178.79.165.17:80 > 10.0.1.77:41659 SA ttl=128 id=13177 iplen=44 seq=3647106954 win=16384 <mss 1460>
SENT (2.2150s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480
SENT (3.2180s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480
SENT (4.2190s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480
SENT (5.2200s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480
Max rtt: 2.062ms | Min rtt: 2.062ms | Avg rtt: 2.062ms
Raw packets sent: 5 (200B) | Rcvd: 1 (46B) | Lost: 4 (80.00%)| Echoed: 0 (0B)
Tx time: 4.00504s | Tx bytes/s: 49.94 | Tx pkts/s: 1.25
Rx time: 5.00618s | Rx bytes/s: 9.19 | Rx pkts/s: 0.20
Nping done: 1 IP address pinged in 6.39 seconds
In this example, the output is a bit more tricky. The absence of error messages shows that the Echo client has successfully established an Echo session with the server. However, no CAPT packets can be seen in the output. This means that none of the transmitted packets reached the server. Interestingly, a TCP SYN-ACK packet was received in response to the first TCP-SYN packet (and also, it is known that the target host does not have port 80 open). This behavior reveals the presence of a transparent web proxy cache server (which in this case is an old MS ISA server). π§
β±οΈ TIMING AND PERFORMANCE OPTIONS β±οΈ
--delay time(Delay between probes) β okay so this one is literally your "chill, bestie, breathe" knob. It controls how long Nping waits before it sends the next probe. Like in so many other ping tools, the default delay is one second.timehas to be a positive integer or floating point number (no negatives, no vibes-only input π ). By default it's in seconds, but you can add an explicit unit by appendingmsfor milliseconds,sfor seconds,mfor minutes, orhfor hours β the manpage's own examples are2.5s,45m,2h, and yes those are slay.--rate rate(Send probes at a given rate) β this is how many probes Nping should send per second. And here's the tea: this option and--delayare inverses π«Ά β--rate 20is the same as--delay 0.05. So if both options are used, only the last one in the parameter list counts. Last one wins, periodt.
π MISCELLANEOUS OPTIONS π
-h,--help(Display help) β displays help information and then dips. Bye β¨.-V,--version(Display version) β shows the program's version number and quits. Iconic, brief, done.-c rounds,--count rounds(Stop after a given number of rounds) β so this lets you say how many times Nping should loop over target hosts (and in some cases target ports). Nping calls these βroundsβ π. In a basic execution with only one target (and only one target port in TCP/UDP modes), the number of rounds matches the number of probes sent to the target host. But in the more complex executions β where Nping is run against multiple targets and multiple ports β the number of rounds is the number of times that Nping sends a complete set of probes that covers all target IPs and all target ports. The manpage's example is honestly so good: if Nping is asked to send TCP SYN packets to hosts192.168.1.0-255and ports80and433, then256 Γ 2 = 512packets are sent in one round. So if you specify-c 100, Nping will loop over the different target hosts and ports100times, sending a total of256 Γ 2 Γ 100 = 51200packets π. By default Nping runs for 5 rounds. And if you specify a value of0, Nping will run continuously β forever girl, no cap.-e name,--interface name(Set the network interface to be used) β tells Nping which interface should be used to send and receive packets. Nping should be able to detect this automatically, but it will tell you if it can't.namemust be the name of an existing network interface with an assigned IP address. Like, it has to actually exist, bestie.--privileged(Assume that the user is fully privileged) β tells Nping to simply assume it's privileged enough to do raw socket sends, packet sniffing, and similar operations that usually require special privileges. By default Nping quits if such operations are requested by a user that has no root or administrator privileges. This option may be useful on Linux, BSD or similar systems that can be configured to allow unprivileged users to perform raw-packet transmissions. TheNPING_PRIVILEGEDenvironment variable may be set as an alternative to using--privileged.--unprivileged(Assume that the user lacks raw socket privileges) β the opposite of--privileged, literally. It tells Nping to treat the user as lacking network raw socket and sniffing privileges. Useful for testing, debugging, or when the raw network functionality of your operating system is somehow broken π. TheNPING_UNPRIVILEGEDenvironment variable may be set as an alternative to using--unprivileged.--send-eth(Use raw ethernet sending) β asks Nping to send packets at the raw ethernet (data link) layer rather than the higher IP (network) layer. By default, Nping chooses the one which is generally best for the platform it's running on. Raw sockets (IP layer) are generally most efficient for Unix machines, while ethernet frames are required for Windows operation since Microsoft disabled raw socket support. Nping still uses raw IP packets despite this option when there is no other choice (such as non-ethernet connections) β so it's giving "I'll try my best" energy.--send-ip(Send at raw IP level) β asks Nping to send packets via raw IP sockets rather than sending lower level ethernet frames. It is the complement to the--send-ethoption. They're a matched set π«Ά.--bpf-filter filter spec,--filter filter spec(Set custom BPF filter) β lets you use a custom BPF filter. By default Nping chooses a filter that's intended to capture most common responses to the particular probes that are sent. Example time: when sending TCP packets, the filter is set to capture packets whose destination port matches the probe's source port, or ICMP error messages that may be generated by the target or any intermediate device as a result of the probe. If for some reason you expect strange packets in response to sent probes, or you just want to sniff a particular kind of traffic, you can specify a custom filter using the BPF syntax used by tools liketcpdump. See the documentation athttp://www.tcpdump.org/for more information.-H,--hide-sent(Do not display sent packets) β tells Nping not to print information about sent packets. This can be useful when using very short inter-probe delays (i.e., when flooding), because printing information to the standard output has a computational cost and disabling it can probably speed things up a bit. Also useful when using Nping to detect active hosts or open ports (e.g. sending probes to all TCP ports in a/24subnet). In that case, users may not want to see thousands of sent probes but just the replies generated by active hosts. Honestly relatable β sometimes you just want the replies, not the whole group chat π .-N,--no-capture(Do not attempt to capture replies) β tells Nping to skip packet capture. Which means packets in response to sent probes will not be processed or displayed. Useful when doing flooding and network stack stress tests. Warning though: when this option is specified, most of the statistics shown at the end of the execution will be useless π. Also note: this option does not work with TCP Connect mode.
π OUTPUT OPTIONS π
-v[level],--verbose [level](Increase or set verbosity level) β increases the verbosity level, causing Nping to print more information during its execution. There are 9 levels of verbosity (-4to4). Every instance of-vincrements the verbosity level by one (from its default value, level0). Every instance of option-qdecrements the verbosity level by one. Alternatively you can specify the level directly, as in-v3or-v-1. These are the available levels:
Level -4
No output at all. In some circumstances you may not want Nping to produce any output (like when one of your work mates is watching over your shoulder π). In that case level -4 can be useful because although you won't see any response packets, probes will still be sent. Stealth mode activated.
Level -3
Like level -4 but displays fatal error messages so you can actually see if Nping is running or it failed due to some error.
Level -2
Like level -3 but also displays warnings and recoverable errors.
Level -1
Displays traditional run-time information (version, start time, statistics, etc.) but does not display sent or received packets.
Level 0
This is the default verbosity level. It behaves like level -1 but also displays sent and received packets and some other important information. The main character default β¨.
Level 1
Like level 0 but it displays detailed information about timing, flags, protocol details, etc. Nerd mode, affectionately.
Level 2
Like level 1 but displays very detailed information about sent and received packets and other interesting information.
Level 3
Like level 2 but also displays the raw hexadecimal dump of sent and received packets. Hex girlies rise π₯.
Level 4 and higher
Same as level 3. That's the ceiling, bestie.
-q[level],--reduce-verbosity [level](Decrease verbosity level) β decreases the verbosity level, causing Nping to print less information during its execution. The counterweight to-v, fr fr.-d[level](Increase or set debugging level) β when even verbose mode doesn't provide sufficient data for you, debugging is available to flood you with much more! As with the-v, debugging is enabled with a command-line flag-dand the debug level can be increased by specifying it multiple times. There are 7 debugging levels (0to6). Every instance of-dincrements debugging level by one. Provide an argument to-dto set the level directly; for example-d4.
Debugging output is useful when you suspect a bug in Nping, or if you are simply confused as to what Nping is doing and why. As this feature is mostly intended for developers, debug lines aren't always self-explanatory. You may get something like
NSOCK (1.0000s) Callback: TIMER SUCCESS for EID 12; tcpconnect_event_handler(): Received callback of type TIMER with status SUCCESS
If you don't understand a line, your only recourses are to ignore it, look it up in the source code, or request help from the development list (nmap-dev). Some lines are self-explanatory, but the messages become more obscure as the debug level is increased π. These are the available levels:
Level 0
Level 0. No debug information at all. This is the default level.
Level 1
In this level, only very important or high-level debug information will be printed.
Level 2
Like level 1 but also displays important or medium-level debug information.
Level 3
Like level 2 but also displays regular and low-level debug information.
Level 4
Like level 3 but also displays messages only a real Nping freak would want to see π«Ά.
Level 5
Like level 4 but it enables basic debug information related to external libraries like Nsock.
Level 6
Like level 5 but it enables full, very detailed, debug information related to external libraries like Nsock. Maximum chaos, maximum detail π.
π BUGS (yes we have those, and yes you can help fix them) π
Okay so real talk bestie β like its authors, Nping isn't perfect. π«Ά Nobody is! But you can literally help make it better by sending bug reports or even writing patches. That's it, that's the vibe.
If Nping doesn't behave the way you expect, first upgrade to the latest version available from https://nmap.org. Don't come for the devs while running some dusty old build, iykyk. π
If the problem persists, do some research to determine whether it has already been discovered and addressed. Try searching for the problem or error message on Google since that aggregates so many forums. Google is lowkey the group chat of the entire internet, so do that first. π
If nothing comes of this, create an Issue on our tracker (http://issues.nmap.org) and/or mail a bug report to <dev@nmap.org>. If you subscribe to the nmap-dev list before posting, your message will bypass moderation and get through more quickly β main character speedrun, honestly. π Subscribe at https://nmap.org/mailman/listinfo/dev.
Please include everything you have learned about the problem, as well as what version of Nping you are using and what operating system version it is running on. The full lore, basically β don't make people play detective. π΅οΈββοΈ
Other suggestions for improving Nping may be sent to the Nmap dev mailing list as well. π
If you are able to write a patch improving Nping or fixing a bug, that is even better! Instructions for submitting patches or git pull requests are available from https://github.com/nmap/nmap/blob/master/CONTRIBUTING.md. Code contributions are iconic, fr fr. β¨
Particularly sensitive issues such as a security reports may be sent directly to Fyodor directly at <fyodor@nmap.org>. All other reports and comments should use the dev list or issue tracker instead because more people read, follow, and respond to those.
π AUTHORS (the legends themselves) π
- Luis MartinGarcia
<luis.mgarc@gmail.com>(http://www.luismg.com) β an absolute king π - Fyodor
<fyodor@nmap.org>(https://insecure.org) β THE Fyodor, yes π
π NOTES (the citations, keep them, they're important) π
- official type numbers assigned by IANA
http://www.iana.org/assignments/icmp-parameters - official numbers assigned by IANA
http://www.iana.org/assignments/arp-parameters/ - official numbers listed by the IEEE
http://standards.ieee.org/regauth/ethertype/eth.txt
Okay bestie, that's the whole page β you made it to the end, so proud of you π¦β¨ This blessed manual page is Nping (source/version NPING(1), dated 10/23/2026), and that footer means you're officially done reading. Go ping something cute. ππΈπ
π¦ where this page comes from
- arch rolling: nmap 7.993-1 Β· LicenseRef-Nmap-Public-Source-License-Version-0.95
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms