背景
- 原始
You’re an agent with a government law enforcement agency. You’ve been tracking a group of criminal hackers known as “TufMups”. This group either keeps a low profile, your agency’s capacity to run investigations on the internet is very poor, or some combination of those two factors. Up until two days ago you had an active relationship with an informant who went by the handle “K3anu”. As you walked into your office you received a package containing a flash drive, a printed screenshot (at the top of this blog post) and a very short note. “Review this PCAP. It will all make sense. Woaaahhhh. – K3anu” That package was the last you heard from K3anu.
步骤
01 What is the start time of the PCAP (“Date and Time of Day” in CST setting in Wireshark round to nearest second)?
|
|
02 What is the end time of the PCAP (“Date and Time of Day” in CST setting in Wireshark round to nearest second)?
|
|
03 How many total packets were sent between the host and the hacker website IP?
Using the Endpoints screen we can quickly summarise the traffic sent between each IP address in the capture. We know from the provided screenshot that the server we are interested in has the IP address 104.131.112.255
By checking against our IP of interest we can see that 15,128 packets were exchanged.
|
|
04 What is the hostname of the system the PCAP was recovered from? (all caps)
We only have one DHCP request in our capture and it matches the IP address of our capturing system. Examining the packet details we find the hostname:
|
|
05 What exact version of browser did K3anu use? (exact number only)
We can find the web browser user-agent string by filtering for HTTP requests made by K3anu’s system:
|
|
Examining a request gives us the following string:
|
|
K3anu was using Chrome 63.0.3239.84
|
|
06 What operating system did K3anu use? (Name and number only)
We already have the answer to this from Question 5:
|
|
07 How many DNS queries in the PCAP received NXdomain responses?
We can filter for DNS packets where the Response Code is set to 3, indicating that the domain did not exist.
|
|
|
|
08 – What is the hidden message in the TufMups website? (decoded)
If the TufMups website were still online we could simply visit it and take a look. Unfortunately it was offline when I did this CTF but we can use our network forensics skills to find out what it looked like.
By filtering on HTTP traffic between K3anu’s system and the TufMups server, and following the HTTP Stream (#2879), we can see the HTML source including an interesting comment.
|
|
Follow the HTTP Stream
|
|
From the character set this looks like base64, but decoding it only gives us:
|
|
Maybe it is encrypted rather as well as encoded. CyberChef has a collection of cipher functions that we can try, including an XOR Brute Force module. By default the module will attempt single-byte keys and display the output.
|
|
09 What is the key to decode the secret message in the TufMups website?
From our work on Question 8 we know the key:
|
|
10 How did K3anu get access to the file? (lowercase, just protocol)
The hidden message in the TufMups website mentions FTP credentials, so that is a good starting point. We can filter on FTP traffic, and follow the TCP Stream (#4075) for easier reading.
|
|
We can see that two files were downloaded to K3anu’s machine – decrypttool.exe and mupfullz2017.zip. Those are probably worth remembering for later.
|
|
11 What’s the nickname of the operator on the IRC channel?
Similarly, we can filter on IRC traffic and follow the TCP Stream (#2930) for easier reading.
|
|
IRC operators typically have @ before their nickname so they can be identified.
|
|
12 What is the 1st operation needed to decode the IRC users “secure” comms? (just the format name)
Scrolling through the IRC chat between K3anu and the TufMups we see a few messages that stand out. With context from the questions, there are four steps required to make them legible.
|
|
From the character set (and because it’s almost always the first thing I try) let’s assume base64 encoding.
|
|
13 What is the 2nd operation needed to decode the IRC users “secure” comms? (just the format name)
Our result from Question 12 looks like Hex encoding, but the character set has been shifted. Using CyberChef we can easily apply rot13.
|
|
14 What is the 3rd operation needed to decode the IRC users “secure” comms? (just the format name)
|
|
15 What is the 4th and final operation needed to decode the IRC users “secure” comms? (2 words lowercase)
|
|
It is obviously morse code.
|
|
Now that we know the required steps we can decode the remaining “secure” messages in the captured IRC chat.
|
|
16 What is the password to decrypt the zip file that was downloaded by K3anu?
The TufMups have given K3anu a test – decrypt a file from their FTP server. In Question 10 we saw K3anu download two files from the TufMups FTP server; we need to extract them from the PCAP.
Filter on ftp-data to show the file transfer traffic, then follow the TCP Stream for the ZIP file (#4079)
|
|
Select the Raw radio button and Save As. We have our ZIP file, but we need a password to open it.
There are a few tools capable of cracking ZIP passwords; my goto is John The Ripper.
First, we use the zip2john utility to extract the hashed password from the ZIP.
|
|
Then, use John with the RockYou wordlist to crack the extracted hash.
|
|
Return:
|
|
Get the password:
|
|
17 How many total rows of “fullz” are represented in the file?
After extracting the ZIP file we are presented with a CSV – tufmups_fullz_dec17.csv
We can check the number of lines in the file with a simple bash command
|
|
Subtracting one row to account for the column headers, we have 13377 rows of “fullz”.
|
|
18 How many people in the fullz are named Joshua, have a MasterCard, and use an OS X system?
This can be solved with a bit more command-line work; using grep to filter only the characteristics we are looking for, and wc to count the matching rows.
|
|
|
|
19 What IP and port does the executable connect to? ip:port
Remember K3anu downloaded decrypttool.exe from the FTP server as well as the ZIP file? And how the TufMups were going to feed some false data to confirm their suspicions? We’re getting back to that now.
Using the same technique as for Question 16, we can extract decrypttool.exe from the PCAP (TCP Stream #4077)
|
|
Run this program in windows and using wireshark to analyze its traffic.
|
|
20 What was used to compile the malicious executable?
The icon of this program is related to python.
|
|
21 What executable did K3anu likely use to download files from the remote server? (exactly as written in source material)
We know that the TufMups found out about K3anu’s real identity, and that K3anu downloaded an executable that connects back to the TufMups server on an unusual port. Let’s see if there is anything in the PCAP to shed light on what the TufMups found.
Filter for traffic on the IP address and source used by the TufMups binary.
|
|
Follow the TCP Stream (#4082) for easier reading. Our malicious binary is acting as a reverse shell into K3anu’s machine!
Reading through the stream we can see a list of running processes. Based on the process names, the only dedicated FTP client is WinSCP.exe
|
|
22 What is the host system’s exact BIOS version?
We can use the same TCP Stream (#4082) to answer the next few questions as well. The output of the systeminfo command lists the exact BIOS version.
|
|
23 What is the filename of the first file taken from K3anu’s computer?
|
|
24 What is the filename of the second file taken from K3anu’s computer?
|
|
25 What utility was used to steal the files from K3anu’s computer?
|
|
26 What destination port was used to steal the files from K3anu’s computer?
|
|
27 What is the password to decrypt the file stolen from K3anu’s computer? (lowercase)
There were two ZIP files transferred from K3anu’s machine – trueidentity.zip and trueidpwhelp.zip – extract them both from the PCAP using the same technique as Question 16 and Question 19.
I started with trueidpwhelp.zip (#4785) – which didn’t require a password – and contained two images of airports. The Comment field in the EXIF data gave a clue.
|
|
My guess was that the IATA airport codes for the respective images would lead to the password for trueidentity.zip(#4780), but I don’t have time for OSINT. Let’s try cracking the password first.
Same procedure as Question 16. First run zip2john to extract the hash, then john itself to perform the cracking.
|
|
Now we get the password:
|
|
28 What is K3anu’s real identity?
|
|
29 The hacker left a message for law enforcement on K3anu’s system, what was it? (message only)
Reading to the end of the traffic sent by decrypttool.exe (TCP Stream #4082) we can see the final message left for the investigators.
|
|