Lab
HTTP is probably the most common protocol on the Internet. It is plain text, so an attacker with access to the network can sniff and read the data inside the packets. In this lab, I analyze and extract interesting information from HTTP traffic with tshark.
Start the lab, locate the PCAP file in the current directory, and use tshark to answer the following questions.
Questions
Set A:
- Command to show only the HTTP traffic from a PCAP file?
- Command to show only the IP packets sent from IP address 192.168.252.128 to IP address 52.32.74.91?
- Command to print only packets containing GET requests?
- Command to print only source IP and URL for all GET request packets?
Set B:
- How many HTTP packets contain the "password" string?
- What is the destination IP address for GET requests sent for New York Times (www.nytimes.com)?
- What is the session ID being used by 192.168.252.128 for Amazon India store (amazon.in)?
- What type of OS the machine on IP address 192.168.252.128 is using (i.e. Windows/Linux/MacOS/Solaris/Unix/BSD)? Bonus: Can you also guess the distribution/flavor?
Filter 'HTTP' Traffic with TShark Pcap
tshark -r HTTP_traffic.pcap -Y 'http'
Filter 'IP.SRC' Traffic with TShark
tshark -r HTTP_traffic.pcap -Y 'ip.src==192.168.252.128 && ip.dst==23.15.151.152'
Filter 'HTTP.REQUEST' Traffic with TShark
Show only GET requests:
tshark -r HTTP_traffic.pcap -Y 'http.request.method==GET'
Examine specific fields:
tshark -r HTTP_traffic.pcap -Y 'http.request.method==GET' -Tfields -e frame.time -e ip.src -e http.request.full_uri
Filter 'HTTP CONTAINS PASSWORD' Traffic with TShark
tshark -r HTTP_traffic.pcap -Y 'http contains password'
Filter 'HTTP' for Specific Site with TShark
tshark -r HTTP_traffic.pcap -Y 'http.request.method==GET && http.host==www.nytimes.com' -Tfields -e ip.dst
Filter 'IP CONTAINS <SITE>' w/Tshark
tshark -r HTTP_traffic.pcap -Y 'ip contains amazon.in && ip.src==192.168.252.128' -Tfields -e ip.src -e http.cookie
Filter 'Browser' with TShark
tshark -r HTTP_traffic.pcap -Y 'ip.src==192.168.252.128 && http' -Tfields -e http.user_agent