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.
# In Wireshark: follow TCP stream on port 9001 to read the decrypt command# Follow TCP stream on port 9002, show data as Hex, copy and paste into xxdxxd -r -p file.hex file.des3openssl des3 -d -salt -in file.des3 -out flag.txtcat flag.txtSolution
Want to try it yourself first?
The guided walkthrough reveals hints one step at a time.
Step 1Follow the chat stream
ObservationThe 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.
Step 2Extract the encrypted file and decrypt it
ObservationThe 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. Usexxd -r -pto 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 hexbashxxd -r -p file.hex file.des3bashopenssl des3 -d -salt -in file.des3 -out flag.txtbashcat flag.txtExpected 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 -precreates the original binary file without needing tcpflow or tshark. The-rflag reverses the dump (hex to binary) and-pselects plain hex format with no address offsets.Triple DES applies DES three times per block. The openssl command the chat specifies uses
des3 -dto decrypt,-salt(an encryption-side option that OpenSSL simply accepts here, since the Salted__ header is detected automatically on decrypt), and-in/-outfor 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.