Back
[CTF] Wireshark Feature Cheat Sheet

[CTF] Wireshark Feature Cheat Sheet

A quick reference guide for using Wireshark in CTF challenges.

Introduction

A quick cram session for packet analysis challenges (work in progress). This post focuses primarily on functionality; I'll save deep-dive packet analysis for a future post if time permits.

The Essentials

Wireshark + a .pcap file.

Using CLI Wireshark (tshark)

It's FAST.

tshark -r example.pcap -R [filter] -T fields -e [output field]

Note: -T fields is used to enable the -e flag; otherwise, it defaults to standard text output.

e.g. tshark -r example.pcap -T fields -e ip.addr > out.txt

Using Filters

[not] Expression [and|or] [not] Expression

All filtering can be done using this syntax.

Expression example: ip.src == 127.0.0.1

You can also add filters manually via the GUI: Analyze -> Display Filter Expression

Common Filter Methods

  • eth.dst
  • eth.addr
  • tcp.dstport
  • tcp.srcport
  • http.request.method == 'GET|POST'
  • http.request.uri == '/example'
  • http contains FLAG

You can also use the search function (CTRL+F) in the GUI, which supports regex, string, and hex searches.

Statistics

EndPoints & Conversations

Useful for viewing statistics on IPs, MAC addresses, packet sizes, and traffic volume.

HTTP

RequestQuickly organizes URLs visited in the packets. Useful for inspection, especially when investigating SQL injection or attack payloads.

Packet CounterCommonly used in CTFs for HTTP-related tasks; great for quickly analyzing response codes.

IPV4/IPV6 Statistics

Provides statistical data, though it can be overwhelming; I personally don't use this as often.

Preferences

Edit -> Preferences

Protocol

This is where you configure protocol-specific details or decryption settings.

  1. TLS/SSL DecryptionPreferences -> Protocol -> SSL/TLS -> RSA key listAllows you to import keys to decrypt encrypted traffic (commonly HTTPS). Just fill in the fields as required.Note: In Wireshark 3.x and later, it is labeled as TLS. SSL was only used in older 2.x versions.
  2. WPA-PSK (Wi-Fi, etc.)
    1. Password cracking or provided keys
      • linux: aircrack
      • Usage: aircrack-ng -w password.lst /tmp/test.pcap
    2. Inputting the password into Wireshark for parsingPreferences -> Protocols -> IEEE802.11 -> Edit to add keys.For more details, refer to HowToDecrypt802.11

Wireshark Magic Features

Automatic Object Export

File -> Export Object -> [HTTP/TFTP/IMF/...]

Automatically exports files that Wireshark can reconstruct. HTTP is the most common use case.

Follow Stream

Excellent for getting an overview of data streams; frequently used to analyze sequences of HTTP requests.

Written by setsal.lan in