Intro to Network Traffic Analysis Module Cheat Sheet
Intro to Network Traffic Analysis Module Cheat Sheet
ANALYSIS
CHEAT SHEET
Cheat Sheet
Keep in mind, unless you are utilizing root, sudo privileges will be required to execute any
applications that need to bind a network interface or set it into promiscuous mode.
Tcpdump
Command Description
tcpdump -- Prints the tcpdump and libpcap version strings then exits.
version
tcpdump -D Prints a list of usable network interfaces from which tcpdump can
capture.
tcpdump -i Executes tcpdump and utilizes the interface specified to capture on.
(interface
name or #)
tcpdump -i Runs a capture on the specified interface and writes the output to a
(int) -w file.
file.pcap
Command Description
tcpdump -r/- TCPDump will utilize the capture traffic from a live capture or a file
w file.pcap and set stdout as line-buffered. We can then utilize pipe (|) to send
-l \| grep
'string' that output to other tools such as grep to look for strings or specific
patterns.
tcpdump -i TCPDump will start a capture on the interface specified at (int) and
(int) host will only capture traffic originating from or destined to the IP address
(ip)
or hostname specified after host.
tcpdump -i Will filter the capture for anything sourcing from or destined to port (#)
(int) port and discard the rest.
(#)
tcpdump -i Will filter the capture for any protocol traffic matching the (#). For
(int) proto example, (6) would filter for any TCP traffic and discard the rest.
(#)
tcpdump -i Will utilize a protocols common name to filter the traffic captured.
(int) (proto TCP/UDP/ICMP as examples.
name)
Switch/Filter Description
XX Same as X, but will also specify ethernet headers. (like using Xe)
Switch/Filter Description
host Host will filter visible traffic to show anything involving the designated
host. Bi-directional
src / dest srcand dest are modifiers. We can use them to designate a source or
destination host or port.
net net will show us any traffic sourcing from or destined to the network
designated. It uses / notation.
proto will filter for a specific protocol type. (ether, TCP, UDP, and ICMP as
examples)
port port is bi-directional. It will show any traffic with the specified port as
the source or destination.
less / less and greater can be used to look for a packet or protocol option
greater "< of a specific size.
>"
and / && can be used to concatenate two different filters together. for
and &&
example, src host AND port.
not not is a modifier saying anything but x. For example, not UDP.
TShark
Command Description
tshark -i (int) Capture on a selected interface. Replace (int) with the interface
name or number.
tshark -i eth0 - apply a filter with (-f) looking for a specific host while utilizing
f "host (ip)" tshark
D Will display any interfaces available to capture from and then exit
out.
L Will list the Link-layer mediums you can capture from and then
exit out. (ethernet as an example)
P Will print the packet summary while writing into a file (-W)
Command Description
WireShark
net x.x.x.x/24 Capture traffic to or from a specific network (using slash notation
to specify the mask)
src/dst net Using src or dst net will only capture traffic sourcing from the
x.x.x.x/24 specified network or destined to the target network
port # will filter out all traffic except the port you specify
not will capture everything except the variable specified. ex. not
port 80
and AND will concatenate your specified ports. ex. host 192.168.1.1
and port 80
portrange x-x Portrange will grab traffic from all ports within the range only
ip / ether / tcp These filters will only grab traffic from specified protocol headers.
broadcast / Grabs a specific type of traffic. one to one, one to many, or one
multicast / to all.
unicast
dns / tcp / ftp / filter traffic by a specific protocol. There are many more
arp / ip options.
and / or / not AND will concatenate, OR will find either of two options, NOT
will exclude your input option.
http Will filter for any traffic matching the http protocol.
http && image-jfif This filter will display any packet with a jpeg image file.
ftp.request.command Will filter for any control commands sent over ftp control
channel.
Misc Commands
Command Description
sudo * Sudo will run the command that proceeds it with elevated privileges.
man Displays the manual pages for an application. ex. man tcpdump.
(application)
110 POP3 Mail service utilized by clients to retrieve email from a server.
123 NTP Network Time Protocol. Provides timing and sync services
for network devices.
139 Netbios- Provides session services for data transfer. Services like
SSN SMB can utilize it.
445 SMB Server Message Block. SMB allows for the sharing of
services, files, networking ports, and printers between hosts.