Learn · Tier 4 · Module 8 of 10

To the terminal

Difficulty 4 and 5 need tools on your own computer. Install Wireshark, tshark, curl and Python, and redo two earlier puzzles with them.

The idea

The workspace covers difficulty 1 to 3. Harder puzzles need what a browser cannot do: run a real binary, use a large Python library, handle a capture of hundreds of megabytes, or keep a script running for an hour. From tier 4 on, you work on your own computer.

Nothing you learned changes. Each workspace tool has showed its terminal equivalent all along:

WorkspaceYour computerInstall
Pcap viewerWireshark, tsharkwireshark.org, or your package manager
Request consolecurlalready installed on most systems
Notebookpython3 with requestspython.org; pip install requests
DecoderCyberChef (any browser), or base64, xxd, Pythongchq.github.io/CyberChef, or nothing
Hex viewerxxd, strings, fileincluded in Linux and macOS

A safe place to work

Puzzle files are real malware samples, given harmless names (.txt, .sample) so they never run by accident. Keep it that way:

  • Work in one folder, such as ~/necropsy.
  • Read samples; do not run them. When a puzzle needs a binary run, it says so, and you do it in a virtual machine with no network, not on your own system.
  • Your antivirus may flag samples. That is expected: they are malware. Excluding one folder is safer than turning protection off.

Installing

Linux (Debian, Ubuntu):

sudo apt install wireshark tshark curl python3 python3-pip python3-requests python3-cryptography xxd binutils
sudo usermod -aG wireshark "$USER"     # capture without root; log out and in again

macOS: install Homebrew from brew.sh, then:

brew install --cask wireshark
brew install python
python3 -m pip install requests cryptography

curl, xxd and strings are already there.

Windows: install Wireshark (tshark is included) from wireshark.org and Python from python.org (tick Add python.exe to PATH), then in PowerShell:

py -m pip install requests cryptography
curl.exe --version

In PowerShell, curl is an alias for Invoke-WebRequest; always type curl.exe. WSL (wsl --install) gives you a full Linux shell where every command in these modules works as written.

Check it works

tshark --version
curl --version
python3 -c "import requests, cryptography; print('ok')"

Walkthrough: in the browser

Showing the browser path.

This module is the same on both paths: it moves you to the terminal. Follow the install steps in the concept above for your system, then redo two puzzles you already solved in the browser.

Module 1 again, with tshark

  1. On the puzzle page of First capture, download capture.pcap (the Raw link, or Files in the workspace).
  2. Open a terminal in the folder you saved it to.
  3. Run the command from the workspace's pcap viewer Terminal line: tshark -r capture.pcap -Y http.request.
  4. Get the host and path of each request: tshark -r capture.pcap -Y http.request -T fields -e http.host -e http.request.uri.
  5. Open the same file in Wireshark, filter http.request, and Follow > HTTP Stream on the download.

Module 3 again, with curl

  1. Start the Knock knock instance.
  2. Run the same commands you sent from the console, with curl -i in your terminal. The console's Request sent and curl -v show the same request.
  3. Then the same in Python with requests, as in module 7.

When both work, you have everything the tier 4 and 5 puzzles need.

Practice

Checkpoint

Answers from either path count.