|
NAMEPackit - Packet analysis and injection tool SYNOPSISPacket capture:
Packet injection:
DESCRIPTIONPackit is a network auditing tool. It´s value is derived from its ability to customize, inject, monitor, and manipulate IP traffic. By allowing you to define (spoof) all TCP, UDP, ICMP, IP, ARP, RARP and Ethernet header options, Packit can be useful in testing firewalls, intrusion detection systems, port scanning, simulating network traffic and general TCP/IP auditing. Packit is also an excellent tool for learning TCP/IP. PACKIT BASE OPTIONS-m mode
PACKET CAPTURE OPTIONSPacket capture options are as follows: -c count
-e Display link-layer header data. -G Display the timestamp in GMT rather than localtime. -i interface
-n Don't resolve host addresses to names but resolve ports
numbers.
-nn Don't resolve ports numbers to their protocol names but
resolve
-nnn Don't resolve host addresses or port numbers. -r file
-s snaplen
-v Enables verbose packet capture. -w file
-X Display hexadecimal & ascii dump of each packet up
to snap
expression
PACKET INJECTION / TRACEPacket injection is used to define and inject IP based network traffic onto your network. You have the ability to define essentially any ARP, IP, TCP, UDP, ICMP and Ethernet header value. This can be valuable in a number of ways, including testing firewalls, intrusion detection systems, simulating traffic flow and general TCP/IP auditing. CHOOSE YOUR PROTOCOL-t protocol
PACKET INJECTION / TRACE GENERALThis section documents the operational command-line options. -c count
-w interval
-b burst rate
-h
-H timeout
-i interface
-v
-p payload
-w interval
-Z length
IP HEADER OPTIONSThis section documents the IP header command-line options. -s src address
-sR Use a random source IP address. -d dst address
-dR Use a random destination IP address. -o type of service
Below are the 4 valid TOS bit values: - Minimize delay: 16 (0x10)
-n ID number
-T TTL
-V IP protocol number
TCP HEADER OPTIONSThis section documents the TCP header command-line options. -S src port
-D dst port
-f Do not fragment this packet. -F tcp flags
- S : SYN (Synchronization sequence number)
As an example, to set the SYN and FIN bits use the
-q sequence number
-a ack number
-W window size
-u urgent pointer
UDP HEADER OPTIONSThis section documents the UDP header command-line options. UDP is the default IP protocol for TRACE mode. -S src port
-D dst port
ICMP HEADER OPTIONSThis section documents the ICMP header command-line options. -K type
-C code
ECHO REQUEST / ECHO REPLY OPTIONS -N id number
-Q sequence number
UNREACHABLE / REDIRECT / TIME EXCEEDED OPTIONS -g gateway
-j address
-J src port
-l address
-L dst port
-m time to live
-M id
-O type of service
-P protocol
MASK REQUEST / MASK REPLY OPTIONS -N id number
-Q sequence number
-G address mask
TIMESTAMP REQUEST / TIMESTAMP REPLY OPTIONS -N id number
-Q sequence number
-U original timestamp
-k recieved timestamp
-z transmit timestamp
ARP HEADER OPTIONSThis section documents the ARP header command-line options. In my opinion, these options have the ability to do the most damage with the least effort, especially on large cable and DSL networks. Use with caution. Packit only supports ARP protocol addresses in IPv4 format -A operation type
- 1 : ARP Request
-y target IP address
-yR Use a random target host IP address. -Y target ethernet address
-YR Usage a random target host ethernet address. -x sender IP address
-xR Use a random sender host IP address. -X sender ethernet address
-XR Usage a random sender host ethernet address. ETHERNET HEADER OPTIONSThis section documents the Ethernet header command-line options. -e src ethernet address
-eR Use a random source ethernet address. If you define this, you will most likely need to define the
destination ethernet header value as well. When using either -e or
-E dst ethernet address
-ER Use a random destination ethernet address. The following two rules should be followed if you actually want the destination to receive to receive the packets you're sending: 1) If the destination exists beyond your default route
(gateway),
2) If the destination exists on your subnet, the
destination
PACKET CAPTURE EXAMPLESTo print all TCP communications that doesn't revolve around SSH
(port 22).
To print the start and end packets (the SYN and FIN pack- ets) of each TCP conversation that involves a non-local host, don't resolve addresses and display hex/ascii dump of the packet. packit -m cap -nX 'tcp[tcpflags] & (tcp-syn|tcp-fin) !=
0
To write the first 10 ICMP packets captured to a file. packit -m cap -c 10 -w /tmp/mylog 'icmp' PACKET INJECTION EXAMPLESIMPORTANT: The ethernet address 'f:00:d:f:00:d' in these examples is a mock representation of the ethernet address of my default route. In order for these examples to work properly, you would need to change it to your correct default route ethernet address. Inject 10 ICMP type 8 (echo request) packets from host '3.1.33.7' to host '192.168.0.1' and watch for a response. packit -t icmp -s 3.1.33.7 -d 192.168.0.1 -c 10 -h Inject an ICMP type 18 (mask reply) packet with an ICMP id of 211 and an address mask of 255.255.255.0. packit -t icmp -K 18 -d 127.0.0.1 -N 211 -G 255.255.255.0 Inject 5 TCP packets from random hosts to 'www.microsoft.com' with the SYN flag set, a window size of 666, a random source ethernet address, a destination ethernet address of f:00:d:f:00:d, with a payload of "HI BILL", displaying each packet injected. packit -sR -d www.microsoft.com -F S -c 5 -W 666
Inject a total of 1000 TCP packets in 20 packet per second bursts from 192.168.0.1 on port 403 to 192.168.0.20 on port 80 with the SYN and RST flags set, a sequence number of 12345678910 and a source ethernet address of 0:0:0:0:0:0. packit -s 192.168.0.1 -d 192.168.0.20 -S 403 -D 80
Inject a TCP packets from 10.22.41.6 to 172.16.1.3 on ports ranging from 1-1024 with the SYN flag set and display each packet we send. packit -s 10.22.41.6 -d 172.16.1.3 -D 1-1024 -F S -v Inject a broadcast ARP reply stating that 4.3.2.1 is at 5:4:3:2:1:0. Also, spoof the source ethernet adddress for a little more authenticity and supply the payload in hex. packit -t arp -A 2 -x 4.3.2.1 -X 5:4:3:2:1:0 -e 5:4:3:2:1:0
TRACE ROUTE EXAMPLESAppear as a DNS response by using a UDP source port of 53 (DNS) packit -m trace -t UDP -d 192.168.2.35 -S 53 Appear as HTTP traffic by using TCP port 80 packit -m trace -t TCP -d www.google.com -S 80 -FS SEE ALSOpcap(3), bpf(4), libnet(3), tcpdump(1) BUGSDue to limitations in some versions of *BSD, specifying arbitrary ethernet and/or ARP header data may not be supported. ARP capture data is incomplete. Like this man page, packit is still very much a work in progress. Please send bug reports, questions or requests to dbounds@intrusense.com. AUTHORDarren Bounds <dbounds@intrusense.com> The latest version can be found at:
|