Skip to main content

Eavesdrop picoCTF 2022 Solution

Analyze a network packet capture to reconstruct a file transfer and recover the flag.

Published: July 20, 2023Updated: August 25, 2026

Description

A packet capture contains an encrypted attachment plus a plaintext conversation describing how to decrypt it. Follow the TCP streams in Wireshark to find the decrypt command, extract the binary data, and run openssl des3 to reveal the flag.

Open the PCAP in Wireshark. Browse packets until you see a TCP stream with readable chat text (port 9001).

Right-click a packet in the chat stream and choose Follow > TCP Stream to read the conversation.

The conversation includes the openssl decrypt command and the password.

Find the binary transfer on port 9002, follow that stream, save the raw data as a hex dump, then convert to binary with xxd.

Run the openssl command from the chat to decrypt the file.

bash
# In Wireshark: follow TCP stream on port 9001 to read the decrypt command
bash
# Follow TCP stream on port 9002, show data as Hex, copy and paste into xxd
bash
xxd -r -p file.hex file.des3
bash
openssl des3 -d -salt -in file.des3 -out flag.txt
bash
cat flag.txt

Solution

Want to try it yourself first?

The guided walkthrough reveals hints one step at a time.

Walk me through it
  1. Step 1Follow the chat stream
    Observation
    The capture holds several TCP streams on distinct ports, and some packets carry small ASCII payloads that look like a text chat. Following that stream in Wireshark should show the plaintext conversation, openssl command and password included.
    In Wireshark, filter by port 9001 or browse packets with 41-byte payloads. Right-click a matching packet and choose Follow > TCP Stream. The conversation contains the openssl command and password in plain text.
    Learn more

    Wireshark's Follow TCP Stream reassembles all TCP segments from a conversation and displays the payload in order. Both sides of the chat are shown with different colors. The password and the exact openssl command to use both appear verbatim - there is no encryption on the chat channel, which is the vulnerability being demonstrated.

    Inside the chat stream, the password appears verbatim in one of the messages where one party tells the other how to decrypt the file. There is no key exchange, no key derivation - it is just typed into a TCP socket in cleartext. That is the entire vulnerability illustrated by this challenge.

  2. Step 2Extract the encrypted file and decrypt it
    Observation
    The chat on port 9001 mentions a separate binary transfer and spells out an openssl des3 decrypt command with its password. The encrypted attachment is going over the other stream on port 9002, ready to be extracted and decrypted with those credentials.
    In Wireshark, follow the TCP stream on port 9002. Switch the display to Hex and copy the raw hex data. Use xxd -r -p to convert it to binary, saving the result as file.des3. Then run the openssl des3 decrypt command from the chat conversation to produce the plaintext flag file.
    bash
    # In Wireshark: follow TCP stream port 9002, show as Hex, copy all hex
    bash
    xxd -r -p file.hex file.des3
    bash
    openssl des3 -d -salt -in file.des3 -out flag.txt
    bash
    cat flag.txt

    Expected output

    picoCTF{nc_73115_411_0ee7267a}
    What didn't work first

    Tried: Save the TCP stream from Wireshark using 'Save as' in raw mode instead of copying the hex manually

    Wireshark's stream save defaults to ASCII or mixed mode depending on the display setting, and newline conversion corrupts binary data. Switch the display to Hex Dump or Raw, copy the hex digits, and run them back through xxd -r -p for a clean binary.

    Tried: Assume the -salt flag is what makes decryption work, and go hunting for a different flag when the output still looks wrong

    -salt is an encryption-side option: OpenSSL writes a Salted__ marker plus 8 salt bytes when encrypting, and on decryption it detects that header automatically whether or not you repeat -salt. Copying the command from the chat verbatim is fine, but if the plaintext comes out as garbage the cause is elsewhere: a mistyped password, or hex that picked up stray bytes from the ASCII side of the stream.

    Learn more

    Wireshark can show stream data as raw hex. Copying that hex and converting it with xxd -r -p recreates the original binary file without needing tcpflow or tshark. The -r flag reverses the dump (hex to binary) and -p selects plain hex format with no address offsets.

    Triple DES applies DES three times per block. The openssl command the chat specifies uses des3 -d to decrypt, -salt (an encryption-side option that OpenSSL simply accepts here, since the Salted__ header is detected automatically on decrypt), and -in / -out for the file paths. The chat pastes the password straight into the command with -k supersecretpassword123; drop that argument and OpenSSL prompts for the same password interactively. The deeper lesson: encryption without secure key exchange is useless. TLS solves this with Diffie-Hellman or RSA key exchange so the secret never traverses the wire in cleartext.

Interactive tools
  • Hex ViewerView text or raw hex bytes as a xxd-style hex dump with byte offset, hex columns, and ASCII sidebar. Highlights printable characters and null bytes.
  • Strings ExtractorPull printable text from any binary, library, or image. ASCII and UTF-16 detection, configurable minimum length, flag-like highlight, no command line needed.

Flag

Reveal flag

picoCTF{nc_73115_411_0ee7267a}

A perfect example of why you should never discuss crypto keys in plaintext channels.

Key takeaway

Plaintext protocols expose everything to anyone capturing the traffic, so a capture holding both an encrypted attachment and an unencrypted conversation about decrypting it hands over the key alongside the ciphertext. Follow TCP Stream reassembles a conversation from individual packets into readable content, which is the core move in protocol forensics. The lesson is that confidentiality needs encryption in transit, because anything sent in the clear can be rebuilt off the wire.

Related reading

Useful tools for Forensics

Where to go next