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
Walk me through it- Step 1Follow the chat streamIn 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 itIn Wireshark, follow the TCP stream on port 9002. Switch the display to Hex and copy the raw hex data. Use
xxd -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.txtLearn 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,-saltto indicate the ciphertext has a random salt prepended, and-in/-outfor the file paths. 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.
Flag
picoCTF{nc_73115_411_0ee72...}
A perfect example of why you should never discuss crypto keys in plaintext channels.