summaryrefslogtreecommitdiffstats
path: root/nping/nping-dev
diff options
context:
space:
mode:
Diffstat (limited to 'nping/nping-dev')
-rw-r--r--nping/nping-dev/Diagram1.diabin0 -> 5086 bytes
-rw-r--r--nping/nping-dev/EchoProtoRFC_v0.txt741
-rw-r--r--nping/nping-dev/NpingCommandLine.txt151
-rw-r--r--nping/nping-dev/NpingExamples.txt56
-rw-r--r--nping/nping-dev/NpingRequirements.txt165
-rw-r--r--nping/nping-dev/PacketDiff_RFC.txt538
-rw-r--r--nping/nping-dev/README40
-rw-r--r--nping/nping-dev/configFiles.txt12
-rwxr-xr-xnping/nping-dev/do_valgrind.sh2
-rw-r--r--nping/nping-dev/echo_proposal.txt222
-rw-r--r--nping/nping-dev/nping_logo.svg483
-rw-r--r--nping/nping-dev/packetDiagram.pngbin0 -> 44131 bytes
-rw-r--r--nping/nping-dev/pythonscripts/TemplateGettersSetters.txt25
-rwxr-xr-xnping/nping-dev/pythonscripts/TemplateNpingOps.txt45
-rw-r--r--nping/nping-dev/pythonscripts/addGettersSetters.py28
-rwxr-xr-xnping/nping-dev/pythonscripts/addManSectionEntry.py43
-rwxr-xr-xnping/nping-dev/pythonscripts/addNpingOpsAttr.py12
-rw-r--r--nping/nping-dev/pythonscripts/man-section-entry-template.xml25
-rw-r--r--nping/nping-dev/pythonscripts/man-section-template.xml34
-rw-r--r--nping/nping-dev/test/caps/tcpconnect_T1.capbin0 -> 2318 bytes
-rw-r--r--nping/nping-dev/test/caps/tcpconnect_T2.capbin0 -> 824 bytes
-rw-r--r--nping/nping-dev/test/caps/tcpconnect_T3.capbin0 -> 744 bytes
-rwxr-xr-xnping/nping-dev/test/test_nping.sh1526
-rw-r--r--nping/nping-dev/valgrind_supress.txt85
24 files changed, 4233 insertions, 0 deletions
diff --git a/nping/nping-dev/Diagram1.dia b/nping/nping-dev/Diagram1.dia
new file mode 100644
index 0000000..0ecb76c
--- /dev/null
+++ b/nping/nping-dev/Diagram1.dia
Binary files differ
diff --git a/nping/nping-dev/EchoProtoRFC_v0.txt b/nping/nping-dev/EchoProtoRFC_v0.txt
new file mode 100644
index 0000000..65f1a88
--- /dev/null
+++ b/nping/nping-dev/EchoProtoRFC_v0.txt
@@ -0,0 +1,741 @@
++-----------------------------------------------------------------------------+
+
+
+
+
+
+
+ NPING ECHO PROTOCOL
+
+
+
+
+ PROTOCOL SPECIFICATION
+
+ Request for Comments
+
+ July 2009
+
+
+
+
+
+ Luis MartinGarcia
+ (luis.mgarc@gmail.com)
+
+
+
+
+
+
++-----------------------------------------------------------------------------+
+
+
+
+
+ PREFACE
+
+This document introduces Nping Echo Protocol, the protocol that has been
+designed to support a new feature that allows Nping users to see what the
+packets they send look like when they reach their destination.
+
+
+
+ TABLE OF CONTENTS
+
+1. INTRODUCTION ..................................................... x
+
+
+2. NPING ECHO PROTOCOL SPECIFICATION................................. x
+
+ 2.1 General Packet Format.............. ........................... x
+ 2.2 Field Description ............................................. x
+ 2.3 Operation Codes ............................................... x
+ 2.4 Operation HELLO................................................ x
+ 2.5 Operation HELLO RESPONSE ...................................... x
+ 2.6 Operation SPECS ............................................... x
+ 2.7 Operation READY ............................................... x
+ 2.8 Operation ECHOPKT ............................................. x
+ 2.9 Operation QUIT ................................................ x
+ 2.10 Flow Diagram .................................................. x
+ 2.11 Security .......................................................x
+
+3. GLOSSARY .......................................................... x
+
+4. REFERENCES ........................................................ x
+
+
+
+
+
+
+
+
+
+
+
+
+
+1. INTRODUCTION
+
+ Troubleshooting routing and firewall issues is a common task nowadays.
+ The scenario is generally that some network traffic should be flowing
+ but isn't. The causes of problem can range from routing issues to
+ network firewall to host-based firewalls to all sorts of other strange
+ things. It is usually the "middle box" problem that is the hardest to
+ find.
+
+ Suppose there is some host with a TCP service listening that you can't
+ connect to for an unknown reason. If a Nmap -sS scan doesn't show the
+ port as open there are a multitude of possible problems. Maybe the SYN
+ packet never made it because of some firewall in the middle. Maybe the
+ SYN did make it but the SYN+ACK got dropped on it's way back to you.
+ Maybe the TTL expired in transit but the ICMP message got blocked by
+ another firewall before making it back to you. Maybe the SYN made it
+ but some intermediate host forged a reset packet to snipe the connection
+ before the SYN+ACK made it back to you.
+
+ When things like the above are going on it is often the case that even
+ hping can't track down the problem alone. One generally have to turn to
+ Wireshark/tcpdump on one station and hping on the other but sometimes
+ it may be quite difficult to coordinate, specially when the person at
+ the remote host does not even know what an IP address is.
+
+ To solve this problem, Nping will have a mode called "Echo mode" (We are
+ still looking for a better name, suggestions are welcome), that will
+ give it the power of hping + tcpdump.
+
+ Both machines have to be running Nping, one of them in server mode and
+ the other in client mode. The way it works is: the Nping
+ client performs an initial handshake with the server over some
+ standard port (creating a side-channel). Then it notifies the server
+ what packets are about to be sent. The server sets up a liberal BPF
+ filter that captures those packets, and starts listening. When the server
+ receives a packet it encapsulates it (including the link layer frame)
+ into our own protocol packet and sends it back to the nping client.
+ This would be essentially like running tcpdump on the remote machine
+ and having it report back the packets you sent to it with Nping.
+
+ By having the side-channel to talk to the server, things like NAT would
+ become immediately apparent because you'd see your source IP (and
+ sometimes port) change. Things like "packet shapers" that change TCP
+ window sizes transparently between hosts would
+ turn up. It would be easy to tell if the traffic is being dropped in
+ transit and never gets to the box. It would also be easy to tell if
+ the traffic does make it to the box but the reply never makes it back
+ to you.
+
+ In general, it would be like sending a postal package to someone and
+ having them email you a photo of the package when they get it. If you
+ think your packages are being abused by the parcel service then having
+ someone on the other end to send information back is a great way to
+ uncover what is going on.
+
+
+
+2. NPING ECHO PROTOCOL SPECIFICATION
+
+
+ 2.1 General Packet Format
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code | Total Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . .
+ . DATA .
+ . .
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . Checksum .
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ There are 6 different kinds of packets:
+
+ HELLO: (C->S)
+ Informs the server of the highest version we support.
+
+ HELLO RESPONSE: (S->C)
+ Informs the client of the highest version we support.
+
+ SPECS: (C->S):
+ Tells the server what kind of packets we are planning to send.
+
+ READY: (S->C):
+ Tells the client that the server is ready to start receiving
+ packets.
+
+ ECHOPKT: (S->C):
+ Contains the packet that the server receives from the client.
+
+ QUIT: (C->S or S->C):
+ Asks to stop the echo process.
+
+
+
+
+
+
+ 2.2 Field Description
+
+ Version: 8 bits
+ Current version of the protocol. This document covers version 0x01.
+
+
+ Operation Code: 8 bits
+ Indicates the type of packet. It must be one of the operation
+ codes defined in section 2.2.
+
+
+ Total Length: 16 bits
+ Length of the entire packet, measured in 32bit words. Value must
+ be in NETWORK byte order.
+
+
+ Sequence Number: 32 bits
+ Initially each peer generates a random sequence number and then
+ increments it by one in each packet that it sends. It must be
+ in NETWORK byte order. This field is intented to provide some,
+ very basic, protection against replay attacks.
+
+
+ Reserved: 64 bits
+ Reserved for future use. Reserved fields have been added for two
+ reason. To allow future extension of the protocol and to make
+ the header a multiple of 128 bits needed to satisfy AES encryption
+ requirements in block size.
+
+
+ Data: variable length
+ Operation specific data.
+
+
+ Checksum: 256 bits
+ SHA-256 sum of the entire packet. Checksum computation includes
+ the checksum field which must be previously set to zero.
+ This field is intended to provide client authentication. Echo
+ messages are transmitted encrypted (unless Nping is compiled
+ without OpenSSL). When a server receives a packet, it decrypts it
+ using a symmetric key known by both ends. Then it verifies the
+ checksum. If the checksum is correct it assumes the client is
+ an authorized user because only a person who knows the encryption
+ key and is capable of generating packets that when decrypted
+ produce valid sums.
+
+
+
+
+
+
+ 2.3 Operation Codes
+
+ Operation HELLO: 0x01
+ Operation HELLO RESPONSE: 0x02
+ Operation SPECS: 0x03
+ Operation READY: 0x04
+ Operation ECHOPKT: 0x05
+ Operation QUIT: 0x06
+
+
+
+
+
+ 2.4 Operation HELLO
+
+ The HELLO packet is sent by the client and it asks the server
+ to establish a new session. The packet also informs the server
+ of the latest version of the protocol that the client supports.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code 0x01 | Total Length |
+ 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved | Reserved | IP version |
+ 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ 5 +-- --+
+ | |
+ 6 +-- Partner IP address --+
+ | |
+ 7 +-- --+
+ | |
+ 8 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ 9 +-- --+
+ | |
+ 10 +-- Reserved --+
+ | |
+ 11 +-- --+
+ | |
+ 12 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . . .
+ . . SHA256 Checksum .
+ . . .
+ | |
+ 20 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ IP Version: 8 bits
+ IP version of the following IP address.
+
+
+ Partner IP address: 128 bits
+ This is the server's IP address as seen by the client. This is
+ not very useful but is provided for consistency with the HELLO
+ response packet.
+ This field has 128 bits to allow use of both IPv4 and IPv6
+ addresses. When IPv4 is used, only the first four bytes are used.
+ The rest may be set to zero or filled with random data.
+
+ Reserved: 128 bits
+ Reserved for future use.
+
+
+
+
+ 2.5 Operation HELLO RESPONSE
+
+ The HELLO RESPONSE packet is sent by the server to indicate the client
+ that he is actually a Nping Echo server and to inform about the
+ latest version it supports.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code 0x02 | Total Length |
+ 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved | Reserved | IP version |
+ 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ 5 +-- --+
+ | |
+ 6 +-- Partner IP address --+
+ | |
+ 7 +-- --+
+ | |
+ 8 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ 9 +-- --+
+ | |
+ 10 +-- Reserved --+
+ | |
+ 11 +-- --+
+ | |
+ 12 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . . .
+ . . SHA256 Checksum .
+ . . .
+ | |
+ 20 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ IP Version: 8 bits
+ IP version of the following IP address.
+
+
+ Partner IP address: 128 bits
+ This is the client's IP address as seen by the server. This
+ lets the client to inmediatly detect the presence of some
+ intermediate device that changes his source IP (e.g a NAT box).
+ This can also be useful in case the client wants to specify
+ its own BPF filter (overriding server's default behaviour)
+ (see section 2.5 for more information).
+ This field has 128 bits to allow use of both IPv4 and IPv6
+ addresses. When IPv4 is used, only the first four bytes are used.
+ The rest may be set to zero or filled with random data.
+
+ Reserved: 128 bits
+ Reserved for future use.
+
+
+ 2.6 Operation SPECS
+
+ The SPECS packet is sent by the client to tell the server what kind
+ of packets it should expect. Additionally, the client may also include
+ a custom BPF filter for the server.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code 0x03 | Total Length |
+ 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Protocol | Reserved | Packet Count |
+ 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ . | |
+ . . .
+ . . BPF filter specification .
+ n . .
+ | |
+ n+1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . . .
+ . . SHA256 Checksum .
+ . . .
+ | |
+ n+9 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Protocol: 8 bits.
+ Specifies which kind of packets will be sent to the server. It
+ must contain one of the following values:
+
+ 0x01 (Protocol TCP)
+ Tells the server to listen to TCP packets coming from
+ the client's IP address.
+
+ 0x02 (Protocol UDP)
+ Tells the server to listen to UDP packets coming from
+ the client's IP address.
+
+ 0x03 (Protocol ICMP)
+ Tells the server to listen to ICMP packets coming from
+ the client's IP address.
+
+ 0x04 (Protocol ARP)
+ Tells the server to listen to ARP packets coming from
+ the client's MAC address (or in most cases, server's
+ gateway MAC address).
+
+ 0xAA (Custom BPF filter included)
+ Tells the server to use a custom BPF filter specified in
+ an additional field.
+
+ 0xFF (Any protocol)
+ Tells the server to listen to any packets coming from
+ the client's IP address.
+
+ Reserved: 8 bits
+ Reserved for future use.
+
+
+ Packet count: 16 bits.
+ Specifies how many packets will be sent. It must be in NETWORK
+ byte order.
+
+
+ BPF filter specification: variable length
+
+ When field "Protocol" contains value 0xAA, an additional
+ field is included in the packet: the BPF filter specification.
+
+ This field contains a BPF filter specification in tcpdump
+ format. This is useful when the client wants to override the
+ server's default BPF filters and capture a different type of
+ traffic.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | BPF Filter Spec Length | .
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ .
+ . .
+ . BFP Filter Spec .
+ . +-+-+-+-+-+-+-+-+
+ | | Padding |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ The length is measured in bytes and should be in NETWORK byte
+ order. If the length is not a multiple of 16, it must be padded
+ with NULL bytes.
+
+
+ When client specifies an empty filter, meaning capture all
+ packets, the field will look like:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length=0 | Padding |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ As a security measure, the server may not allow use of
+ custom BPF filters. In that case, a QUIT packet must be
+ sent to the client.
+
+
+
+
+ 2.7 Operation READY
+
+ The READY packet is sent by the server to indicate the client that
+ his SPECS packet was accepted and that everything is ready to start
+ receiving and echoing packets.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code 0x04 | Total Length |
+ 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . . .
+ . . SHA256 Checksum .
+ . . .
+ | |
+ 12 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+ 2.8 Operation ECHOPKT
+
+ The ECHOPKT packet is sent by the server and it contains an echoed
+ packet.
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code 0x05 | Total Length |
+ 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved | Reserved |
+ 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | DLT Type | Packet Length |
+ 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ . . .
+ . . Packet .
+ . . .
+ n . +-+-+-+-+-+-+-+-+
+ | | Padding |
+ n+1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . . .
+ . . SHA256 Checksum .
+ . . .
+ | |
+ n+9 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ DLT Type: 16 bits.
+ Specifies the type of link layer device used in the server side.
+ Since the server includes link layer frames in echoed packets,
+ the client needs to know the DLT in order to process link layer
+ header information.
+ Values used in this field must match DLT types defined in libpcap
+ and must be transmitted in NETWORK byte order.
+
+ Packet Length: 16 bits.
+ Specifies the length of the echoed packet measured in bytes.
+ It must be in NETWORK byte order.
+
+ Packet: variable length.
+ This corresponds to the packet being echoed. Server should
+ store the packet exactly as it was received. No byte order
+ conversions or any other alteration should be performed.
+ If the length is not a multiple of 16, it must be padded with
+ NULL bytes.
+
+
+
+ 2.9 Operation QUIT
+
+ The QUIT packet is sent by client or server to tell its peer to
+ terminate the current session.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | OP Code 0x06 | Total Length |
+ 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 3 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved |
+ 4 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ . . .
+ . . SHA256 Checksum .
+ . . .
+ | |
+ 12 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ This packet should be sent:
+ By the client: to tell the server to stop echoing packets and
+ terminate the current session.
+
+ By the server: to tell the client that no custom BPF filter
+ is allowed so the session will be terminated.
+
+
+ 2.10 Flow diagram
+
+
+ The following diagram represents a typical session:
+
+ +------+ +------+
+ |CLIENT| |SERVER|
+ +------+ +------+
+ | |
+ | HELLO | :: Hi. I'm an Nping Client.
+ |------------------>>| I support version 1.
+ | |
+ | |
+ | HELLO RESPONSE |
+ |<<------------------| :: Nice 2 meet u. Im a server..
+ | | I also support version 1
+ | |
+ | SPECS |
+ |------------------>>| :: I'll be sending 5 ICMP
+ | | Destination Unreachable probes.
+ | |
+ | |
+ | READY |
+ |<<-- ---------------| :: OK, I'm ready for those probes.
+ | |
+ | |
+ | |
+ | |
+ | ECHOPKT |
+ |<<------------------| :: Here's what I received.
+ | |
+ | ECHOPKT |
+ |<<------------------| :: Here's what I received.
+ | |
+ | ECHOPKT |
+ |<<------------------| :: Here's what I received.
+ | . |
+ | . |
+ | . |
+ | ECHOPKT |
+ |<<------------------| :: Here's what I received.
+ | |
+ | |
+ | |
+ | QUIT |
+ |------------------>>| :: It's been a pleasure.
+
+
+
+
+ The following diagram represents a session where the client requests
+ the use of a custom BPF filter but the server is configured not to
+ allow it.
+
+ +------+ +------+
+ |CLIENT| |SERVER|
+ +------+ +------+
+ | |
+ | HELLO | :: Hi. I'm an Nping Client.
+ |------------------>>| I support version 1.
+ | |
+ | |
+ | HELLO RESPONSE |
+ |<<------------------| :: Nice 2 meet u. Im a server..
+ | | I also support version 1
+ | |
+ | SPECS |
+ |------------------>>| :: Use this BPF filter (tcp and udp)
+ | |
+ | |
+ | |
+ | QUIT |
+ |<<-- ---------------| :: Sorry, no custom BPF allowed.
+
+
+ 2.11 Security
+
+ The Nping Echo functionality involves direct access to network traffic
+ on the server side and that can easily involve information leakage
+ problems if no security measures are taken.
+
+ Unless Nping is compiled without OpenSSL support, all Nping Echo
+ Protocol (NEP) packets are transmitted encrypted. Rijndael/AES standard
+ is used. It has a block size of 128 bits, that's why all NEP packets
+ must have a length that is multiple of 16 bytes.
+
+ Every NEP packet includes a SHA-256 checksum. SHA-256 has been chosen
+ over MD5 or SHA1, just to be safe in the future. MD5 is already broken
+ and some studies show important advances in SHA1 attacks.
+
+ As described above, client authentication is performed using the
+ checksum field. The server assumes only a client in possesion of the
+ correct encryption key is capable of producing packets that, when
+ decrypted, contain valid SHA-256 checksum. However, replay attacks
+ may be possible in this scheme. A small 32bit Sequence field is
+ included in every packet. In theory, the server could have a list
+ of sequence numbers that have already been used and deny connection
+ to clients that use replayed packets. However, a 32 bit space may not
+ be sufficiently large to provide security, and exhaustion of sequence
+ numbers may result in a denial of service for authorized clients.
+
+ If we set the "Reserved" field (56 bits) in the initial HELLO packet
+ to some random value, and we instruct the server to keep a list of
+ both, sequence numbers and checksums, then it is possible that the
+ tuple (seq, checksum) provides enough security while significantly
+ reducing the possibility of client denial of service. We can even use
+ (seq, rand, checksum) where "rand" is the random data included in
+ the reserved space.
+
+ The problem with replay attacks is not tremendously important because,
+ at the end of the day, an attacker that does not have the encryption
+ key and therefore cannot see the contents of the ECHOPKT packets.
+ However, if the attacker replays old packets to establish a new
+ connection, the server will send him some data whenever he captures
+ a packet, and the fact the it has actually captured a packet can give
+ the attacker enough information to tell if the server is behind a
+ firewall, etc.
+
+ Security aspects are not yet defined properly. Any comments and
+ suggestions are welcome.
+
+
+
+3. GLOSSARY
+
+4. REFERENCES
+
+ [1]
+
+ [2]
+
+ [3]
+
+ [4]
+
+
+
+
+
+
+
diff --git a/nping/nping-dev/NpingCommandLine.txt b/nping/nping-dev/NpingCommandLine.txt
new file mode 100644
index 0000000..df4175d
--- /dev/null
+++ b/nping/nping-dev/NpingCommandLine.txt
@@ -0,0 +1,151 @@
+++++++++++++++++++++++++++++++++++
+| NPING COMMAND LINE INTERFACE |
+++++++++++++++++++++++++++++++++++
+
+This document presents Nping's command line interface. All option flags are
+now definitive. Howerever, comments and suggestions are still welcome.
+
+
+
+Nping 0.01a ( 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.0-255.1-254
+ -iL <inputfilename>: Read targets from list of hosts or networks
+PROBE MODES:
+ --tcp-connect : Unprivileged TCP connect probe mode.
+ --tcp : TCP probe mode.
+ --upd : UPD probe mode.
+ --icmp : ICMP probe mode.
+ --arp : ARP Request probe mode.
+ --rarp : RARP Request probe mode.
+ --arp-response : ARP Response probe mode.
+ --rarp-response : RARP Response probe mode.
+ -tr, --traceroute : Traceroute mode (can be used together with TCP/UDP/ICMP
+ pings, but not with ARP ping)
+TCP PROBE MODE:
+ -g, --source-port <portnumber> : Set source port.
+ -p, --dest-port <portnumber> : Set destination port.
+ --seq <seqnumber> : Set sequence number.
+ --flags <flags> : Set TCP flags.
+ --ack <acknumber> : Set ACK number.
+ --win <size> : Set window size.
+ --badsum : Use a random invalid checksum.
+ --mss <size> : Set maximum segment size.
+ --ws <n> : Set window scale.
+ --ts <echo,reply> : Set timestamp (echo and reply fields).
+UDP PROBE MODE:
+ -g, --source-port <portnumber> : Set source port.
+ -p, --dest-port <portnumber> : Set destination port.
+ --badsum : Use a random invalid checksum.
+ICMP PROBE MODE:
+ -I3, --dest-unr : Send "destination unreacheable" messages.
+ -I8, --echo-req : Send "echo request" messages.
+ -I13, --ts-req : Send "timestamp request" messages.
+ -I15, --info-req : Send "Information request" messages.
+ -I17, --netmask-req : Send "Netmask request" messages.
+ --icmp-code <code> : ICMP code.
+ --icmp-id <id> : Sets field "Identifier" in echo messages (16bits).
+ --icmp-seq <n> : Sets field "Sequence number" in echo messages (16 bits).
+ARP/RARP PROBE MODE:
+ --arp-sender-mac <mac> : Set sender MAC address.
+ --arp-sender-ip <ip> : Set sender IP address.
+ --arp-target-mac <mac> : Set target MAC address.
+ --arp-target-ip <ip> : Set target IP address.
+ETHERNET OPTIONS:
+ --dest-mac : Set destination mac address. This disables ARP resolution.
+ --source-mac : Set source MAC address.
+IP OPTIONS:
+ -S, --source-ip : Set source IP address.
+ --dest-ip : Set destination IP address (used as an alternative to
+ {target specification} ).
+ --tos <val> : Set type of service field (8bits).
+ --id <val> : Set identification field (16 bits).
+ --df : Set Don't Fragment flag.
+ --mf : Set More Fragments flag.
+ --ttl <val> : Set time to live [0-256].
+ --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 <len> : Set MTU. Packets get fragmented if MTU is small enough.
+ -f : Fragment packets.
+PAYLOAD OPTIONS:
+ --data <hex string> : Include TCP/UPD/ICMP payload (if it makes sense).
+ --data-file <filename> : Get payload from specified file.
+ --data-length <len> : Include len random bytes as payload.
+ECHO CLIENT/SERVER:
+ -K, --ekey <hex> : Key to be used for encryption/decryption.
+ -P, --passphrase : Passphrase to derive an encryption key from.
+ CLIENT-ONLY OPTIONS:
+ --client : Run Nping in client mode.
+ --interpret : Interpret received echoes.
+ SERVER-ONLY OPTIONS:
+ --server : Run Nping in server mode.
+ --echo-link : Return back: link+net+transport+payload
+ --echo-net : Return back: net+transport+payload
+ --echo-trans : Return back: transport+payload
+ --echo-data : Just return payload.
+TIMING AND PERFORMANCE:
+ Options which take <time> are in milliseconds, unless you append 's'
+ (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m).
+ --delay <time> : Adjust delay between probes.
+ --rate <num> : Send num packets per second.
+ --host-timeout <time> : Give up on target after this long.
+MISC:
+ -h, --help : Display help information on stardard output.
+ -V, --version : Display Nping current version number.
+ -c, --count <n> : Stop after sending (and receiving) n response packets.
+ -e, --interface <name> : Use supplied network interface.
+ --privileged : Assume that the user is fully privileged.
+ --unprivileged : Assume the user lacks raw socket privileges.
+ --send-eth : Send packets at the raw ethernet layer.
+ --send-ip : Send packets using raw IP sockets.
+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
+ --quiet : Sets verbosity and debug level to zero. (Same as -v0 -d0)
+ --debug : Sets verbosity and debug to their highest level.
+EXAMPLES:
+ nping scanme.nmap.org
+ nping --tcp --dest-port 80 --ttl 2 192.168.1.1
+ nping --debug --icmp -I17 --delay 2s microsoft.com
+
+SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES
+
+
+
+
+
+
+
++------------------------------------------------------------------------------+
+
+NOTES:
+
+In places where a port number, an IP address, etc, is expected, it is possible
+to specify the word "rand" or "random", so Nping sets a random value for that
+option.
+
+E.g: nping --tcp --dest-port random 192.168.1.1
+ nping --udp --source-port random --source-mac random 207.46.197.32
+ nping --arp --sender-ip random --ttl random scanme.nmap.org
+
+
+In places where a MAC address is expected, it is possible to especify a MAC
+address, a prefix or a vendor name. Missing information will be completed with
+random values.
+
++------------------------------------------------------------------------------+
+
+
+
+
+
+
+
+
+
diff --git a/nping/nping-dev/NpingExamples.txt b/nping/nping-dev/NpingExamples.txt
new file mode 100644
index 0000000..055db5d
--- /dev/null
+++ b/nping/nping-dev/NpingExamples.txt
@@ -0,0 +1,56 @@
+++++++++++++++++++++++++++
+| NPING USAGE EXAMPLES |
+++++++++++++++++++++++++++
+
+
+# These can be run with no privileges ******************************************
+
+/* Do simple TCP connect()s to one host */
+nping --tcp-connect google.com
+
+/* Do simple TCP connect()s to multiple hosts */
+nping --tcp-connect google.com ask.com yahoo.com bing.com
+
+/* Send an UDP packet with 100 bytes of random data */
+nping --udp google.com -p 53 --data-length 100
+
+/* Try to TCP connect() to a range of ports */
+nping --tcp-connect google.com -p75-85 -c 1
+
+# These require root access ****************************************************
+
+# Send TCP Syn with the ECN flag also set
+sudo nping --tcp google.com --flags syn,ecn -p80,443
+
+# Send UDP packet with a bogus checksum from port 1337
+sudo nping --udp --badsum --source-port 1337 -p 53 google.com -v6
+
+# Send ARP requests to 192.168.1.1
+sudo nping --arp 192.168.1.1
+
+# Send ARP requests to all host in network 192.168.1.0 (inter-probe delay = 100ms)
+sudo nping --arp 192.168.1.0/24 --delay 100
+
+# Send 300 TCP packets at a rate of 100pkts/sec
+sudo nping --tcp google.com --rate 100 -c 300
+
+# Send ICMP echo request wit custom ID and Seq fields
+sudo nping google.com --icmp --icmp-type echo --icmp-id 31337 --icmp-seq 1
+
+# Send ICMP echo reply
+sudo nping google.com --icmp --icmp-type echo-reply
+
+# Send ICMP Parameter problem with custom pointer
+sudo nping google.com --icmp --icmp-type parameter-problem --icmp-param-pointer 9
+
+# Send ICMP Source Quench
+sudo nping google.com --icmp --icmp-type source-quench -v6
+
+# Send ICMP Time Exceeded because time exceeded during reassembly
+sudo nping google.com --icmp --icmp-type te --icmp-code frag-exc -v5
+
+# Send ICMP Router Advertising with 2 entries
+sudo nping google.com --icmp --icmp-type 9 --icmp-advert-entry 1.1.1.1,300 --icmp-advert-entry 33.33.33.33,12345 -v6
+
+
+
diff --git a/nping/nping-dev/NpingRequirements.txt b/nping/nping-dev/NpingRequirements.txt
new file mode 100644
index 0000000..53218f4
--- /dev/null
+++ b/nping/nping-dev/NpingRequirements.txt
@@ -0,0 +1,165 @@
+++++++++++++++++++++++++++++++++
+| NPING PROJECT REQUIREMENTS |
+++++++++++++++++++++++++++++++++
+
+This document presents a list of requirements for the tool Nping that will
+be developed during this summer as a project for the program Google Summer of
+Code.
+
+Each requirement is tagged with one of the following tags:
+
+[MustHave] It definitely must be met.
+[ShouldHave] It should be met if providing there is enough time for it.
+[CouldHave] It would be nice to have but it's not essential.
+[OnRequest] It would be added to the todo-list if someone asks for it on the
+ list, provides a good reason and some usage scenarios.
+
++------------------------+
+| GENERAL |
++------------------------+
+
+* Documentation for end-users.........................................[MustHave] [DONE]
+* Documentation of the source code using Doxygen syntax..............[Couldhave] [DONE]
+* Command line interface with well-defined option flags...............[MustHave] [DONE]
+* 6 levels of verbosity (0 to 5)......................................[MustHave] [DONE]
+* 6 levels of debugging information...................................[MustHave] [DONE]
+* Written in C++......................................................[MustHave] [DONE]
+* Run and be tested under Linux.......................................[MustHave] [DONE]
+* Run and be tested under Windows.....................................[MustHave]
+* Run and be tested under OS X........................................[MustHave]
+* Compile as a single, statically-linked executable..................[CouldHave]
+* Use of libdnet......................................................[MustHave] [DONE]
+* Designed to be integrated into Nmap tarball.........................[MustHave]
+* Design to allow easy extension to other protocols...................[MustHave] [DONE]
+
+
++------------------------+
+| LINK LAYER |
++------------------------+
+* Raw Ethernet frame generation.......................................[MustHave] [DONE]
+ - Destination MAC address...........................................[MustHave] [DONE]
+ - Spoofed source MAC address........................................[MustHave] [DONE]
+ - Custom Ethertype/Length..........................................[OnRequest] [DONE]
+ - Invalid CRC32 checksum...........................................[OnRequest]
+
+* ARP ping............................................................[MustHave] [DONE]
+
+* Custom ARP packet generation
+ - Hardware type....................................................[OnRequest]
+ - Protocol type....................................................[OnRequest]
+ - Hardware length..................................................[OnRequest]
+ - Protocol length .................................................[OnRequest]
+ - Operation .......................................................[OnRequest] [DONE]
+ - Sender hardware address...........................................[MustHave] [DONE]
+ - Sender protocol address...........................................[MustHave] [DONE]
+ - Target hardware address...........................................[MustHave] [DONE]
+ - Target protocol address...........................................[MustHave] [DONE]
+* Custom RARP packet generation......................................[CouldHave] [DONE]
+
++------------------------+
+| NETWORK LAYER |
++------------------------+
+
+* Custom IPv4 packet generation.......................................[MustHave] [DONE]
+ - Custom version number............................................[OnRequest]
+ - Invalid header lengths...........................................[OnRequest]
+ - Type of Service...................................................[MustHave] [DONE]
+ - Invalid total lengths............................................[OnRequest]
+ - Custom Idenfication number........................................[MustHave] [DONE]
+ - Do Not Fragment Flag..............................................[MustHave] [DONE]
+ - More Fragments Flag...............................................[MustHave] [DONE]
+ - Reserved flag....................................................[OnRequest]
+ - Incorrect fragment offset........................................[OnRequest]
+ - Custom TTL........................................................[MustHave] [DONE]
+ - Custom Protocol number...........................................[OnRequest]
+ - Invalid header checksum...........................................[MustHave] [DONE]
+ - Spoofed source address............................................[MustHave] [DONE]
+ - Destination address...............................................[MustHave] [DONE]
+ - IP options........................................................[MustHave] [DONE]
+
+* IPv6 packet generation
+ - IPv6 support for TCP connect() ping...............................[MustHave]
+ - IPv6 support for UDP pings........................................[MustHave]
+ - IPv6 packet generation............................................[MustHave]
+
+* ICMP packet generation..............................................[MustHave] [DONE]
+ - Echo Request......................................................[MustHave] [DONE]
+ - Timestamp request.................................................[MustHave] [DONE]
+ - Information Request...............................................[MustHave] [DONE]
+ - Netmask Request...................................................[MustHave]
+ - Redirect..........................................................[MustHave] [DONE]
+ - Fake Destination Unreachable Message..............................[MustHave] [DONE]
+ - Fake Echo Reply Message..........................................[OnRequest] [DONE]
+ - Fake Source Quench Message.......................................[OnRequest] [DONE]
+ - Fake Time Exceeded message.......................................[OnRequest] [DONE]
+ - Fake Parameter Problem Message...................................[OnRequest] [DONE]
+ - Timestamp reply..................................................[OnRequest] [DONE]
+ - Information Reply................................................[OnRequest] [DONE]
+ - Netmask Reply....................................................[OnRequest]
+
+
+
++------------------------+
+| TRANSPORT LAYER |
++------------------------+
+* Custom TCP packet generation........................................[MustHave] [DONE]
+ - Source port......................................................[MustHave] [DONE]
+ - Destination port.................................................[MustHave] [DONE]
+ - Sequence Number..................................................[MustHave] [DONE]
+ - ACK Number.......................................................[MustHave] [DONE]
+ - Invalid offset values...........................................[OnRequest]
+ - Custom data in "Reserved" field.................................[OnRequest]
+ - TCP Flags (including CWR and ECE)................................[MustHave] [DONE]
+ - Window size......................................................[MustHave] [DONE]
+ - Invalid checksum.................................................[MustHave] [DONE]
+ - Custom Urgent Pointer...........................................[OnRequest]
+ - TCP Options......................................................[MustHave]
+
+* Custom UDP packet generation........................................[MustHave] [DONE]
+ - Source / Dest ports .............................................[MustHave] [DONE]
+ - Incorrect length................................................[OnRequest] [DONE]
+ - Invalid checksum.................................................[MustHave] [DONE]
+
++------------------------+
+| APPLICATION LAYER |
++------------------------+
+* Custom DNS request generation......................................[CouldHave]
+* HTTP request generation............................................[CouldHave]
+
+
++------------------------+
+| Nping ECHO SERVER |
++------------------------+
+* Encrypted communications symmetrict encryption......................[MustHave]
+* Use of covert channels to transfer information back
+ to the nping client................................................[CouldHave]
+* Echo back layers link+net+transport+payload
+* Echo back layers net+transport+payload
+* Echo back layerstransport+payload
+* Echo back only payload
+
+
+
++------------------------+
+| MISCELLANEOUS |
++------------------------+
+* Traceroute mode.....................................................[MustHave] [DONE]
+ - Traceroute to a TCP port..........................................[MustHave] [DONE]
+ - Traceroute to a UDP port..........................................[MustHave] [DONE]
+* Nmap style packet output............................................[MustHave] [DONE]
+* Provide useful stats................................................[MustHave]
+* Save responses in a pcap file......................................[CouldHave]
+* Implement student's t test to compare data-sets of timing
+ information as in QSCAN............................................[CouldHave]
+* Support for multiple target IPs.....................................[MustHave] [DONE]
+* Support for multiple target ports...................................[MustHave] [DONE]
+
+
+
+
+
+
+
+
+
+
diff --git a/nping/nping-dev/PacketDiff_RFC.txt b/nping/nping-dev/PacketDiff_RFC.txt
new file mode 100644
index 0000000..adca767
--- /dev/null
+++ b/nping/nping-dev/PacketDiff_RFC.txt
@@ -0,0 +1,538 @@
+/*****************************************************************************
+ * *
+ * o *
+ * o *
+ * o *
+ * o o *
+ * o o *
+ * o o *
+ * o o o *
+ * o o o *
+ * 888b 888 o o o *
+ * 8888b 888 o o o *
+ * 88888b 888 o o o *
+ * 888Y88b 888 o *
+ * 888 Y88b888 o *
+ * 888 Y88888 *
+ * 888 Y8888 *
+ * 888 Y888 *
+ * *
+ * *
+ * *
+ * --[PACKET DIFF]-- *
+ * --[Survey/Request for Comments.]-- *
+ * *
+ * *
+ * June 2010. *
+ * *
+ * Luis MartinGarcia *
+ * (luis.mgarc@gmail.com) *
+ * *
+ *****************************************************************************/
+
+ S!=R : Sent value differs from received value
+ S>R : Sent value is higher than received value
+ S<R : Sent value is lower than received value
+ S==R : Sent value equals received value
+
+
+ 1. IP VERSION 4
+
+ +=====================+======+================================================
+ | Version | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Header Length | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Type of Service | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Total Length | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Identification | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Don't Fragment Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | More Fragments Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Evil bit Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Fragment Offset | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Time To Live | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Protocol | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Header Checksum | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Source Address | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Destination Address | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | IP Options | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
+
+ 2. IP VERSION 6
+
+ +=====================+======+================================================
+ | Version | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Traffic Class | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Flow Label | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Payload Length | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Next Header | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Hop Limit | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Source Address | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Destination Address | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
+
+
+ 3. TCP
+
+ +=====================+======+================================================
+ | Source Port | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Destination Port | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Sequence Number | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Ack. Number | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Offset | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Reserved field | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | CWR Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ECN Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | URG Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ACK Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | PSH Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | RST Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | SYN Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | FIN Flag | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Window size | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Checksum | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Urgent Pointer | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | TCP Options | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
+ 4. UDP
+
+ +=====================+======+================================================
+ | Source Port | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Destination Port | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Length | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Checksum | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
+ 5. ICMPv4
+
+ +=====================+======+================================================
+ | Type | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Code | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Checksum | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+=======================================================
+ | === ADDITIONAL COMMENTS ON SPECIFIC ICMPv4 TYPES ==== |
+ +=====================+=======================================================
+ | Echo |
+ | |
+ | |
+ +=====================+=======================================================
+ | Destination |
+ | Unreachable |
+ | |
+ +=====================+=======================================================
+ | Source Quench |
+ | |
+ | |
+ +=====================+=======================================================
+ | Redirect |
+ | |
+ | |
+ +=====================+=======================================================
+ | Router |
+ | Advertisement |
+ | |
+ +=====================+=======================================================
+ | Router Solicitation |
+ | |
+ | |
+ +=====================+=======================================================
+ | Time Exceeded |
+ | |
+ | |
+ +=====================+=======================================================
+ | Parameter Problem |
+ | |
+ | |
+ +=====================+=======================================================
+ | Timestamp |
+ | |
+ | |
+ +=====================+=======================================================
+ | Information |
+ | |
+ | |
+ +=====================+=======================================================
+ | Address Mask |
+ | |
+ | |
+ +=====================+=======================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
+
+ 6. ICMPv6
+
+ +=====================+======+================================================
+ | Type | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Code | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Checksum | S!=R |
+ | +------+------------------------------------------------
+ | | S>R |
+ | +------+------------------------------------------------
+ | | S<R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+=======================================================
+ | === ADDITIONAL COMMENTS ON SPECIFIC ICMPv6 TYPES ==== |
+ +=====================+=======================================================
+ | Destination |
+ | Unreachable |
+ | |
+ +=====================+=======================================================
+ | Packet Too Big |
+ | |
+ | |
+ +=====================+=======================================================
+ | Time Exceeded |
+ | |
+ | |
+ +=====================+=======================================================
+ | Parameter Problem |
+ | |
+ | |
+ +=====================+=======================================================
+ | Echo |
+ | |
+ | |
+ +=====================+=======================================================
+ | Router Solicitation |
+ | |
+ | |
+ +=====================+=======================================================
+ | Router Advertisement|
+ | |
+ | |
+ +=====================+=======================================================
+ | Neighbor |
+ | Solicitation |
+ | |
+ +=====================+=======================================================
+ | Neighbor |
+ | Advertisement |
+ | |
+ +=====================+=======================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
+
+ 6. Ethernet
+
+ +=====================+======+================================================
+ | Destination MAC | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Source MAC | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | Type | S!=R |
+ | +------+------------------------------------------------
+ | | S==R |
+ +=====================+======+================================================
+ | ADDITIONAL COMMENTS |
+ | |
+ | |
+ +=====================+=======================================================
+
+
diff --git a/nping/nping-dev/README b/nping/nping-dev/README
new file mode 100644
index 0000000..179157b
--- /dev/null
+++ b/nping/nping-dev/README
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * *
+ * o *
+ * o *
+ * o *
+ * o o *
+ * o o *
+ * o o *
+ * o o o *
+ * o o o *
+ * 888b 888 o o o *
+ * 8888b 888 o o o *
+ * 888Y88b 888 o o o *
+ * 888Y88b 888 o *
+ * 888 Y88b888 o *
+ * 888 Y88888 *
+ * 888 Y8888 *
+ * 888 Y888 *
+ * *
+ * --[NPING-DEV README FILE]-- *
+ * *
+ *****************************************************************************/
+
+ The nping-dev directory contains some text files and simple scripts
+ which are useful for specific development tasks, such as generating
+ getters and setters for various classes, run Nping's test battery, etc.
+ It also contains some internal development documents that are still in
+ the draft state.
+
+ Altough the contents of the directory may only be useful for a few
+ developers, the files are kept public. However, the files are not
+ intended to be used by end-users and therefore, may contain bugs or
+ inaccurate information.
+
+
+
+
+
+
+
diff --git a/nping/nping-dev/configFiles.txt b/nping/nping-dev/configFiles.txt
new file mode 100644
index 0000000..a5a2b5f
--- /dev/null
+++ b/nping/nping-dev/configFiles.txt
@@ -0,0 +1,12 @@
+These are the configure-related files that need to be distributed with Nping:
+
+configFiles.txt
+config.guess
+config.sub
+configure
+configure.ac
+depcomp
+ltmain.sh
+Makefile.in
+missing
+shtool
diff --git a/nping/nping-dev/do_valgrind.sh b/nping/nping-dev/do_valgrind.sh
new file mode 100755
index 0000000..ef13291
--- /dev/null
+++ b/nping/nping-dev/do_valgrind.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+reset && sudo valgrind --leak-check=full --show-reachable=yes --track-fds=yes --read-var-info=yes --sim-hints=lax-ioctls --track-origins=yes --malloc-fill=aa --suppressions=valgrind_supress.txt -v -v $1 $2 $3 $4 $5 $6 $7 $8 $9
diff --git a/nping/nping-dev/echo_proposal.txt b/nping/nping-dev/echo_proposal.txt
new file mode 100644
index 0000000..336202d
--- /dev/null
+++ b/nping/nping-dev/echo_proposal.txt
@@ -0,0 +1,222 @@
+
+
+ NPING NEW ECHO MODE PROPOSAL
+ June 2010
+
+ Luis MartinGarcia
+ (luis.mgarc@gmail.com)
+
+
+ TABLE OF CONTENTS
+
+ 0x01. Introduction
+ 0x02. Input
+ 0x03. Output
+ 0x04. Results
+ 0x05. Protocol
+
+== 0x01: INTRODUCTION ==
+
+ Troubleshooting routing and firewall issues is a common task nowadays.
+ The scenario is generally that some network traffic should be flowing
+ but isn't. The causes of problem can range from routing issues to
+ network firewall to host-based firewalls to all sorts of other strange
+ things. It is usually the "middle box" problem that is the hardest to
+ find.
+
+ Suppose there is some host with a TCP service listening that you can't
+ connect to for an unknown reason. If a Nmap -sS scan doesn't show the
+ port as open there are a multitude of possible problems. Maybe the SYN
+ packet never made it because of some firewall in the middle. Maybe the
+ SYN did make it but the SYN+ACK got dropped on it's way back to you.
+ Maybe the TTL expired in transit but the ICMP message got blocked by
+ another firewall before making it back to you. Maybe the SYN made it
+ but some intermediate host forged a reset packet to snipe the connection
+ before the SYN+ACK made it back to you.
+
+ When things like the above are going on, it is often the case that one
+ has to turn to Wireshark/tcpdump on one station and Nping on the other.
+ However, this is usually difficult to coordinate, specially when the
+ person at the remote host does not even know what an IP address is.
+
+ To solve this problem, Nping will have a new mode, called "Echo mode"
+ that will give it the power of a combination like hping + tcpdump.
+ This echo mode turns Nping into a client/server application. One station
+ runs Nping in server mode and the other in client mode. The way it works
+ is: the Nping client performs an initial handshake with the server over some
+ standard port (creating a side-channel). Then it notifies the server
+ what packets are about to be sent. The server sets up a liberal BPF
+ filter that captures those packets, and starts listening. When the server
+ receives a packet it encapsulates it into a packet of our own protocol,
+ the Nping Echo Protocol (NEP), and sends it back to the client.
+ This would be essentially like running tcpdump on the remote machine
+ and having it report back the packets you sent to it with Nping.
+
+ By having the side-channel to talk to the server, things like NAT would
+ become immediately apparent because you'd see your source IP (and
+ sometimes port) change. Things like "packet shapers" that change TCP
+ window sizes transparently between hosts would turn up. It would be
+ easy to tell if the traffic is being dropped in transit and never gets
+ to the box. It would also be easy to tell if the traffic does make it
+ to the box but the reply never makes it back to you.
+
+ In general, it would be like sending a postal package to someone and
+ having them email you a photo of the package when they get it. If you
+ think your packages are being abused by the parcel service then having
+ someone on the other end to send information back is a great way to
+ uncover what is going on.
+
+
+
+== 0x02: INPUT ==
+
+ From a user's perpective, this new mode would be set up from the command line.
+ Here's a possible interface:
+
+ SERVER
+ Users may start the server, using the default parameters, running:
+ nping --echo-server "Squemmish Ossifrage"
+
+ where the parameter passed to the --echo-server argument is the passphrase
+ that is used to derive encryption keys.
+
+ Obvioulsy it would be possible to override defaults running something like:
+ nping --echo-server "SquemmishOssifrage" --echo-port 9999 -vvv
+
+ CLIENT
+
+ Users would need to supply "--echo-client <passphrase>" and the usual
+ parameters used in Nping's normal operation mode.
+
+ For example, the next command tells nping to connect to the echo server at
+ echo.insecure.org, and send one TCP-SYN packet to the echo server.
+
+ nping --echo-client "SquemmishOssifrage" --tcp --flags syn --win 0 -c1 echo.insecure.org
+
+== 0x03: OUTPUT ==
+
+ About the output, Nping will print three types of packets: sent packets,
+ received reply packets, and echoed packets received through the side channel.
+ For captured packets, only the fields that differ from the original packet will
+ be displayed. This makes it easier to spot the fields that changed in transit.
+ Here's a sample output.
+
+ SENT (0.0980s) TCP 192.168.1.99:33856 > 74.207.254.18:80 S ttl=64 id=60467 iplen=40 seq=1754993861 win=0
+ CAPT (0.4504s) TCP 10.1.2.158:33856 > 10.0.23.56:80 ttl=53
+ RCVD (0.1000s) TCP 74.207.254.18:80 > 192.168.1.99:33856 SA ttl=128 id=11746 iplen=44 seq=3230736912 win=16384 <mss 1460>
+
+ Output would be more detailed if verbosity mode is incremented. For example,
+ the IP checksum, which is expected to change in virtually all cases (as it is
+ recomputed in transit for every TTL decrement operation), would only be printed
+ when the level of verbosity is higher than the default. Here's another example:
+
+ SENT (0.0760s) TCP [192.168.1.99:33856 > 74.207.254.18:80 S seq=3835079997 ack=0 off=5 res=0 win=0 csum=0x807E urp=0] IP [ver=4 ihl=5 tos=0x00 iplen=40 id=63460 foff=0 ttl=64 proto=6 csum=0x2d6b]
+ CAPT (0.4504s) TCP [10.1.2.158:33856 > 10.0.23.56:80 csum=34fd] [IP ttl=53 csum=f43d]
+ RCVD (0.0850s) TCP [74.207.254.18:80 > 192.168.1.99:18367 SA seq=507544695 ack=3835079998 off=6 res=0 win=16384 csum=0x85F9 urp=0 <mss 1460>] IP [ver=4 ihl=5 tos=0x00 iplen=44 id=17102 foff=0 ttl=128 proto=6 csum=0xa27d]
+
+ Note that the displayed time for the CAPT packet is higher than RCVD's. This is
+ because Nping will hold the RCVD packet information until it gets the echoed
+ packet. The reason for this behaviour is that it may be less confusing for end
+ users to see the differences between the SENT and the CAPT packets if they
+ are printed one after the other. Typically, network stacks will respond to
+ SENT packets before the Nping Server has time to capture them, encapsulate them
+ in a Nping Echo Protocol message and send them back to the client, so in order
+ to display SENT and CAPT packets together, the RCVD output needs to be delayed
+ for a bit.
+
+== 0x04: RESULTS ==
+
+ Apart from displaying the packets that were sent and the ones that were
+ captured, Nping should, if possible, give hints about what may have happened
+ in transit. For example, if the original source address does not match the
+ source address of the received packet, Nping could inform that with high
+ probability there is a NAT device close to the client. Nping could detect
+ things like variation of TCP window size and warn about possible transparent
+ proxies, etc.
+
+ Starting Nping 0.5.30BETA1 ( https://nmap.org/nping ) at 2010-06-30 17:20 CEST
+
+ SENT (0.0980s) TCP 192.168.1.99:33856 > 74.207.254.18:80 S ttl=64 id=60467 iplen=40 seq=1754993861 win=0
+ CAPT (0.4504s) TCP 10.1.2.158:33856 > 10.0.23.56:80 ttl=53
+ RCVD (0.1000s) TCP 74.207.254.18:80 > 192.168.1.99:33856 SA ttl=128 id=11746 iplen=44 seq=3230736912 win=16384 <mss 1460>
+
+ Packet Echo Analysis:
+ |_Source IP and Destination IP differ: possible NAT device on both ends.
+ |_TTL values differ by 11 units. Network distance between both hosts: 11 hops.
+
+ Max rtt: 8.509ms | Min rtt: 8.509ms | Avg rtt: 8.509ms
+ Raw packets sent: 1 (40B) | Rcvd: 1 (46B) | Lost: 0 (0.00%)
+ Echoed packets recv: 1 (40B) | Lost: 0 (0.00%)
+ Tx time: 0.00020s | Tx bytes/s: 202020.20 | Tx pkts/s: 5050.51
+ Rx time: 0.99984s | Rx bytes/s: 46.01 | Rx pkts/s: 1.00
+ Nping done: 1 IP address pinged in 1.08 seconds
+
+
+
+== 0x05: PROTOCOL ==
+
+ The side channel will be run over a custom application layer protocol called
+ NEP, Nping Echo Protocol. The protocol itself is described in a separate
+ document: "Nping Echo Protocol Specification", available from:
+ <https://nmap.org/svn/nping/nping-dev/EchoProtoRFC.txt>
+
+ The following flow diagram describes a typical client/server interaction.
+ Please refer to the document cited above for more information.
+
+
+ C S
+ | |
+ | TCP Handshake |
+Establish regular TCP |------------------------->|
+connection |<-------------------------|
+ |------------------------->|
+ | |
+ | |
+ | |
+Check that both | |
+understand each other | NEP Handshake and Auth |
+and authenticate the |<------------------------>|
+client |<------------------------>|
+ |<------------------------>|
+ | |
+ | |
+ | |
+Client tells the server | PacketType={IP/TCP/Syn} |
+which kind of packet is |------------------------->|
+going so send | | S
+ | | | /* Server starts */
+ | | | /* capturing packets*/
+ | ServerReadyToGo | | /* here. */
+Server indicates its |<-------------------------| |
+sniffing engine is | | |
+readty to capture the | C | |
+packet | | | |
+ | | | |
+ | | | |
+ | | | |
+Client sends the pkt | | IP/TCP/Syn Packet | |
+via raw sockets | |---------------------------->|
+ | | | | /* Server receives */
+ | | | /* the packet */
+ | Echo of the packet |....|
+Server echoes the |<-------------------------|
+packet via the NEP | |
+session they have. | . |
+ | . |
+ | . |
+ | More raw pkt/echo |
+ | exchanges |
+ | . |
+ | . |
+ | . |
+ | |
+ | |
+ | TCP Connection Close |
+TCP connection closed |<------------------------>|
+ | |
+
+
+
+
+
+
diff --git a/nping/nping-dev/nping_logo.svg b/nping/nping-dev/nping_logo.svg
new file mode 100644
index 0000000..6a09239
--- /dev/null
+++ b/nping/nping-dev/nping_logo.svg
@@ -0,0 +1,483 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="nping_logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="6.1230318e-14 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective2447"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="309.48108"
+ inkscape:cy="704.77458"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1280"
+ inkscape:window-height="725"
+ inkscape:window-x="0"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#bd0606;stroke-width:4.31242752;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3428"
+ width="701.0907"
+ height="763.94788"
+ x="23.740343"
+ y="17.531111"
+ ry="59.213264"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <text
+ xml:space="preserve"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Big Fish Ensemble;-inkscape-font-specification:Big Fish Ensemble"
+ x="66.428574"
+ y="815.57648"
+ id="text3583"><tspan
+ sodipodi:role="line"
+ x="66.428574"
+ y="815.57648"
+ id="tspan3587" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Big Fish Ensemble;-inkscape-font-specification:Big Fish Ensemble"
+ x="-76.071426"
+ y="798.79077"
+ id="text3617"><tspan
+ sodipodi:role="line"
+ id="tspan3619" /></text>
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.97787613"
+ d="M 346.11767,231.61256 L 315.76057,509.6483 L 321.65347,509.8268 L 347.18917,257.68398 L 390.93917,507.3268 L 402.36767,508.2197 L 346.11767,231.61256 z"
+ id="path3696"
+ sodipodi:nodetypes="ccccccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.57605267;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 355.37617,284.13987 L 340.16287,300.78167 L 355.37617,284.13987 z"
+ id="path3698"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 356.92127,298.39827 L 341.02847,315.89827 L 356.92127,298.39827 z"
+ id="path3700"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.48236418;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 358.89617,314.59302 L 337.93747,336.6678 L 358.89617,314.59302 z"
+ id="path3702"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.5564518;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 341.67097,282.88006 L 356.63587,299.54146 L 341.67097,282.88006 z"
+ id="path3704"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 340.67127,298.04112 L 356.56417,315.54112 L 340.67127,298.04112 z"
+ id="path3706"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3.48010445;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 339.94527,317.06957 L 362.46877,337.58411 L 339.94527,317.06957 z"
+ id="path3708"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.55294704;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 362.84747,336.64616 L 335.10227,365.15036 L 362.84747,336.64616 z"
+ id="path3710"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.82523584;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 337.38127,339.10373 L 368.06847,368.04993 L 337.38127,339.10373 z"
+ id="path3712"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:6.27009726;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 368.06037,367.32617 L 329.53227,406.25607 L 368.06037,367.32617 z"
+ id="path3714"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:6.86690807;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 333.22347,368.33887 L 376.15477,410.24338 L 333.22347,368.33887 z"
+ id="path3716"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8.38511753;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 375.39567,413.38368 L 323.44687,465.01999 L 375.39567,413.38368 z"
+ id="path3718"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:9.15460873;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 328.36287,414.23719 L 389.76537,466.30936 L 328.36287,414.23719 z"
+ id="path3720"
+ sodipodi:nodetypes="ccc"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <g
+ id="g3722"
+ inkscape:transform-center-x="-46.938085"
+ inkscape:transform-center-y="5.8727482"
+ transform="matrix(-0.9561303,-0.2929416,-0.2929416,0.9561303,609.30357,9.976981)"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ inkscape:transform-center-y="-10.657344"
+ inkscape:transform-center-x="52.212657"
+ transform="matrix(-0.981146,-0.1420945,-0.1644879,1.1357697,394.1361,-27.319471)"
+ d="M 213.86119,236.41686 C 243.98514,254.69207 253.88789,295.14233 235.61268,325.26628 C 234.16521,327.65221 232.56317,329.94427 230.81985,332.12341"
+ sodipodi:t0="0.34"
+ sodipodi:argument="-1.901365"
+ sodipodi:radius="64.68132"
+ sodipodi:revolution="0.41"
+ sodipodi:expansion="0"
+ sodipodi:cy="291.71732"
+ sodipodi:cx="180.31223"
+ id="path3724"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ <path
+ inkscape:transform-center-y="-7.6342974"
+ inkscape:transform-center-x="36.87777"
+ transform="matrix(-0.9887583,-3.005889e-2,-3.5626382e-2,1.1718956,358.05093,-58.695365)"
+ d="M 192.99402,260.01576 C 210.26289,266.92395 218.92197,287.13025 212.01378,304.39911 C 211.46662,305.76687 210.83085,307.09913 210.11173,308.38483"
+ sodipodi:t0="0.34"
+ sodipodi:argument="-2.066134"
+ sodipodi:radius="34.144054"
+ sodipodi:revolution="0.41"
+ sodipodi:expansion="0"
+ sodipodi:cy="291.71732"
+ sodipodi:cx="180.31223"
+ id="path3726"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ <path
+ inkscape:transform-center-y="-5.3503359"
+ inkscape:transform-center-x="27.550509"
+ transform="matrix(-0.9733676,-5.6158863e-2,-7.2823914e-2,1.2622128,362.79644,-82.402223)"
+ d="M 184.75363,279.85956 C 191.76321,282.55406 195.36959,290.66437 192.67508,297.67395 C 192.46167,298.22913 192.21228,298.77047 191.92899,299.29347"
+ sodipodi:t0="0.34"
+ sodipodi:argument="-2.0796833"
+ sodipodi:radius="13.785899"
+ sodipodi:revolution="0.41"
+ sodipodi:expansion="0"
+ sodipodi:cy="292.72748"
+ sodipodi:cx="179.80716"
+ id="path3728"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ </g>
+ <g
+ id="g3730"
+ inkscape:transform-center-x="46.938085"
+ inkscape:transform-center-y="5.8727482"
+ transform="matrix(0.9561303,-0.2929416,0.2929416,0.9561303,83.38406,9.774501)"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ inkscape:transform-center-y="-10.657344"
+ inkscape:transform-center-x="52.212657"
+ transform="matrix(-0.981146,-0.1420945,-0.1644879,1.1357697,394.1361,-27.319471)"
+ d="M 213.86119,236.41686 C 243.98514,254.69207 253.88789,295.14233 235.61268,325.26628 C 234.16521,327.65221 232.56317,329.94427 230.81985,332.12341"
+ sodipodi:t0="0.34"
+ sodipodi:argument="-1.901365"
+ sodipodi:radius="64.68132"
+ sodipodi:revolution="0.41"
+ sodipodi:expansion="0"
+ sodipodi:cy="291.71732"
+ sodipodi:cx="180.31223"
+ id="path3732"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ <path
+ inkscape:transform-center-y="-7.6342974"
+ inkscape:transform-center-x="36.87777"
+ transform="matrix(-0.9887583,-3.005889e-2,-3.5626382e-2,1.1718956,358.05093,-58.695365)"
+ d="M 192.99402,260.01576 C 210.26289,266.92395 218.92197,287.13025 212.01378,304.39911 C 211.46662,305.76687 210.83085,307.09913 210.11173,308.38483"
+ sodipodi:t0="0.34"
+ sodipodi:argument="-2.066134"
+ sodipodi:radius="34.144054"
+ sodipodi:revolution="0.41"
+ sodipodi:expansion="0"
+ sodipodi:cy="291.71732"
+ sodipodi:cx="180.31223"
+ id="path3734"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ <path
+ inkscape:transform-center-y="-5.3503359"
+ inkscape:transform-center-x="27.550509"
+ transform="matrix(-0.9733676,-5.6158863e-2,-7.2823914e-2,1.2622128,362.79644,-82.402223)"
+ d="M 184.75363,279.85956 C 191.76321,282.55406 195.36959,290.66437 192.67508,297.67395 C 192.46167,298.22913 192.21228,298.77047 191.92899,299.29347"
+ sodipodi:t0="0.34"
+ sodipodi:argument="-2.0796833"
+ sodipodi:radius="13.785899"
+ sodipodi:revolution="0.41"
+ sodipodi:expansion="0"
+ sodipodi:cy="292.72748"
+ sodipodi:cx="179.80716"
+ id="path3736"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ </g>
+ <path
+ sodipodi:type="arc"
+ style="fill:none;fill-opacity:1;stroke:#000808;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3738"
+ sodipodi:cx="-330"
+ sodipodi:cy="843.79077"
+ sodipodi:rx="121.42857"
+ sodipodi:ry="117.14286"
+ d="M -208.57143,843.79077 A 121.42857,117.14286 0 1 1 -451.42857,843.79077 A 121.42857,117.14286 0 1 1 -208.57143,843.79077 z"
+ transform="matrix(1.6069176,0,0,0.988878,909.44047,-210.22791)"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 351.55507,229.46136 L 338.29607,214.99708 L 338.29607,231.91672 L 336.68897,231.60422 L 336.71127,233.99261 L 341.86757,234.05958 L 341.95687,232.58636 L 341.15327,232.40779 L 341.10857,220.26493 L 353.51937,234.05958 L 352.98357,217.40779 L 355.92878,216.96137 L 355.73165,214.37208 L 348.29607,215.66672 L 348.85037,217.99066 C 348.85037,217.99066 348.86657,217.99805 351.31717,217.78277"
+ id="path3742"
+ sodipodi:nodetypes="cccccccccccccccs"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3740"
+ width="474.47919"
+ height="214.71881"
+ x="14.132828"
+ y="597.36389"
+ ry="57.3451"
+ transform="matrix(0.9806229,-0.1959049,0.1476958,0.9890328,0,0)"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <g
+ id="g3744"
+ transform="matrix(1.5381724,0,0,1.5381724,232.78947,-668.58165)"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ sodipodi:nodetypes="cccccccccccccccs"
+ id="path3746"
+ d="M 41.696422,795.64342 L 28.437492,781.17914 L 28.437492,798.09878 L 26.830352,797.78628 L 26.852672,800.17467 L 32.008922,800.24164 L 32.098212,798.76842 L 31.294632,798.58985 L 31.249992,786.44699 L 43.660712,800.24164 L 43.124992,783.58985 L 45.312502,783.14343 L 45.178562,780.55414 L 38.437492,781.84878 L 38.991702,784.17272 C 38.991702,784.17272 39.007962,784.18011 41.458542,783.96483"
+ style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <g
+ transform="matrix(0.882353,0,0,1,-9.9504214,-11.800104)"
+ id="g3748">
+ <path
+ style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 66.562501,792.76396 L 67.767857,810.13004 L 66.473215,810.08539 L 66.607143,812.04968 L 71.25,812.11665 L 71.22768,810.26397 L 70.089286,810.21932 L 69.866072,804.72825 L 73.794643,804.46039 L 75.825894,804.3153 L 76.796876,804.2037 L 77.723215,804.11441 L 78.214286,804.02513 L 78.917411,803.76843 L 80.223215,803.16575 L 81.517856,802.40682 L 82.142856,801.69254 L 82.767856,800.75504 L 83.169646,799.59432 L 83.124996,798.07646 L 82.901786,796.96039 L 82.142856,795.26396 L 80.892858,794.19254 L 79.241072,793.29968 L 77.589286,792.76396 L 75.758929,792.49611 L 73.794643,792.49611 L 72.544643,792.45146 L 71.026786,792.49611 L 66.562501,792.76396 z"
+ id="path3750"
+ sodipodi:nodetypes="cccccccccccccccccccccccccccccc" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 69.330357,795.30861 L 73.705357,794.99611 L 75.535714,794.95147 L 77.5,795.21933 L 78.919197,796.31022 L 79.583214,797.44935 L 79.705893,798.75838 L 79.346875,799.55328 L 78.72,800.57288 L 77.8125,801.29076 L 76.116071,801.51397 L 73.526786,801.60326 L 69.642857,801.78183 L 69.330357,795.30861 z"
+ id="path3752"
+ sodipodi:nodetypes="cccccccccccccc" />
+ </g>
+ <path
+ sodipodi:nodetypes="ccccccccccccc"
+ id="path3754"
+ d="M 68.683323,799.0736 L 67.507483,799.19386 L 67.768153,800.89279 L 72.076183,800.85931 L 72.145118,798.79756 L 70.600583,798.93061 L 71.183323,782.51109 L 72.388683,782.44413 L 71.942253,780.63609 L 67.321713,780.56913 L 66.897613,782.82359 L 68.326183,782.77895 L 68.683323,799.0736 z"
+ style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccccccccccccccccs"
+ id="path3758"
+ d="M 92.554618,794.98964 L 81.104488,782.18203 L 78.938545,782.1325 L 78.938545,799.27535 L 77.487655,799.59902 L 77.353725,801.12803 L 82.777832,801.15036 L 82.911765,798.73964 L 81.751042,798.91821 L 81.751045,787.40035 L 93.418412,801.00958 L 94.715875,801.0103 L 93.543954,784.27642 L 95.628852,784.36358 L 95.80275,781.5075 L 89.410565,781.07825 L 89.492755,783.71002 L 91.856983,783.97416"
+ style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccccccccczzzzzzzzscszzzssszcszzcczzzzzzzzzzzzzzzzzszzzcccc"
+ id="path3760"
+ d="M 109.94156,796.60971 L 109.7679,791.89014 L 118.78032,791.83961 L 120.04309,808.41587 L 121.14794,808.52636 L 121.14794,810.42039 L 115.81307,810.43618 L 116.06561,808.02128 L 117.56505,808.1949 L 117.01263,801.84988 C 117.01263,801.84988 115.78041,802.67864 115.24486,802.92317 C 114.70931,803.1677 114.08364,803.34419 113.47709,803.49138 C 112.87054,803.63857 111.85266,803.83684 111.20425,803.87018 C 110.55584,803.90352 109.8241,803.8627 109.18395,803.74392 C 108.5438,803.62514 107.5526,803.3035 106.97424,803.04944 C 106.39588,802.79538 105.84662,802.44159 105.33274,802.10242 C 104.81886,801.76325 104.0978,801.23029 103.56497,800.77659 C 103.03214,800.32289 102.22976,799.58078 101.7972,799.07196 C 101.36464,798.56314 100.96719,798.0373 100.66078,797.43046 C 100.35437,796.82362 100.04677,795.70459 99.840035,795.03135 C 99.633295,794.3581 99.396225,793.68857 99.271825,792.94791 C 99.147425,792.20725 99.079075,790.91383 99.082425,790.10686 C 99.085775,789.29989 99.122415,788.35436 99.271825,787.58147 C 99.421235,786.80858 99.766165,785.71662 100.09257,784.99296 C 100.41898,784.2693 100.92016,783.37799 101.4184,782.78325 C 101.91664,782.18851 102.6756,781.57077 103.37557,781.07862 C 104.07554,780.58647 105.29033,779.85835 106.09035,779.56339 C 106.89037,779.26843 107.8416,779.10651 108.61573,779.05831 C 109.38986,779.01011 110.46171,779.11183 111.20425,779.24772 C 111.94678,779.38362 112.90468,779.58082 113.54023,779.9422 C 124.96145,786.43644 115.02042,780.749 115.56053,781.14175 C 116.10064,781.5345 116.70163,782.07457 117.1389,782.53071 C 117.57617,782.98685 118.46472,784.17221 118.46472,784.17221 L 116.82322,787.20267 C 116.82322,787.20267 115.556,785.7581 115.05546,785.30863 C 114.55492,784.85916 114.04431,784.46922 113.54023,784.17221 C 113.03615,783.8752 112.41456,783.53532 111.70933,783.35146 C 111.0041,783.1676 109.55538,783.06644 108.86827,783.09892 C 108.18116,783.1314 107.79169,783.20411 107.16364,783.4146 C 106.53559,783.62509 105.38712,784.1483 104.76453,784.61415 C 104.14194,785.08 103.4247,785.86973 103.0599,786.44505 C 102.6951,787.02037 102.4824,787.75947 102.30228,788.33909 C 102.12216,788.91871 101.90071,789.68282 101.86034,790.29626 C 101.81997,790.9097 101.97887,791.85894 102.04974,792.3797 C 102.12061,792.90046 102.12422,793.29185 102.30228,793.76866 C 102.48034,794.24547 102.97903,794.999 103.31243,795.47329 C 103.64583,795.94758 104.05198,796.43669 104.51199,796.92539 C 104.972,797.41409 105.84992,798.35822 106.40603,798.69315 C 106.96214,799.02808 107.45111,799.10263 108.04752,799.26136 C 108.64393,799.42009 109.75134,799.67678 110.3835,799.70331 C 111.01566,799.72984 111.65367,799.617 112.2144,799.5139 C 112.77513,799.4108 113.57786,799.26241 114.10844,799.00883 C 114.65875,798.74582 115.39793,798.13499 115.74994,797.80927 C 116.10195,797.48355 116.38065,797.24181 116.50755,796.92539 C 116.63445,796.60897 116.56738,796.15504 116.5676,795.81837 C 116.56782,795.4817 116.38441,793.32963 116.38441,793.32963 L 112.18596,793.28857 L 112.34067,796.64128 L 109.94156,796.60971 z"
+ style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+ <flowRoot
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial;-inkscape-font-specification:Arial"
+ id="flowRoot2535"
+ xml:space="preserve"
+ transform="translate(411.42857,34.285714)"><flowRegion
+ id="flowRegion2537"><rect
+ y="866.49414"
+ x="137.38075"
+ height="133.34013"
+ width="484.87323"
+ id="rect2539" /></flowRegion><flowPara
+ id="flowPara2541" /></flowRoot> <text
+ id="text2587"
+ y="824.88239"
+ x="116.97203"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Arial;-inkscape-font-specification:Arial"
+ xml:space="preserve"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"><tspan
+ y="824.88239"
+ x="116.97203"
+ id="tspan2589"
+ sodipodi:role="line"><tspan
+ id="tspan2591"
+ y="824.88239"
+ x="116.97203">Logo designed by Luis MartinGarcia.</tspan><tspan
+ id="tspan2593"
+ y="824.88239"
+ x="442.90955"
+ dx="0" /></tspan><tspan
+ y="849.88239"
+ x="116.97203"
+ id="tspan2595"
+ sodipodi:role="line"><tspan
+ id="tspan2597"
+ y="849.88239"
+ x="116.97203" /></tspan><tspan
+ y="874.88239"
+ x="116.97203"
+ id="tspan2599"
+ sodipodi:role="line"><tspan
+ id="tspan2601"
+ y="874.88239"
+ x="116.97203">Copyright Luis MartinGarcia and Gordon Fyodor, 2009.</tspan><tspan
+ id="tspan2603"
+ y="874.88239"
+ x="604.19861"
+ dx="0" /></tspan><tspan
+ y="899.88239"
+ x="116.97203"
+ id="tspan2605"
+ sodipodi:role="line"><tspan
+ id="tspan2607"
+ y="899.88239"
+ x="116.97203" /></tspan><tspan
+ y="924.88239"
+ x="116.97203"
+ id="tspan2609"
+ sodipodi:role="line"><tspan
+ id="tspan2611"
+ y="924.88239"
+ x="116.97203">For licensing information please write to </tspan><tspan
+ id="tspan2613"
+ y="924.88239"
+ x="475.13611"
+ dx="0" /></tspan><tspan
+ y="949.88239"
+ x="116.97203"
+ id="tspan2615"
+ sodipodi:role="line"><tspan
+ id="tspan2617"
+ y="949.88239"
+ x="116.97203">fyodor@insecure.org or luis.mgarc@gmail.com</tspan></tspan></text>
+ <rect
+ style="opacity:1;fill:#ffffff;fill-opacity:0;stroke:#bd0606;stroke-width:2.54599999999999982;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3831"
+ width="485.96863"
+ height="524.54004"
+ x="108.44424"
+ y="103.66357"
+ ry="41.855164"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <g
+ id="g3634"
+ transform="matrix(0.6,0,0,0.6,-168,138.65915)"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <g
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/default/Desktop/g3762.png"
+ transform="matrix(1.5381724,0,0,1.5381724,-561.49622,-806.66689)"
+ id="g3582" />
+ </g>
+ </g>
+</svg>
diff --git a/nping/nping-dev/packetDiagram.png b/nping/nping-dev/packetDiagram.png
new file mode 100644
index 0000000..45d1dd5
--- /dev/null
+++ b/nping/nping-dev/packetDiagram.png
Binary files differ
diff --git a/nping/nping-dev/pythonscripts/TemplateGettersSetters.txt b/nping/nping-dev/pythonscripts/TemplateGettersSetters.txt
new file mode 100644
index 0000000..fca7d91
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/TemplateGettersSetters.txt
@@ -0,0 +1,25 @@
+
+/* Prototypes */
+int setMETHNAME(TYPE val);
+TYPE getMETHNAME();
+
+/** Sets METHNAME.
+ * @return OP_SUCCESS on success and OP_FAILURE in case of error. */
+int CLASSNAME::setMETHNAME(TYPE val){
+
+ this->ATTRNAME=val;
+
+ return OP_SUCCESS;
+
+} /* End of setMETHNAME() */
+
+
+/** Returns value of attribute ATTRNAME */
+TYPE CLASSNAME::getMETHNAME(){
+
+ return this->ATTRNAME;
+
+} /* End of getMETHNAME() */
+
+
+
diff --git a/nping/nping-dev/pythonscripts/TemplateNpingOps.txt b/nping/nping-dev/pythonscripts/TemplateNpingOps.txt
new file mode 100755
index 0000000..31adf3e
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/TemplateNpingOps.txt
@@ -0,0 +1,45 @@
+
+Prototypes for NpingOps:
+
+ int setMETHNAME(TYPE val);
+ TYPE getMETHNAME();
+ bool issetMETHNAME();
+
+Attributes for NpingOps:
+
+ TYPE ATTRNAME;
+ bool ATTRNAME_set;
+
+Initialization for NpingOps::NpingOps()
+
+ ATTRNAME=0;
+ ATTRNAME_set=false;
+
+
+/** Sets METHNAME.
+ * @return OP_SUCCESS on success and OP_FAILURE in case of error. */
+int NpingOps::setMETHNAME(TYPE val){
+
+ ATTRNAME=val;
+ ATTRNAME_set=true;
+
+ return OP_SUCCESS;
+
+} /* End of setMETHNAME() */
+
+
+/** Returns value of attribute ATTRNAME */
+TYPE NpingOps::getMETHNAME(){
+
+ return this->ATTRNAME;
+
+} /* End of getMETHNAME() */
+
+
+/* Returns true if option has been set */
+bool NpingOps::issetMETHNAME(){
+
+ return this->ATTRNAME_set;
+
+} /* End of issetMETHNAME() */
+
diff --git a/nping/nping-dev/pythonscripts/addGettersSetters.py b/nping/nping-dev/pythonscripts/addGettersSetters.py
new file mode 100644
index 0000000..b579471
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/addGettersSetters.py
@@ -0,0 +1,28 @@
+
+
+
+o = open("OutputGettersSetters.txt","a")
+
+classname = raw_input("Class Name: ")
+my_range = raw_input("Number of attrs: ")
+methname= []
+attrname = []
+attrtype= []
+
+for i in range( int(my_range) ):
+ methname.append( raw_input("Method Name:") )
+ attrname.append ( raw_input("Attr Name: ") )
+ attrtype.append(raw_input("Attr type:") )
+
+ for line in open("TemplateGettersSetters.txt"):
+ line = line.replace("METHNAME",methname[i])
+ line = line.replace("TYPE",attrtype[i])
+ line = line.replace("ATTRNAME",attrname[i])
+ line = line.replace("CLASSNAME",classname)
+ o.write(line)
+
+
+o.close()
+
+
+
diff --git a/nping/nping-dev/pythonscripts/addManSectionEntry.py b/nping/nping-dev/pythonscripts/addManSectionEntry.py
new file mode 100755
index 0000000..1d6c1e0
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/addManSectionEntry.py
@@ -0,0 +1,43 @@
+
+sectionname = raw_input("Section name: ")
+hyphname = raw_input("Hyphened name: ")
+
+
+o = open("OutputMan.txt","a")
+for line in open("man-section-template.xml"):
+ line = line.replace("SECTION_NAME",sectionname)
+ line = line.replace("SECTION_HYPHENED_NAME",hyphname)
+ o.write(line)
+
+
+my_range = raw_input("Number of options: ")
+optformat = []
+optarg= []
+optdesc= []
+optname= []
+
+for i in range( int(my_range) ):
+ optformat.append( raw_input("Option format (--tcp-connect): --") )
+ optarg.append ( raw_input("Option arg (portnumber): ") )
+ optdesc.append(raw_input("Option Description (TCP Connect Mode):") )
+ optname.append(raw_input("Option name (tcp connect): ") )
+
+
+ for line in open("man-section-entry-template.xml"):
+ line = line.replace("OPT_FORMAT",optformat[i])
+ if( optarg[i] == ""):
+ line = line.replace("OPT_ARG","")
+ else:
+ line = line.replace("OPT_ARG","<replaceable>"+optarg[i]+"</replaceable>")
+ line = line.replace("OPT_DESC",optdesc[i])
+ line = line.replace("OPT_NAME",optname[i])
+ o.write(line)
+
+line1=" </variablelist>"
+line2=" </refsect1>"
+o.write(line1);
+o.write(line2);
+o.close()
+
+
+
diff --git a/nping/nping-dev/pythonscripts/addNpingOpsAttr.py b/nping/nping-dev/pythonscripts/addNpingOpsAttr.py
new file mode 100755
index 0000000..5ed16d6
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/addNpingOpsAttr.py
@@ -0,0 +1,12 @@
+methname = raw_input("Method name: ")
+attrname = raw_input("Attr name: ")
+attrtype = raw_input("Attr type: ")
+
+
+o = open("Output.txt","a")
+for line in open("TemplateNpingOps.txt"):
+ line = line.replace("ATTRNAME",attrname)
+ line = line.replace("METHNAME",methname)
+ line = line.replace("TYPE",attrtype)
+ o.write(line)
+o.close()
diff --git a/nping/nping-dev/pythonscripts/man-section-entry-template.xml b/nping/nping-dev/pythonscripts/man-section-entry-template.xml
new file mode 100644
index 0000000..e61a3f0
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/man-section-entry-template.xml
@@ -0,0 +1,25 @@
+ <varlistentry>
+ <term>
+ <option>--OPT_FORMAT OPT_ARG</option> (OPT_DESC)
+ <indexterm significance="preferred"><primary><option>--OPT_FORMAT</option></primary></indexterm>
+ <indexterm significance="normal"><primary>OPT_NAME</primary></indexterm>
+ </term>
+ <listitem>
+
+
+<para> blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah.</para>
+
+ </listitem>
+ </varlistentry>
diff --git a/nping/nping-dev/pythonscripts/man-section-template.xml b/nping/nping-dev/pythonscripts/man-section-template.xml
new file mode 100644
index 0000000..ab41467
--- /dev/null
+++ b/nping/nping-dev/pythonscripts/man-section-template.xml
@@ -0,0 +1,34 @@
+
+ <refsect1 id="man-SECTION_HYPHENED_NAME">
+ <title>SECTION_NAME</title>
+
+<para> blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah.</para>
+
+<para> blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah
+ blah blah blah blah blah blah blah blah blah blah blah blah.</para>
+
+ <variablelist>
+
diff --git a/nping/nping-dev/test/caps/tcpconnect_T1.cap b/nping/nping-dev/test/caps/tcpconnect_T1.cap
new file mode 100644
index 0000000..1b7c3e4
--- /dev/null
+++ b/nping/nping-dev/test/caps/tcpconnect_T1.cap
Binary files differ
diff --git a/nping/nping-dev/test/caps/tcpconnect_T2.cap b/nping/nping-dev/test/caps/tcpconnect_T2.cap
new file mode 100644
index 0000000..83eba17
--- /dev/null
+++ b/nping/nping-dev/test/caps/tcpconnect_T2.cap
Binary files differ
diff --git a/nping/nping-dev/test/caps/tcpconnect_T3.cap b/nping/nping-dev/test/caps/tcpconnect_T3.cap
new file mode 100644
index 0000000..7e0a628
--- /dev/null
+++ b/nping/nping-dev/test/caps/tcpconnect_T3.cap
Binary files differ
diff --git a/nping/nping-dev/test/test_nping.sh b/nping/nping-dev/test/test_nping.sh
new file mode 100755
index 0000000..45eac56
--- /dev/null
+++ b/nping/nping-dev/test/test_nping.sh
@@ -0,0 +1,1526 @@
+#/*****************************************************************************
+# * *
+# * o *
+# * o *
+# * o *
+# * o o *
+# * o o *
+# * o o *
+# * o o o *
+# * o o o *
+# * 888b 888 o o o *
+# * 8888b 888 o o o *
+# * 88888b 888 o o o *
+# * 888Y88b 888 o *
+# * 888 Y88b888 o *
+# * 888 Y88888 *
+# * 888 Y8888 *
+# * 888 Y888 *
+# * *
+# * --[NPING TEST SPECIFICATION]-- *
+# * *
+# *****************************************************************************/
+
+
+# This document aims to list every Nping option and option syntax, with
+# the purpose of faciliatating testing whether they all work as expected.
+
+######################################
+# RUN-TIME PARAMETER CONFIGURATION #
+######################################
+
+# Target host specification. Can be just one host or varios hosts
+# separated by whitespace
+TARGETS="scanme.nmap.org"
+
+# Global options to be passed to EVERY nping invokation. This is useful
+# to specify things like verbosity level, etc.
+GLOBALOPTS="-vvv -d1"
+
+# Port numbers required by some executions.
+OPEN_PORT="80"
+CLOSED_PORT="31337"
+FILTERED_PORT="82"
+
+# This var should be set to the name of a network interface that
+# exists on the testing system.
+EXISTING_NET_IFACE="eth0"
+
+# Internal test state variables
+CURRENT_TEST=""
+FAILED_TESTS=""
+PASSED_TESTS=""
+TOTAL_TESTS_RUN=0
+TOTAL_TESTS_PASSED=0
+TOTAL_TESTS_FAILED=0
+START_TIME=`date +"%s"`
+END_TIME=0
+ELAPSED_TIME=0
+
+
+# Ask the user whether the test was passed or failed
+request_userinput_test_status() {
+ echo -n "[+] Was the test successful? [Y/N] "
+ read TESTRESPONSE
+ # Increment total counter
+ TOTAL_TESTS_RUN=`expr $TOTAL_TESTS_RUN + 1`
+
+ if [ -z $TESTRESPONSE ]; then
+ TESTRESPONSE="y"
+ fi
+
+ if [ $TESTRESPONSE = "n" -o $TESTRESPONSE = "N" ]; then
+ FAILED_TESTS="$FAILED_TESTS$TEST_ID,"
+ TOTAL_TESTS_FAILED=`expr $TOTAL_TESTS_FAILED + 1`
+ else
+ PASSED_TESTS="$PASSED_TESTS$TEST_ID,"
+ TOTAL_TESTS_PASSED=`expr $TOTAL_TESTS_PASSED + 1`
+ fi
+}
+
+# This function runs a single test and asks for success/failure confirmation.
+# Usage: t <test_id> <test_desc> nping [args]...
+t() {
+ TEST_ID="$1"
+ TEST_DESC="$2"
+ shift
+ shift
+ echo "=======================TEST START======================="
+ echo "[+] $TEST_ID: $TEST_DESC"
+ echo "$@"
+ # The next line runs the command.
+ "$@"
+ request_userinput_test_status
+ echo "========================TEST END========================"
+ echo ""
+ echo ""
+}
+
+
+# Tests still to write.
+
+# Traceroute. (What other options are possible here?)
+# Miscellaneous.
+# |_ Include a few regular executions.
+
+
+####################
+# TEST BATTERY #
+####################
+
+
+#### PRIVILEGE DETERMINATION AND DEFAULT BEHAVIOUR ####
+
+t TCPPRIVS_1 "Test default ping as non root. Expected tcp-connect mode." \
+nping $TARGETS $GLOBALOPTS
+
+t TCPPRIVS_2 "Test default ping as root. Expected ICMP Echo ping." \
+sudo nping $TARGETS $GLOBALOPTS
+
+t TCPPRIVS_3 "Test default ping as non root (IPv6). Expected tcp-connect mode." \
+nping -6 $TARGETS $GLOBALOPTS
+
+t TCPPRIVS_4 "Test default ping as root (IPv6). Expected ICMP Echo ping." \
+sudo nping -6 $TARGETS $GLOBALOPTS
+
+
+
+#### TARGET SPECIFICATION ####
+
+t TARGETSPEC_1 "Test single target spec (hostname)." \
+sudo nping $GLOBALOPTS -c1 google.com
+
+t TARGETSPEC_2 "Test single target spec (IP address)." \
+sudo nping $GLOBALOPTS 192.168.1.1
+
+t TARGETSPEC_3 "Test multiple target spec (two hostnames)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 google.com nmap.org
+
+t TARGETSPEC_4 "Test multiple target spec (two IP addresses)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 192.168.1.1 192.168.1.99
+
+t TARGETSPEC_5 "Test multiple target spec (IP range #1)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 192.168.1.1-10
+
+t TARGETSPEC_6 "Test multiple target spec (IP range #2)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 190-191.168.1-2.99-100
+
+t TARGETSPEC_7 "Test multiple target spec (IP range + hostname)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 192.168.1.1-10 google.com
+
+t TARGETSPEC_8 "Test multiple target spec (hostname with CIDR notation)." \
+sudo nping $GLOBALOPTS -c1 --rate 100 google.com/24
+
+t TARGETSPEC_9 "Test multiple target spec (IP with CIDR notation)." \
+sudo nping $GLOBALOPTS -c1 --rate 100 192.168.1.1/24
+
+t TARGETSPEC_10 "Test multiple target spec (mixed specs)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 192.168.1.1 192.168.1.99-100 google.com/29 scanme.nmap.org
+
+t TARGETSPEC_11 "Test unresolvable target spec. Expected: error message." \
+sudo nping $GLOBALOPTS -c1 bogushostname
+
+#Bug here. If our first target is not valid, then route_dst() fails. If we specify google.com first, then it works.
+t TARGETSPEC_12a "Test unresolvable target spec (some good names and some bad ones). Expected: error message for some of the targets." \
+sudo nping $GLOBALOPTS -c1 bogushostname google.com bogushostname2 insecure.org
+
+t TARGETSPEC_12b "Test unresolvable target spec (some good names and some bad ones). Expected: error message for some of the targets." \
+sudo nping $GLOBALOPTS -c1 google.com bogushostname bogushostname2 insecure.org
+
+t TARGETSPEC_13 "Don't specify any target host. Expected: error message." \
+sudo nping $GLOBALOPTS -c1
+
+# These will all fail becasue -iL is not implemmented.
+echo "google.com" > myhostlist.tmp
+t TARGETSPEC_14 "Test single target spec with -iL (hostname)." \
+sudo nping $GLOBALOPTS -c1 -iL myhostlist.tmp
+
+echo "192.168.1.1" > myhostlist.tmp
+t TARGETSPEC_15 "Test single target spec with -iL (IP address)." \
+sudo nping $GLOBALOPTS -c1 -iL myhostlist.tmp
+
+echo "google.com nmap.org" > myhostlist.tmp
+t TARGETSPEC_16 "Test multiple target spec with -iL (two hostnames)." \
+sudo nping $GLOBALOPTS -c1 -iL myhostlist.tmp
+
+echo "192.168.1.1 192.168.1.99" > myhostlist.tmp
+t TARGETSPEC_17 "Test multiple target spec with -iL (two IP addresses)." \
+sudo nping $GLOBALOPTS -c1 -iL myhostlist.tmp
+
+echo "192.168.1.1-10 " > myhostlist.tmp
+t TARGETSPEC_18 "Test multiple target spec with -iL (IP range #1)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 -iL myhostlist.tmp
+
+echo "192.168.1.1 192.168.1.99-100 google.com/29 scanme.nmap.org" > myhostlist.tmp
+t TARGETSPEC_19 "Test multiple target spec with -iL (mixed specs)." \
+sudo nping $GLOBALOPTS -c1 --rate 10 -iL myhostlist.tmp
+
+rm -f myhostlist.tmp
+
+
+
+
+#### TCP CONNECT MODE ####
+
+t TCPCONNECT_1 "Explicit TCP-CONNECT mode specification. Expected default destination port: 80" \
+sudo nping --tcp-connect $TARGETS $GLOBALOPTS
+
+t TCPCONNECT_2 "TCP-CONNECT to an open port. Expected: Handshake complete messages." \
+sudo nping --tcp-connect -p$OPEN_PORT $TARGETS $GLOBALOPTS
+
+t TCPCONNECT_3 "TCP-CONNECT to a closed port. Expected: <<Possible TCP RST received from>> messages." \
+sudo nping --tcp-connect -p$CLOSED_PORT $TARGETS $GLOBALOPTS
+
+t TCPCONNECT_4 "TCP-CONNECT to a filtered port. Expected: Only <<Starting TCP Handshake>> messages." \
+sudo nping --tcp-connect -p$FILTERED_PORT $TARGETS $GLOBALOPTS
+
+t TCPCONNECT_5 "TCP-CONNECT with a source port, as a regular user. Expected warning message [NOT_PASSED]" \
+nping --tcp-connect -g 1000 $TARGETS $GLOBALOPTS
+
+t TCPCONNECT_6 "TCP-CONNECT with a source port, as root." \
+sudo nping --tcp-connect -g 1000 $TARGETS $GLOBALOPTS
+
+t TCPCONNECT_7 "TCP-CONNECT with the same source and target port, as root." \
+sudo nping --tcp-connect -p 1000 -g 1000 $TARGETS $GLOBALOPTS
+
+
+#### TCP MODE ####
+
+t TCP_1 "TCP default flags and port. BPF filter?" \
+sudo nping --tcp $TARGETS $GLOBALOPTS
+
+t TCP_2 "TCP open port." \
+sudo nping --tcp -p$OPEN_PORT $TARGETS $GLOBALOPTS
+
+t TCP_3 "TCP closed port." \
+sudo nping --tcp -p$CLOSED_PORT $TARGETS $GLOBALOPTS
+
+t TCP_4 "TCP filtered port." \
+sudo nping --tcp -p$FILTERED_PORT $TARGETS $GLOBALOPTS
+
+t TCP_5 "TCP source port." \
+sudo nping --tcp -g 1000 $TARGETS $GLOBALOPTS
+
+t TCP_6 "TCP source and dest port combined." \
+sudo nping --tcp -g 1000 -p1000 $TARGETS $GLOBALOPTS
+
+# Test no flags, all flags individually, all flags at once.
+t TCP_FLAG_empty "TCP flags empty string." \
+sudo nping --tcp --flags "" $TARGETS $GLOBALOPTS
+for flag in nil none cwr ecn ece urg ack psh rst syn fin all; do
+ t TCP_FLAG_$flag "TCP flags $flag." \
+ sudo nping --tcp --flags $flag $TARGETS $GLOBALOPTS
+done
+t TCP_FLAG_all_long "TCP flags cwr,ecn,ece,urg,ack,psh,rst,syn,fin." \
+sudo nping --tcp --flags cwr,ecn,ece,urg,ack,psh,rst,syn,fin $TARGETS $GLOBALOPTS
+for flag in c e u a p r s f; do
+ t TCP_FLAG_$flag "TCP flags $flag." \
+ sudo nping --tcp --flags $flag $TARGETS $GLOBALOPTS
+done
+t TCP_FLAG_all_short "TCP ceuaprsf." \
+sudo nping --tcp --flags ceuaprsf $TARGETS $GLOBALOPTS
+
+# Bogus flags.
+t TCP_7 "TCP flags ,." \
+sudo nping --tcp --flags , $TARGETS $GLOBALOPTS
+
+t TCP_8 "TCP flags dumb." \
+sudo nping --tcp --flags dumb $TARGETS $GLOBALOPTS
+
+t TCP_9 "TCP flags dumb,." \
+sudo nping --tcp --flags dumb, $TARGETS $GLOBALOPTS
+
+t TCP_10 "TCP flags 0x00." \
+sudo nping --tcp --flags 0x00 $TARGETS $GLOBALOPTS
+
+t TCP_11 "TCP flags 0xff." \
+sudo nping --tcp --flags 0xff $TARGETS $GLOBALOPTS
+
+t TCP_12 "TCP flags 0x100." \
+sudo nping --tcp --flags 0x100 $TARGETS $GLOBALOPTS
+
+t TCP_13 "TCP flags -0x11." \
+sudo nping --tcp --flags -0x11 $TARGETS $GLOBALOPTS
+
+t TCP_14 "TCP flags rand." \
+sudo nping --tcp --flags rand $TARGETS $GLOBALOPTS
+
+t TCP_15 "TCP seq decimal." \
+sudo nping --tcp --seq 12345678 $TARGETS $GLOBALOPTS
+
+t TCP_16 "TCP seq hex." \
+sudo nping --tcp --seq 0x12345678 $TARGETS $GLOBALOPTS
+
+t TCP_17 "TCP seq negative." \
+sudo nping --tcp --seq -1 $TARGETS $GLOBALOPTS
+
+t TCP_18 "TCP seq too big." \
+sudo nping --tcp --seq 10000000000 $TARGETS $GLOBALOPTS
+
+t TCP_19 "TCP seq rand." \
+sudo nping --tcp --seq rand $TARGETS $GLOBALOPTS
+
+t TCP_20 "TCP ack decimal." \
+sudo nping --tcp --ack 12345678 $TARGETS $GLOBALOPTS
+
+t TCP_21 "TCP ack hex." \
+sudo nping --tcp --ack 0x12345678 $TARGETS $GLOBALOPTS
+
+t TCP_22 "TCP ack negative." \
+sudo nping --tcp --ack -1 $TARGETS $GLOBALOPTS
+
+t TCP_23 "TCP ack too big." \
+sudo nping --tcp --ack 10000000000 $TARGETS $GLOBALOPTS
+
+t TCP_24 "TCP ack rand." \
+sudo nping --tcp --ack rand $TARGETS $GLOBALOPTS
+
+t TCP_25 "TCP win decimal." \
+sudo nping --tcp --win 1234 $TARGETS $GLOBALOPTS
+
+t TCP_26 "TCP win hex." \
+sudo nping --tcp --win 0x1234 $TARGETS $GLOBALOPTS
+
+t TCP_27 "TCP win negative." \
+sudo nping --tcp --win -1 $TARGETS $GLOBALOPTS
+
+t TCP_28 "TCP win too big." \
+sudo nping --tcp --win 70000 $TARGETS $GLOBALOPTS
+
+t TCP_29 "TCP win rand." \
+sudo nping --tcp --win rand $TARGETS $GLOBALOPTS
+
+t TCP_30 "TCP badsum." \
+sudo nping --tcp --badsum $TARGETS $GLOBALOPTS
+
+t TCP_31 "TCP mss." \
+sudo nping --tcp --mss 900 $TARGETS $GLOBALOPTS
+
+t TCP_32 "TCP ws." \
+sudo nping --tcp --ws 2 $TARGETS $GLOBALOPTS
+
+t TCP_33 "TCP ts 1234,5678." \
+sudo nping --tcp --ts 1234,5678 $TARGETS $GLOBALOPTS
+
+t TCP_34 "TCP ts rand,rand." \
+sudo nping --tcp --ts rand,rand $TARGETS $GLOBALOPTS
+
+t TCP_35 "TCP ts 1234." \
+sudo nping --tcp --ts 1234 $TARGETS $GLOBALOPTS
+
+
+
+#### UDP MODE ####
+
+# Unprivileged execution
+t UDP_UNPRIV_1 "Send UDP packet in unprivileged mode with default parameters. Expected: Packets to dport 40125 and <<UDP packet with 4 bytes>> messages." \
+nping --udp $TARGETS $GLOBALOPTS
+
+t UDP_UNPRIV_2 "Send UDP packet to custom dport. Expected: 4-byte UDP packets to port $OPEN_PORT and <<UDP packet with 4 bytes>> messages." \
+nping --udp -p $OPEN_PORT $TARGETS $GLOBALOPTS
+
+t UDP_UNPRIV_3 "Send UDP packet specifying a source port." \
+nping --udp -g 9876 $TARGETS $GLOBALOPTS
+
+t UDP_UNPRIV_4 "Send UDP packet specifying a both sport and dport." \
+nping --udp -g 9876 -p 9999 $TARGETS $GLOBALOPTS
+
+t UDP_UNPRIV_5 "Send UDP packet specifying a the same sport and dport." \
+nping --udp -g 9999 -p 9999 $TARGETS $GLOBALOPTS
+
+t UDP_UNPRIV_6 "Send UDP packet to a custom port with a custom payload. Expected: Packets to dport 9876 with 10byte payloads." \
+nping --udp -p 9876 $TARGETS $GLOBALOPTS --data-string "0123456789"
+
+
+# Privileged execution
+t UDP_PRIV_1 "Send UDP packet specifying a source port (as root). Expected: Packets to dport 40125 and sport 9876" \
+sudo nping --udp -g 9876 $TARGETS $GLOBALOPTS
+
+t UDP_PRIV_2 "Send UDP packet specifying a destination port (as root). Expected: Packets to dport $OPEN_PORT and sport 53" \
+sudo nping --udp -p$OPEN_PORT $TARGETS $GLOBALOPTS
+
+t UDP_PRIV_3 "Send UDP packet in privileged mode, speciying sport and dport. Expected: Packets to dport 33 and sport 44." \
+sudo nping --udp -p33 -g44 $TARGETS $GLOBALOPTS
+
+t UDP_PRIV_4 "Send UDP packet in privileged mode, speciying dport==sport. Expected: Packets with sport==dport==$OPEN_PORT." \
+sudo nping --udp -p$OPEN_PORT -g$OPEN_PORT $TARGETS $GLOBALOPTS
+
+t UDP_PRIV_4 "Send UDP packet in privileged mode, with a bad checksum. Expected: Packets with bad checksum. [See in wireshark]" \
+sudo nping --udp -p$OPEN_PORT --badsum $TARGETS $GLOBALOPTS
+
+
+#### ICMP MODE ####
+
+t ICMP_1 "Run icmp mode with no privileges. Expected: error message." \
+nping --icmp $TARGETS $GLOBALOPTS
+
+t ICMP_2 "Run ICMP mode with privileges. Expected: ICMP Echo packets (type=8/code=0)=to $TARGETS." \
+sudo nping --icmp $TARGETS $GLOBALOPTS
+
+t ICMP_3 "Run ICMP mode with explicit ICMP Echo especification. Expected: ICMP Echo packets (type=8/code=0)=to $TARGETS." \
+sudo nping --icmp --icmp-type echo $TARGETS $GLOBALOPTS
+
+ #sudo nping --icmp --icmp-type echo-request $TARGETS $GLOBALOPTS
+ #sudo nping --icmp --icmp-type e $TARGETS $GLOBALOPTS
+t ICMP_4 "Run ICMP mode with type Destination Unreachable." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type dest-unr
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type du
+t ICMP_5 "Run ICMP mode with type Source Quench." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type source-quench
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type sour-que
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type sq
+t ICMP_6 "Run ICMP mode with type Redirect." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redi
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type r
+t ICMP_7 "Run ICMP mode with explicit type Echo request." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo-request
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type e
+t ICMP_8 "Run ICMP mode with type Echo reply." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo-reply
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo-rep
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type er
+t ICMP_9 "Run ICMP mode with type Router Advertisement." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type router-advertisement
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type rout-adv
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra
+t ICMP_3 "Run ICMP mode with type Router Solicitation." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type router-solicitation
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type rout-sol
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type rs
+t ICMP_10 "Run ICMP mode with type time Exceeded." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type time-exceeded
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type time-exc
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type te
+t ICMP_11 "Run ICMP mode with type Parameter Problem." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type parameter-problem
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type para-pro
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type pp
+t ICMP_12 "Run ICMP mode with type Timestamp request." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type time
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type tm
+t ICMP_13 "Run ICMP mode with type Timestamp reply." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp-reply
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type time-rep
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type tr
+t ICMP_14 "Run ICMP mode with type Information request." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type information
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type info
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type i
+t ICMP_15 "Run ICMP mode with type Information reply." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type information-reply
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type info-rep
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ir
+t ICMP_16 "Run ICMP mode with type Network Mask request." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type mask-request
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type mask
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type m
+t ICMP_17 "Run ICMP mode with type Network Mask reply." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type mask-reply
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type mask-rep
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type mr
+t ICMP_18 "Run ICMP mode with type Traceroute request." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type traceroute
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type trace
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type tc
+t ICMP_19 "Run ICMP mode with type Destination Unreachable and Code Network Unreachable." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code network-unreachable
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code netw-unr
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code net
+t ICMP_20 "Run ICMP mode with type Destination Unreachable and Code Host Unreachable" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-unreachable
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-unr
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host
+t ICMP_21 "Run ICMP mode with type Destination Unreachable and Code Protocol unreachable" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code protocol-unreachable
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code prot-unr
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code proto
+t ICMP_22 "Run ICMP mode with type Destination Unreachable and Code " \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code port-unreachable
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code port-unr
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code port
+t ICMP_23 "Run ICMP mode with type Destination Unreachable and Code Needs Fragmentation" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code needs-fragmentation
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code need-fra
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code frag
+t ICMP_24 "Run ICMP mode with type Destination Unreachable and Code Source Route Failed" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code source-route-failed
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code sour-rou
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code routefail
+t ICMP_25 "Run ICMP mode with type Destination Unreachable and Code network-unknown" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code network-unknown
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code netw-unk
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code net?
+t ICMP_26 "Run ICMP mode with type Destination Unreachable and Code host-unknown" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-unknown
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-unk
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host?
+t ICMP_27 "Run ICMP mode with type Destination Unreachable and Code host-isolated" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-isolated
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-iso
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code isolated
+t ICMP_28 "Run ICMP mode with type Destination Unreachable and Code network-prohibited" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code network-prohibited
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code netw-pro
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code !net
+t ICMP_29 "Run ICMP mode with type Destination Unreachable and Code host-prohibited" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-prohibited
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-pro
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code !host
+t ICMP_30 "Run ICMP mode with type Destination Unreachable and Code network-tos" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code network-tos
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code unreachable-network-tos
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code netw-tos
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code tosnet
+t ICMP_31 "Run ICMP mode with type Destination Unreachable and Code host-tos" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-tos
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code unreachable-host-tos
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code toshost
+t ICMP_2 "Run ICMP mode with type Destination Unreachable and Code communication-prohibited" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code communication-prohibited
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code comm-pro
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code !comm
+t ICMP_32 "Run ICMP mode with type Destination Unreachable and Code host-precedence-violation" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code host-precedence-violation
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code precedence-violation
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code prec-vio
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code violation
+t ICMP_33 "Run ICMP mode with type Destination Unreachable and Code precedence-cutoff" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code precedence-cutoff
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code prec-cut
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type destination-unreachable --icmp-code cutoff
+t ICMP_34 "Run ICMP mode with type Redirect and Code redirect-network" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redirect-network
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redi-net
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code net
+t ICMP_35 "Run ICMP mode with type Redirect and Code redirect-host" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redirect-host
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redi-host
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code host
+t ICMP_36 "Run ICMP mode with type Redirect and Code redirect-network-tos" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redirect-network-tos
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redi-ntos
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redir-ntos
+t ICMP_37 "Run ICMP mode with type Redirect and Code redirect-host-tos" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redirect-host-tos
+
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redi-htos
+ #sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-code redir-htos
+t ICMP_38 "Run ICMP mode with type Router Advert and Code normal-advertisement" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type router-advertisement --icmp-code normal-advertisement
+
+t ICMP_39 "Run ICMP mode with type Router Advert and Code not-route-common-traffic" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type router-advertisement --icmp-code not-route-common-traffic
+
+t ICMP_40 "Run ICMP mode with type Time Exceeded and Code ttl-exceeded-in-transit" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type time-exceeded --icmp-code ttl-exceeded-in-transit
+
+t ICMP_41 "Run ICMP mode with type Time Exceeded and Code fragment-reassembly-time-exceeded" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type time-exceeded --icmp-code fragment-reassembly-time-exceeded
+
+t ICMP_42 "Run ICMP mode with type Parameter Problem and Code pointer-indicates-error" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type parameter-problem --icmp-code pointer-indicates-error
+
+t ICMP_43 "Run ICMP mode with type Parameter Problem and Code missing-required-option" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type parameter-problem --icmp-code missing-required-option
+
+t ICMP_44 "Run ICMP mode with type Parameter Problem and Code bad-length" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type parameter-problem --icmp-code bad-length
+
+t ICMP_45 "Run ICMP mode supplying type as an integer" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type 8
+
+t ICMP_46 "Run ICMP mode supplying type as a bogus integer. Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type 100000
+
+t ICMP_47 "Run ICMP mode supplying non-existing type. Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type bogustype
+
+t ICMP_48 "Run ICMP mode supplying a numeric type, NON-RFC compliant (<18). Expected: warning message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type 55
+
+t ICMP_49 "Run ICMP mode supplying a numeric code." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 5
+
+t ICMP_50 "Run ICMP mode supplying a bogus code." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code boguscode
+
+t ICMP_51 "Run ICMP mode supplying a number code, NON-RFC compliant." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 99
+
+t ICMP_52 "Set ICMP Identifier. (Don't get confused with output for the IP id value)" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-id 2
+
+t ICMP_53 "Set bogus Identifier. Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-id bogusid
+
+t ICMP_54 "Set negative Identifier. Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-id -99
+
+t ICMP_55 "Set out of bounds Identifier (id>(2^16)-1). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-id 65536
+
+t ICMP_56 "Set ICMP Sequence number." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-seq 22
+
+t ICMP_57 "Set bogus ICMP sequence number. Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-seq bogusseq
+
+t ICMP_58 "Set negative ICMP sequence number. Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-seq -99
+
+t ICMP_59 "Set out of bounds ICMP sequence number (seq>(2^16)-1). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-code 9 --icmp-seq 65536
+
+t ICMP_60 "Send ICMP Redirect with redirect IP=1.2.3.4." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-redirect-addr 1.2.3.4
+
+t ICMP_61 "Send ICMP Redirect with redirect IP=google.com. Expected: google.com gets resolved." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-redirect-addr google.com
+
+t ICMP_62 "Send ICMP Redirect passing a redirect IP hostname that does not resolve. Expected: error" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type redirect --icmp-redirect-addr bogushostspec
+
+t ICMP_63 "Use --icmp-redirect-addr but don't send ICMP redirect but another type. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-redirect-addr 1.2.3.4
+
+t ICMP_64 "Use --icmp-redirect-addr but don't specify ICMP type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-redirect-addr 1.2.3.4
+
+t ICMP_65 "Send ICMP Parameter problem with parameter pointer=0" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type pp --icmp-param-pointer 0
+
+t ICMP_66 "Send ICMP Parameter problem with nonzero parameter pointer" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type pp --icmp-param-pointer 128
+
+t ICMP_67 "Send ICMP Parameter problem with bogus parameter pointer. Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type pp --icmp-param-pointer boguspp
+
+t ICMP_68 "Send ICMP Parameter problem with negative parameter pointer. Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type pp --icmp-param-pointer -99
+
+t ICMP_69 "Send ICMP Parameter problem with out-of-bounds parameter pointer (pp>255). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type pp --icmp-param-pointer 256
+
+t ICMP_70 "Specify --icmp-param-pointer but use an ICMP Type != ParameterProblem. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-param-pointer 22
+
+t ICMP_71 "Specify --icmp-param-pointer but do not specify any ICMP Type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-param-pointer 15
+
+t ICMP_72 "Send ICMP Router Advertisement with advert lifetime=0" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-lifetime 0
+
+t ICMP_73 "Send ICMP Router Advertisement with a nonzero advert lifetime" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-lifetime 37556
+
+t ICMP_74 "Send ICMP Router Advertisement with a bougs advert lifetime. Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-lifetime bogusAL
+
+t ICMP_75 "Send ICMP Router Advertisement with a negative advert lifetime. Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-lifetime -56
+
+t ICMP_76 "Send ICMP Router Advertisement with an out-of-bounds (al>65535) advert lifetime. Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-lifetime 65536
+
+t ICMP_77 "Specify --icmp-advert-lifetime but use an ICMP Type != Router Advertisement. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-advert-lifetime 22
+
+t ICMP_78 "Specify --icmp-advert-lifetime but do not specify any ICMP Type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-advert-lifetime 24
+
+t ICMP_79 "Send ICMP Router Advertisement with zeroed advert entry" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 0.0.0.0,0
+
+t ICMP_80 "Send ICMP Router Advertisement with a normal preference and a zero IP" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 0.0.0.0,16777215
+
+t ICMP_81 "Send ICMP Router Advertisement with a normal advert entry" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,16777215
+
+t ICMP_82 "Send ICMP Router Advertisement with an advert entry specified as a hostname" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry google.com,16777215
+
+t ICMP_83 "Send ICMP Router Advertisement with a few advert entries" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,11111 --icmp-advert-entry 11.22.33.44,22222 --icmp-advert-entry 55.66.77.88,333333
+
+t ICMP_84 "Send ICMP Router Advertisement with bogus entry #1 (missing preference). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,
+
+t ICMP_85 "Send ICMP Router Advertisement with bogus entry #2 (IP). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry ,10
+
+t ICMP_86 "Send ICMP Router Advertisement with bogus entry #3 (missing parameter). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry
+
+t ICMP_87 "Send ICMP Router Advertisement with bogus entry #4 (unresolvable hostname). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry asdasdasdasdasd,222
+
+t ICMP_88 "Send ICMP Router Advertisement with bogus entry #5 (bad preference). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,boguspref
+
+t ICMP_89 "Send ICMP Router Advertisement with bogus entry #6 (negative preference). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,-222
+
+#This works and it should't. "5" should not be resolved to 0.0.0.5 but detected as a bad IP.
+t ICMP_90 "Send ICMP Router Advertisement with bogus entry #7 (bad IP format). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 5,222
+
+t ICMP_91 "Send ICMP Router Advertisement with bogus entry #8 (out-of-bounds IP). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 256.257.258.259,222
+
+t ICMP_92 "Send ICMP Router Advertisement with bogus entry #9 (out-of-bounds preference). Expected: error msg" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,999999999999999
+
+t ICMP_93 "Send ICMP Router Advertisement with a duplicated adevert entry. Expected: normal operation" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type ra --icmp-advert-entry 1.2.3.4,555 --icmp-advert-entry 1.2.3.4,555
+
+t ICMP_94 "Specify --icmp-advert-entry but use an ICMP type!= Router Advertisement. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-advert-entry 1.2.3.4,555
+
+t ICMP_95 "Specify --icmp-advert-entry but do not specify ICMP type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-advert-entry 1.2.3.4,555
+
+# Parameter --icmp-orig-time
+t ICMP_96 "Send ICMP Timestamp Request with zeroed originate timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time 0
+
+t ICMP_97 "Send ICMP Timestamp Request with a normal originate timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time 57509000
+
+t ICMP_98 "Send ICMP Timestamp Request with current originate timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now
+
+t ICMP_99 "Send ICMP Timestamp Request with current originate timestamp + 1 minute" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now+1m
+
+t ICMP_100 "Send ICMP Timestamp Request with current originate timestamp + 2 hours" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now+2h
+
+t ICMP_101 "Send ICMP Timestamp Request with current originate timestamp minus 200 milliseconds" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now-200ms
+
+t ICMP_102 "Send ICMP Timestamp Request with explicit positive originate timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time +10
+
+t ICMP_103 "Send ICMP Timestamp Request with negative originate timestamp. Expected: It should be ok to specify negative values" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time -10
+
+t ICMP_104 "Send ICMP Timestamp Request with bogus originate timestamp #1 (no number). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time bogusts
+
+t ICMP_105 "Send ICMP Timestamp Request with bogus originate timestamp #2 (now+bogusspec). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now+bogus
+
+t ICMP_106 "Send ICMP Timestamp Request with bogus originate timestamp #3 (now+[nothing]). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now+
+
+t ICMP_107 "Send ICMP Timestamp Request with bogus originate timestamp #4 (wrong order 1000+now). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time 1000+now
+
+t ICMP_108 "Send ICMP Timestamp Request with originate timestamp but specify ICMP Type!=Timestamp. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-orig-time now
+
+t ICMP_109 "Send ICMP Timestamp Request with originate timestamp but do not specify ICMP type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-orig-time now
+
+# Parameter --icmp-recv-time
+t ICMP_110 "Send ICMP Timestamp Request with zeroed receive timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time 0
+
+t ICMP_111 "Send ICMP Timestamp Request with a normal receive timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time 57509000
+
+t ICMP_112 "Send ICMP Timestamp Request with current receive timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time now
+
+t ICMP_113 "Send ICMP Timestamp Request with current receive timestamp + 1 minute" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time now+1m
+
+t ICMP_114 "Send ICMP Timestamp Request with current receive timestamp + 2 hours" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time now+2h
+
+t ICMP_115 "Send ICMP Timestamp Request with current receive timestamp minus 200 milliseconds" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time now-200ms
+
+t ICMP_116 "Send ICMP Timestamp Request with explicit positive receive timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time +10
+
+t ICMP_117 "Send ICMP Timestamp Request with negative receive timestamp. Expected: It should be ok to specify negative values" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time -10
+
+t ICMP_118 "Send ICMP Timestamp Request with bogus receive timestamp #1 (no number). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time bogusts
+
+t ICMP_119 "Send ICMP Timestamp Request with bogus receive timestamp #2 (now+bogusspec). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time now+bogus
+
+t ICMP_120 "Send ICMP Timestamp Request with bogus receive timestamp #3 (now+[nothing]). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time now+
+
+t ICMP_121 "Send ICMP Timestamp Request with bogus receive timestamp #4 (wrong order 1000+now). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-recv-time 1000+now
+
+t ICMP_122 "Send ICMP Timestamp Request with receive timestamp but specify ICMP Type!=Timestamp. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-recv-time now
+
+t ICMP_123 "Send ICMP Timestamp Request with receive timestamp but do not specify ICMP type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-recv-time now
+
+# Parameter --icmp-trans-time
+t ICMP_124 "Send ICMP Timestamp Request with zeroed transmit timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time 0
+
+t ICMP_125 "Send ICMP Timestamp Request with a normal transmit timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time 57509000
+
+t ICMP_126 "Send ICMP Timestamp Request with current transmit timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time now
+
+t ICMP_127 "Send ICMP Timestamp Request with current transmit timestamp + 1 minute" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time now+1m
+
+t ICMP_128 "Send ICMP Timestamp Request with current transmit timestamp + 2 hours" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time now+2h
+
+t ICMP_129 "Send ICMP Timestamp Request with current transmit timestamp minus 200 milliseconds" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time now-200ms
+
+t ICMP_130 "Send ICMP Timestamp Request with explicit positive transmit timestamp" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time +10
+
+t ICMP_131 "Send ICMP Timestamp Request with negative transmit timestamp. Expected: It should be ok to specify negative values" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time -10
+
+t ICMP_132 "Send ICMP Timestamp Request with bogus transmit timestamp #1 (no number). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time bogusts
+
+t ICMP_133 "Send ICMP Timestamp Request with bogus transmit timestamp #2 (now+bogusspec). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time now+bogus
+
+t ICMP_134 "Send ICMP Timestamp Request with bogus transmit timestamp #3 (now+[nothing]). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time now+
+
+t ICMP_135 "Send ICMP Timestamp Request with bogus transmit timestamp #4 (wrong order 1000+now). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-trans-time 1000+now
+
+t ICMP_136 "Send ICMP Timestamp Request with transmit timestamp but specify ICMP Type!=Timestamp. Expected: parameter ignored" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --icmp-trans-time now
+
+t ICMP_137 "Send ICMP Timestamp Request with transmit timestamp but do not specify ICMP type. Expected: parameter ignored and default ICMP mode set" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-trans-time now
+
+# --icmp-orig-time, --icmp-recv-time and --icmp-trans-time together
+t ICMP_138 "Send ICMP Timestamp Request with all timestamps" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp --icmp-orig-time now-2s --icmp-trans-time now-1s --icmp-recv-time now
+
+t ICMP_139 "Test it also works with replies." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type timestamp-reply --icmp-orig-time now-2s --icmp-trans-time now-1s --icmp-recv-time now
+
+
+
+#### ARP/RARP MODE ####
+
+t ARP_0 "Test ARP mode with default values. Expected: <<ARP Who has?>> for target host" \
+sudo nping --arp $TARGETS $GLOBALOPTS
+
+t ARP_1 "Send ARP Requests" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request
+
+t ARP_2 "Send ARP Replies" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-reply
+
+t ARP_3 "Send RARP Requests" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type rarp-request
+
+t ARP_4 "Send RARP Replies" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type rarp-reply
+
+t ARP_5 "Send DRARP Requests" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type drarp-request
+
+t ARP_6 "Send DRARP Replies" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type drarp-reply
+
+t ARP_7 "Send DRARP Error messages" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type drarp-error
+
+t ARP_8 "Send INARP Requests" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type inarp-request
+
+t ARP_9 "Send INARP Replies" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type inarp-reply
+
+t ARP_10 "Send ARP NAKs" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-nak
+
+t ARP_10b "Supply bogus ARP type" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type bogusarptype
+
+t ARP_10c "Supply NULL ARP type" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type ""
+
+t ARP_11 "Test sender MAC specification #1 (standard notation)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac AA:BB:CC:DD:EE:FF
+
+t ARP_12 "Test sender MAC specification #2 (using hyphens as octet separators)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac AA-BB-CC-DD-EE-FF
+
+t ARP_13 "Test sender MAC specification, suplying a bogus MAC #1 (too short MAC)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac AA:BB:CC:DD:EE
+
+t ARP_14 "Test sender MAC specification, suplying a bogus MAC #2 (too long MAC)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac AA:BB:CC:DD:EE:FF:GG
+
+t ARP_15 "Test sender MAC specification, suplying a bogus MAC #3 (empty MAC)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac ""
+
+t ARP_16 "Test sender MAC specification, suplying a bogus MAC #4 (MAC with a colon at the end)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac AA:BB:CC:DD:EE:FF:
+
+t ARP_17 "Test sender MAC specification, suplying a bogus MAC #4 (MAC with a colon at the beginning)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-mac :AA:BB:CC:DD:EE:FF
+
+t ARP_18 "Test target MAC specification #1 (standard notation)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac AA:BB:CC:DD:EE:FF
+
+t ARP_19 "Test target MAC specification #2 (using hyphens as octet separators)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac AA-BB-CC-DD-EE-FF
+
+t ARP_20 "Test target MAC specification, suplying a bogus MAC #1 (too short MAC)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac AA:BB:CC:DD:EE
+
+t ARP_21 "Test target MAC specification, suplying a bogus MAC #2 (too long MAC)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac AA:BB:CC:DD:EE:FF:GG
+
+t ARP_22 "Test target MAC specification, suplying a bogus MAC #3 (empty MAC)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac ""
+
+t ARP_23 "Test target MAC specification, suplying a bogus MAC #4 (MAC with a colon at the end)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac AA:BB:CC:DD:EE:FF:
+
+t ARP_24 "Test target MAC specification, suplying a bogus MAC #4 (MAC with a colon at the beginning)" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-mac :AA:BB:CC:DD:EE:FF
+
+t ARP_25 "Test sender IP. Supply IP address in standard decimal dot notation" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-ip 1.2.3.4
+
+t ARP_26 "Test sender IP. Supply IP address as a resolvable hostname" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-ip google.com
+
+t ARP_27 "Test sender IP, supplying an unresolvable hostname. Expected: error message" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-ip bogussenderip
+
+t ARP_28 "Test sender IP, supplying a null IP. Expected: error message" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-sender-ip ""
+
+t ARP_29 "Test target IP. Supply IP address in standard decimal dot notation" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-ip 1.2.3.4
+
+t ARP_30 "Test target IP. Supply IP address as a resolvable hostname" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-ip google.com
+
+t ARP_31 "Test target IP, supplying an unresolvable hostname. Expected: error message" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-ip bogustargetip
+
+t ARP_32 "Test target IP, supplying a null IP. Expected: error message" \
+sudo nping --arp $TARGETS $GLOBALOPTS --arp-type arp-request --arp-target-ip ""
+
+
+#### IPV4 OPTIONS ####
+
+t IP_1 "IP source IP." \
+sudo nping --tcp -S 5.5.5.5 $TARGETS $GLOBALOPTS
+
+t IP_2 "IP dest IP." \
+sudo nping --tcp --dest-ip="$TARGETS" $GLOBALOPTS
+
+t IP_3 "IP dest IP with target specification." \
+sudo nping --tcp --dest-ip="5.5.5.5" $TARGETS $GLOBALOPTS
+
+t IP_4 "IP tos decimal." \
+sudo nping --tcp --tos 10 $TARGETS $GLOBALOPTS
+
+t IP_5 "IP tos hex." \
+sudo nping --tcp --tos 0x10 $TARGETS $GLOBALOPTS
+
+t IP_6 "IP tos negative." \
+sudo nping --tcp --tos -5 $TARGETS $GLOBALOPTS
+
+t IP_7 "IP tos too big." \
+sudo nping --tcp --tos 256 $TARGETS $GLOBALOPTS
+
+t IP_8 "IP tos rand." \
+sudo nping --tcp --tos rand $TARGETS $GLOBALOPTS
+
+t IP_9 "IP id decimal." \
+sudo nping --tcp --id 1234 $TARGETS $GLOBALOPTS
+
+t IP_10 "IP id hex." \
+sudo nping --tcp --id 0x1234 $TARGETS $GLOBALOPTS
+
+t IP_11 "IP id negative." \
+sudo nping --tcp --id -5 $TARGETS $GLOBALOPTS
+
+t IP_12 "IP id too big." \
+sudo nping --tcp --id 70000 $TARGETS $GLOBALOPTS
+
+t IP_13 "IP id rand." \
+sudo nping --tcp --id rand $TARGETS $GLOBALOPTS
+
+t IP_14 "IP df." \
+sudo nping --tcp --df $TARGETS $GLOBALOPTS
+
+t IP_15 "IP mf." \
+sudo nping --tcp --mf $TARGETS $GLOBALOPTS
+
+t IP_16 "IP df mf." \
+sudo nping --tcp --df --mf $TARGETS $GLOBALOPTS
+
+t IP_17 "IP ttl decimal." \
+sudo nping --tcp --ttl 10 $TARGETS $GLOBALOPTS
+
+t IP_18 "IP ttl hex." \
+sudo nping --tcp --ttl 0x10 $TARGETS $GLOBALOPTS
+
+t IP_19 "IP ttl negative." \
+sudo nping --tcp --ttl -5 $TARGETS $GLOBALOPTS
+
+t IP_20 "IP ttl too big." \
+sudo nping --tcp --ttl 256 $TARGETS $GLOBALOPTS
+
+t IP_21 "IP ttl rand." \
+sudo nping --tcp --ttl rand $TARGETS $GLOBALOPTS
+
+t IP_22 "IP badsum-ip." \
+sudo nping --tcp --badsum-ip $TARGETS $GLOBALOPTS
+
+for mtu in 0 20 600 1500 65536 70000; do
+ t IP_mtu$mtu "IP mtu $mtu." \
+ sudo nping --tcp --mtu $mtu $TARGETS $GLOBALOPTS
+done
+
+t IP_23 "IP options null." \
+sudo nping --tcp --ip-options "" $TARGETS $GLOBALOPTS
+
+t IP_24 "IP options R." \
+sudo nping --tcp --ip-options "R" $TARGETS $GLOBALOPTS
+
+t IP_25 "IP options R with trailing data." \
+sudo nping --tcp --ip-options "R bogus" $TARGETS $GLOBALOPTS
+
+t IP_26 "IP options T." \
+sudo nping --tcp --ip-options "T" $TARGETS $GLOBALOPTS
+
+t IP_27 "IP options T with trailing data." \
+sudo nping --tcp --ip-options "T bogus" $TARGETS $GLOBALOPTS
+
+t IP_28 "IP options U." \
+sudo nping --tcp --ip-options "U" $TARGETS $GLOBALOPTS
+
+t IP_29 "IP options U with trailing data." \
+sudo nping --tcp --ip-options "U bogus" $TARGETS $GLOBALOPTS
+
+t IP_30 "IP options S no hops." \
+sudo nping --tcp --ip-options "S" $TARGETS $GLOBALOPTS
+
+t IP_31 "IP options S some hops." \
+sudo nping --tcp --ip-options "S 1.1.1.1 2.2.2.2" $TARGETS $GLOBALOPTS
+
+t IP_32 "IP options S too many hops." \
+sudo nping --tcp --ip-options "S 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4 5.5.5.5 6.6.6.6 7.7.7.7 8.8.8.8 9.9.9.9" $TARGETS $GLOBALOPTS
+
+t IP_33 "IP options L no hops." \
+sudo nping --tcp --ip-options "L" $TARGETS $GLOBALOPTS
+
+t IP_34 "IP options L some hops." \
+sudo nping --tcp --ip-options "L 1.1.1.1 2.2.2.2" $TARGETS $GLOBALOPTS
+
+t IP_35 "IP options L too many hops." \
+sudo nping --tcp --ip-options "L 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4 5.5.5.5 6.6.6.6 7.7.7.7 8.8.8.8 9.9.9.9" $TARGETS $GLOBALOPTS
+
+t IP_36 "IP options RTUS." \
+sudo nping --tcp --ip-options "RTUS 1.1.1.1 2.2.2.2" $TARGETS $GLOBALOPTS
+
+t IP_37 "IP options hex." \
+sudo nping --tcp --ip-options "\xff" $TARGETS $GLOBALOPTS
+
+t IP_38 "IP options decimal." \
+sudo nping --tcp --ip-options "\255" $TARGETS $GLOBALOPTS
+
+t IP_39 "IP options repetition." \
+sudo nping --tcp --ip-options "\x12*8" $TARGETS $GLOBALOPTS
+
+
+#### IPV6 OPTIONS ####
+
+t IPV6_1 "IPv6 source IP." \
+sudo nping -6 --tcp -S 55::55 $TARGETS $GLOBALOPTS
+
+t IPV6_2 "IPv6 dest IP." \
+sudo nping -6 --tcp --dest-ip="$TARGETS" $GLOBALOPTS
+
+t IPV6_3 "IPv6 dest IP with target specification." \
+sudo nping -6 --tcp --dest-ip="55::55" $TARGETS $GLOBALOPTS
+
+t IPV6_4 "IPv6 flow decimal." \
+sudo nping -6 --tcp --flow 10 $TARGETS $GLOBALOPTS
+
+t IPV6_5 "IPv6 flow hex." \
+sudo nping -6 --tcp --flow 0x10 $TARGETS $GLOBALOPTS
+
+t IPV6_6 "IPv6 flow negative." \
+sudo nping -6 --tcp --flow -5 $TARGETS $GLOBALOPTS
+
+t IPV6_7 "IPv6 flow > 2**20." \
+sudo nping -6 --tcp --flow 2000000 $TARGETS $GLOBALOPTS
+
+t IPV6_8 "IPv6 flow > 2**32." \
+sudo nping -6 --tcp --flow 10000000000 $TARGETS $GLOBALOPTS
+
+t IPV6_9 "IPv6 flow rand." \
+sudo nping -6 --tcp --flow rand $TARGETS $GLOBALOPTS
+
+t IPV6_10 "IPv6 hop-limit decimal." \
+sudo nping -6 --tcp --hop-limit 10 $TARGETS $GLOBALOPTS
+
+t IPV6_11 "IPv6 hop-limit hex." \
+sudo nping -6 --tcp --hop-limit 0x10 $TARGETS $GLOBALOPTS
+
+t IPV6_12 "IPv6 hop-limit negative." \
+sudo nping -6 --tcp --hop-limit -5 $TARGETS $GLOBALOPTS
+
+t IPV6_13 "IPv6 hop-limit too big." \
+sudo nping -6 --tcp --hop-limit 256 $TARGETS $GLOBALOPTS
+
+t IPV6_14 "IPv6 hop-limit rand." \
+sudo nping -6 --tcp --hop-limit rand $TARGETS $GLOBALOPTS
+
+t IPV6_15 "IPv6 traffic-class decimal." \
+sudo nping -6 --tcp --traffic-class 10 $TARGETS $GLOBALOPTS
+
+t IPV6_16 "IPv6 traffic-class hex." \
+sudo nping -6 --tcp --traffic-class 0x10 $TARGETS $GLOBALOPTS
+
+t IPV6_17 "IPv6 traffic-class negative." \
+sudo nping -6 --tcp --traffic-class -5 $TARGETS $GLOBALOPTS
+
+t IPV6_18 "IPv6 traffic-class too big." \
+sudo nping -6 --tcp --traffic-class 256 $TARGETS $GLOBALOPTS
+
+t IPV6_19 "IPv6 traffic-class rand." \
+sudo nping -6 --tcp --traffic-class rand $TARGETS $GLOBALOPTS
+
+
+#### PAYLOAD RELATED OPTIONS ####
+
+t PAYLOAD_1 "Test raw hex payload specification. Data starts with 0x." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data 0xAABBCCDDEEFF
+
+t PAYLOAD_2 "Test raw hex payload specification. Data does not start with 0x." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data AABBCCDDEEFF
+
+t PAYLOAD_3 "Test raw hex payload specification. Data specified with the \xNN format." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data "\xAA\xBB\xCC\xDD\xEE\xFF"
+
+t PAYLOAD_4 "Test raw hex payload specification, specifying bogus hex data #1 (uneven hex chars) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data 0xAAB
+
+t PAYLOAD_5 "Test raw hex payload specification, specifying bogus hex data #2 (uneven hex chars without the 0x) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data AAB
+
+t PAYLOAD_6 "Test raw hex payload specification, specifying bogus hex data #3 (uneven hex chars with the \xNN format.) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data "\xAA\xB"
+
+t PAYLOAD_7 "Test raw hex payload specification, specifying bogus hex data #4 (uneven hex chars with the \xNN format.) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data "\xAA\xB"
+
+t PAYLOAD_8 "Test raw hex payload specification, specifying bogus hex data #5 (non hex digits) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data 0xFG
+
+t PAYLOAD_9 "Test raw hex payload specification, specifying bogus hex data #6 (non hex digits) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data FG
+
+t PAYLOAD_10 "Test raw hex payload specification, specifying bogus hex data #7 (no hex digits, just 0x) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data 0x
+
+t PAYLOAD_11 "Test raw hex payload specification, specifying bogus hex data #8 (no hex digits, just "\x") Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data "\x"
+
+t PAYLOAD_12 "Test raw hex payload specification, specifying bogus hex data #9 (just pass empty quotes) Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data ""
+
+t PAYLOAD_13 "Test string payload specification. Supply a single character." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-string A
+
+t PAYLOAD_14 "Test string payload specification. Supply sentence" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-string "Let me tell you about Sally Brown..."
+
+t PAYLOAD_15 "Test string payload specification. Supply hex data. Expected: treat that as a regular ASCII string, not as hex data" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-string 0xAABBCCDD
+
+t PAYLOAD_16 "Test string payload specification, specifying empty string" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-string ""
+
+t PAYLOAD_17a "Test random data payload specification. Include 0 bytes." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 0
+
+t PAYLOAD_17b "Test random data payload specification. Include 1 byte." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 1
+
+t PAYLOAD_18 "Test random data payload specification. Include 100 bytes." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 100
+
+t PAYLOAD_19 "Test random data payload specification. Include maximum recomended payload bytes." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 1400
+
+t PAYLOAD_20 "Test random data payload specification. Include more than maximum recomended payload bytes. Expected: warning message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 1401
+
+t PAYLOAD_21 "Test random data payload specification. Include maximum allowed payload bytes." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 65400
+
+t PAYLOAD_22 "Test random data payload specification. Include more tan maximum allowed payload bytes. Expected error message." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 65401
+
+t PAYLOAD_23 "Test random data payload specification. Include a lot more tan maximum allowed payload bytes. Expected error message." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len 999999999999999999
+
+t PAYLOAD_24 "Test random data payload specification, specifying bogus data (negative number of bytes)." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-len -1
+
+# The following tests are not passed because --data-file is currently unimplemented
+
+# Generate an empty file
+rm -f NPINGEMPTYFILE.tmp
+touch NPINGEMPTYFILE.tmp
+t PAYLOAD_25 "Test payload file specification, specifying an empty file. Expected: Packets with a 0-byte payload." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-file NPINGEMPTYFILE.tmp
+# And delete it after the test
+rm -f NPINGEMPTYFILE.tmp
+
+# Generate regular empty file
+echo "London's burning dial 99999..." > NPINGREGULARFILE.tmp
+t PAYLOAD_26 "Test payload file specification, specifying normal file with a normal string. Expected: Packets with the string included." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-file NPINGREGULARFILE.tmp
+# And delete it after the test
+rm -f NPINGREGULARFILE.tmp
+
+t PAYLOAD_27 "Test payload file specification, specifying a nonexisting or not-readable file. Expected: error message." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-file FILE_THAT_DOES_NOT_EXIST.tmp
+
+t PAYLOAD_28 "Test payload file specification, specifying a null filename. Expected: error message." \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --data-file ""
+
+# This doesn't give an error, it just ignores the payload spec.
+t PAYLOAD_29 "Test payload specification in TCP connect mode. Expected: warning message." \
+nping --tcp-connect $TARGETS $GLOBALOPTS --data-string "Test Payload"
+
+
+#### ECHO MODE ####
+
+# Client
+t ECHO_1 "Test client connection to echo.nmap.org." \
+sudo nping --echo-client "public" echo.nmap.org -c2
+
+t ECHO_2 "Test client connection to a bogus server" \
+sudo nping --echo-client "public" bogus.bogus
+
+t ECHO_3 "Test client connection to a server that has no NEP service running" \
+sudo nping --echo-client "public" google.com
+
+t ECHO_4 "Test client connection to echo.nmap.org using the explicit port number 9929" \
+sudo nping --echo-client "public" echo.nmap.org --echo-port 9929 -c2
+
+t ECHO_5 "Test client connection to echo.nmap.org but using a different port" \
+sudo nping --echo-client "public" echo.nmap.org --echo-port 34554
+
+t ECHO_6 "Test client connection to echo.nmap.org but using an invalid port number #1" \
+sudo nping --echo-client "public" echo.nmap.org --echo-port -1
+
+t ECHO_7 "Test client connection to echo.nmap.org but using an invalid port number #2" \
+sudo nping --echo-client "public" echo.nmap.org --echo-port BOGUSPORT
+
+t ECHO_8 "Test client connection to echo.nmap.org but using an invalid port number #3" \
+sudo nping --echo-client "public" echo.nmap.org --echo-port 65536
+
+t ECHO_9 "Test client connection to echo.nmap.org but using an invalid port number #4" \
+sudo nping --echo-client "public" echo.nmap.org --echo-port 0
+
+t ECHO_10 "Test client connection to echo.nmap.org. TCP mode" \
+sudo nping --echo-client "public" echo.nmap.org --tcp -c2
+
+t ECHO_11 "Test client connection to echo.nmap.org. UDP mode" \
+sudo nping --echo-client "public" echo.nmap.org --udp -c2
+
+t ECHO_12 "Test client connection to echo.nmap.org. ICMP mode" \
+sudo nping --echo-client "public" echo.nmap.org --icmp -c2
+
+t ECHO_13 "Test client connection to echo.nmap.org. TCP connect mode. Expected: Failure" \
+sudo nping --echo-client "public" echo.nmap.org --tcp-connect
+
+t ECHO_14 "Test client connection to echo.nmap.org. ARP mode. Expected: Failure" \
+sudo nping --echo-client "public" echo.nmap.org --arp
+
+t ECHO_15 "Test client connection to echo.nmap.org. RARP mode. Expected: Failure" \
+sudo nping --echo-client "public" echo.nmap.org --rarp
+
+t ECHO_16 "Test client connection to echo.nmap.org, using the wrong password." \
+sudo nping --echo-client "BOGUS" echo.nmap.org
+
+t ECHO_17 "Test client connection to echo.nmap.org, using --no-crypto. Expected: Failure" \
+sudo nping --echo-client "a" echo.nmap.org --no-crypto
+
+t ECHO_18 "Test client connection to echo.nmap.org, NOT running as root. Expected: Failure" \
+nping --echo-client "a" echo.nmap.org
+
+t ECHO_19 "Test client connection to echo.nmap.org. No passphrase supplied." \
+nping echo.nmap.org --echo-client
+
+t ECHO_20 "Test client connection to echo.nmap.org. No target host supplied." \
+nping --echo-client "public"
+
+# Server
+t ECHO_21 "Test. Run the server normally" \
+sudo nping --echo-server "public"
+
+t ECHO_22 "Test. Run the server, but NOT as root. Expected: Failure" \
+nping --echo-server "public"
+
+t ECHO_23 "Test. Run the server with --no-crypto" \
+sudo nping --echo-server "" --no-crypto
+
+t ECHO_24 "Test. Run the server specifying the interface to use for capture ($EXISTING_NET_IFACE)" \
+sudo nping --echo-server "public" -e $EXISTING_NET_IFACE
+
+t ECHO_25 "Test. Run the server specifying an interface that does not exist." \
+sudo nping --echo-server "public" -e BOGUS_INTERFACE
+
+t ECHO_26 "Test. Run the server with --once. You should run a client in parallel (sudo nping --echo-client public --echo-port 33445 localhost -c1)" \
+sudo nping --once --echo-server "public" --echo-port 33445 -e lo &
+
+t ECHO_27 "Test. Run the server with --no-crypto. You should run a client in parallel (sudo nping --echo-client "" --no-crypto --echo-port 33446 localhost -c1)" \
+sudo nping --once --echo-server "" --no-crypto --echo-port 33446 -e lo &
+
+
+#### TIMING AND PERFORMANCE OPTIONS ####
+
+t TIMING_1 "Test inter packet delay. Specify 1sec" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay 1s -c 2
+
+t TIMING_2 "Test inter packet delay. Specify 10secs" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay 10s -c 2
+
+t TIMING_3 "Test inter packet delay. Specify 0.1 (100ms) " \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay 100ms -c 2
+
+t TIMING_4 "Test inter packet delay. Specify 0.5ms" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay 100ms -c 2
+
+t TIMING_5 "Test inter packet delay specifying a bogus interval #1 (negative value). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay -10 -c2
+
+t TIMING_6 "Test inter packet delay specifying a bogus interval #2 (empty value). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay "" -c2
+
+t TIMING_7 "Test inter packet delay specifying a bogus interval #3 (no digits value). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay bogusdelay -c2
+
+t TIMING_8 "Test inter packet delay specifying a bogus interval #4 (bad time specifier). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --delay 10xy -c2
+
+t TIMING_9 "Test packet transmission rate. 1 packet per second " \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate 1
+
+t TIMING_10 "Test packet transmission rate. 5 packets per second " \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate 5
+
+t TIMING_11 "Test packet transmission rate. 99 packets per second " \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate 99
+
+t TIMING_12 "Test packet transmission rate. 10,000 packets per second " \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate 10000
+
+t TIMING_13 "Test packet transmission rate, specifying a bougus rate #1 (0 pps). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate 0
+
+t TIMING_14 "Test packet transmission rate, specifying a bougus rate #2 (negative rate). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate -1
+
+t TIMING_15 "Test packet transmission rate, specifying a bougus rate #3 (non numerical rate). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate bogusrate
+
+t TIMING_16 "Test packet transmission rate, specifying a bougus rate #4 (very large rate). Expected: error message" \
+sudo nping --icmp $TARGETS $GLOBALOPTS --icmp-type echo --rate 99999999999999999999999
+
+
+#### MISCELLANEOUS OPTIONS ####
+
+t MISC_1 "Test help display option (-h)" \
+nping -h
+
+t MISC_2 "Test help display option (--help)" \
+nping --help
+
+t MISC_3 "Test version display option (-V)" \
+nping -V
+
+t MISC_4 "Test version display option (--version)" \
+nping --version
+
+t MISC_5 "Test round number specification. Just send one packet to each target " \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -c 1
+
+t MISC_6 "Test round number specification. Send two packets to each target " \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -c 2
+
+t MISC_7 "Test round number specification. Send infinite packets [Press CTRL-C to quit]" \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -c 0
+
+t MISC_8 "Test round number specification, specifying a bogus number #1 (negative value) " \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -c -1
+
+t MISC_9 "Test round number specification, specifying a bogus number #2 (non-numeric value) " \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -c boguscount
+
+t MISC_10 "Test network interface specification. Supply an interface that exists ($EXISTING_NET_IFACE) " \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -e $EXISTING_NET_IFACE
+
+t MISC_11 "Test network interface specification. Supply an interface that does not exist. Expected: error message." \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -e bogusinterface
+
+t MISC_12 "Test network interface specification, specifying a bogus interface name (null). Expected: error message" \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn -e ""
+
+t MISC_13 "Test --hide-sent option. Expected: sent packets not shown." \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn --hide-sent
+
+t MISC_14 "Test --no-capture option. Expected: no replies captured. This is run against localhost (overriding global TARGETS) to make sure we get TCP RST packets but we don't capure them." \
+sudo nping --tcp localhost $GLOBALOPTS --flags psh,fin,syn --no-capture
+
+t MISC_15 "Force unprivileged execution. Expected: Error message complaining about TCP more requiring privileges" \
+sudo nping --tcp $TARGETS $GLOBALOPTS --flags psh,fin,syn --unprivileged
+
+t MISC_16 "Force unprivileged execution. Expected: Operation in TCP-Connect mode" \
+sudo nping $TARGETS $GLOBALOPTS --unprivileged
+
+t MISC_17 "Force privileged execution (being non-root). Expected: Error caused by a failed system call." \
+nping $TARGETS $GLOBALOPTS --privileged
+
+t MISC_18 "Force privileged execution (being root). Expected: Normal operation." \
+sudo nping $TARGETS $GLOBALOPTS --privileged
+
+# This works on normal connection but fails when working through a VPN
+t MISC_19 "Test --send-eth. Expected: Normal operation, sending packet at ethernet level." \
+sudo nping $TARGETS $GLOBALOPTS --send-eth
+
+t MISC_20 "Test --send-ip. Expected: Normal operation in Linux, etc. Possible failure on windows." \
+sudo nping $TARGETS $GLOBALOPTS --send-ip
+
+t MISC_21 "Test custom BPF filter specification. Capture all IP traffic. [You need to browse the web or generate another traffic in parallel]. Expected: ICMP traffic and any other IP traffic shown" \
+sudo nping $TARGETS $GLOBALOPTS --bpf-filter "ip" -c 30
+
+t MISC_21 "Test custom BPF filter specification. Capture only TCP. Expected: no ICMP replies shown." \
+sudo nping $TARGETS $GLOBALOPTS --bpf-filter "tcp"
+
+t MISC_22 "Test custom BPF filter specification, specifying a bogus BPF filter spec #1 (null spec). Expected: capture all traffic" \
+sudo nping $TARGETS $GLOBALOPTS --bpf-filter ""
+
+t MISC_23 "Test custom BPF filter specification, specifying a bogus BPF filter spec #2 (incorrect spec). Expected: error message." \
+sudo nping $TARGETS $GLOBALOPTS --bpf-filter "bogus_spec"
+
+
+
+
+
+#####################
+# PRINT RESULTS #
+#####################
+END_TIME=`date +"%s"`
+ELAPSED_TIME=`expr $END_TIME - $START_TIME`
+echo "[+] ============== RESULTS =============="
+echo "[+] Total tests run : $TOTAL_TESTS_RUN"
+echo "[+] Total tests PASSED : $TOTAL_TESTS_PASSED"
+echo "[+] Total tests FAILED : $TOTAL_TESTS_FAILED"
+echo "[+] List of PASSED Tests : $PASSED_TESTS"
+echo "[+] List of FAILED Tests : $FAILED_TESTS"
+echo "[+] Time elapsed : $ELAPSED_TIME seconds"
+exit
diff --git a/nping/nping-dev/valgrind_supress.txt b/nping/nping-dev/valgrind_supress.txt
new file mode 100644
index 0000000..615344c
--- /dev/null
+++ b/nping/nping-dev/valgrind_supress.txt
@@ -0,0 +1,85 @@
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+ obj:*
+ obj:*
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+ obj:*
+ obj:*
+}
+
+{
+ <SUPPRESSION_PCAP_SETSOCKOPT>
+ Memcheck:Param
+ socketcall.setsockopt(optval)
+ fun:setsockopt
+ obj:/usr/lib/libpcap.so.1.0.0
+ obj:/usr/lib/libpcap.so.1.0.0
+ fun:nsock_pcap_set_filter
+ fun:nsock_pcap_open
+ fun:_ZN9ProbeMode5startEv
+ fun:_ZN10EchoClient5startEP11NpingTargett
+ fun:main
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+}
+
+{
+ <SUPPRESSION_AES_cbc_encrypt>
+ Memcheck:Addr8
+ fun:AES_cbc_encrypt
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+}