// HackTheBox  ·  writeup

LogForge

HackTheBox Medium EvtxECmdPECmdAmcacheParserSQLitePython
DFIR

Scenario

This Sherlock provides players with an opportunity to analyze a compromised Windows workstation following a variant of ClickFix social engineering attack, where the victim is tricked into executing a malicious command via File Explorer, leading to reverse shell execution and persistence.

Executive Summary

A user on a Windows workstation opened Chrome and landed on a phishing page that told them to paste a command into the File Explorer address bar. The pasted command made PowerShell pull a reverse-shell script from a host on the local network. A Notepad window with a message from the attacker followed, and a payload masquerading as a Windows update binary was dropped into the Windows temp folder. That payload created a scatter of junk-named directories, staged a batch file by copying a data file over itself, and used a renamed AutoIt interpreter to drop a script. The malware then looked for common antivirus processes and finished by writing a Startup-folder shortcut that relaunches the script at every logon. Sysmon in the event logs carries nearly the whole chain; the prefetch, browser history and $MFT fill the gaps.

Artifacts

Timestamp note: Q1 and Q2 want YYYY-MM-DD hh:mm:ss. Sysmon, Security and prefetch all agreed on the same clock, so no conversion was needed.

Initial Access

Q1 — When was the user's last successful login to the system?

Parse the event logs to CSV and filter Security 4624 for the interactive logon of the user account (LogonType 2, console logon). The latest one for that account is the answer; service and system logons around it are noise.

EvtxECmd -d evidence/winevt/Logs --csv work/evtx --csvf evtx.csv
grep ',4624,' work/evtx/evtx.csv | grep -i 'user'
Click flag to reveal 2025-08-11 06:46:52
Q2 — When did the victim last open the browser they regularly used on the system?

The user’s regular browser is Chrome, so the CHROME.EXE prefetch file holds the last run time. Sysmon process creation for Chrome gives the same second.

PECmd -d evidence/Windows/prefetch --csv work/pf
Click to reveal answer 2025-08-11 07:12:17
Q3 — The user accessed a malicious website as a result of phishing attempt. What is the URL?

From Q2 Chrome started at 07:12:17, so look for the visit seven seconds later. Copy the Chrome History database out of the profile and read the urls table by last visit time. The only unfamiliar site at 07:12:24 is a randomly named Netlify subdomain, which is the lure page.

sqlite3 work/sql/History "select url, datetime(last_visit_time/1000000-11644473600,'unixepoch') from urls order by last_visit_time desc limit 10"
Click flag to reveal https://cool-bunny-55393d.netlify.app/

Execution

Q4 — After the user visited the website, they were directed to copy a command from the website and enter it into the File Explorer search bar. Shortly after, strange behavior was noticed. What is the full URL that installed the reverse shell on the victim's device?

Sysmon Event ID 1 (process creation) shortly after the Q3 visit shows powershell.exe at 07:12:51 running an IEX of a DownloadString call. The download target is an internal address on port 8000 serving a .ps1, which makes the attacker’s staging host a machine on the same network.

grep -i 'DownloadString' work/evtx/evtx.csv
Click to reveal answer http://192.168.26.128:8000/rev.ps1
Q5 — This attack preys on non-technical users by luring them into traps and manipulating them into unknowingly executing commands on the system. Based on the analysis of the previously identified command, what is this type of attack called?

This one was reasoned, not read from an artifact. The scenario calls the attack a variant of ClickFix, and the Q4 evidence shows the delivery: a command pasted into the File Explorer address bar rather than the Run dialog or a terminal. That File Explorer variant is called FileFix.

Gotcha: The generic name, ClickFix, is the obvious answer and is not what was accepted. The scenario’s word “variant” and the File Explorer paste point at the specific name.

Click flag to reveal FileFix
Q6 — After the attack, the user noticed that Notepad had opened with a message left by the attacker. What is the email address of the attacker?

Nothing in the event logs carried the message text, so search the evidence for the file Notepad opened. A README.txt turns up in the $MFT. It is small enough to be resident, meaning its content is stored inside the MFT record itself and no tool surfaces it. Locate the record, then read the resident data attribute with a short Python script.

grep -rla README.txt evidence/

Tip: Resident $MFT data is invisible to normal MFT parsers’ CSV output, so carve the record’s data attribute directly.

Click to reveal answer [email protected]
Q7 — The attacker downloaded malware to infect the victim's device. What is the full path of the malicious malware file?

Sysmon Event ID 1 and Event ID 11 (file create) both show an executable named like a Windows update dropped in the Windows temp folder. A Windows update does not live there, and the Amcache entry agrees it was newly seen.

AmcacheParser -f evidence/Windows/AppCompat/Programs/Amcache.hve --csv work/amc
grep -i 'WindowsUpdate' work/amc/*.csv
Click flag to reveal C:\Windows\Temp\WindowsUpdate.exe
Q8 — What is the product name of this malicious file?

The Sysmon Event ID 1 record for the Q7 binary includes the PE Product field from its version resource. It names the product something unrelated to Windows Update, which confirms the filename was a disguise.

grep -i 'WindowsUpdate.exe' work/evtx/evtx.csv
Click to reveal answer Virtuoso
Q9 — The malware created several directories on the system. Under which path were these files created?

Filter Sysmon Event ID 11 for the Q7 binary as the creating process. It creates a run of oddly named directories (MatthewSouthern, CombinedStarts, PastDesigns and others) that all sit directly under the same parent, the Windows folder itself.

grep -i 'WindowsUpdate.exe' work/evtx/evtx.csv | grep -i 'MatthewSouthern'
Click flag to reveal C:\Windows\
Q10 — A script file was staged on the machine by the malware. What is the full command used to achieve this?

Follow the children of the Q7 process in Sysmon Event ID 1. A cmd.exe /c launches a copy of a file with no extension onto the same name with .bat added, then runs the result. The format mask in the task matches this shape.

grep -i 'Cricket' work/evtx/evtx.csv
Click to reveal answer "C:\Windows\System32\cmd.exe" /c copy Cricket Cricket.bat & Cricket.bat
Q11 — What is the full path of the staged script file?

From Q10 the batch file is Cricket.bat. The Sysmon Event ID 11 record for its creation gives the full path, in the user’s Temp folder.

grep -i 'Cricket.bat' work/evtx/evtx.csv
Click flag to reveal C:\Users\user\AppData\Local\Temp\Cricket.bat
Q12 — The attacker dropped an automation utility on the system with a legacy file format. What is the full path of this newly dropped file?

The batch file from Q11 builds a working directory in Temp with a numeric name and writes a .pif file there. .pif is the legacy format. Sysmon’s OriginalFileName for that process is AutoIt3.exe, so the .pif is a renamed AutoIt interpreter. The Amcache entries for it back this up.

grep -iE 'Intranet|\.pif' work/amc/*.csv
Click to reveal answer C:\Users\user\AppData\Local\Temp\316094\Intranet.pif
Q13 — What is the name and version of the utility?

The Sysmon Event ID 1 record for Intranet.pif carries the original filename and a FileVersion of 3, 3, 14, 3. Rewrite that in the format the task wants.

grep -i 'Intranet.pif' work/evtx/evtx.csv
Click flag to reveal AutoIt 3.3.14.3
Q14 — Using this utility, the attacker dropped another script on the system. What is the name of this script?

Filter Sysmon Event ID 11 for files created by Intranet.pif as the process image. It writes one script, a .js file named after the malware’s product from Q8.

grep -i 'Intranet.pif' work/evtx/evtx.csv | grep -i 'Virtuoso'
Click to reveal answer Virtuoso.js

Discovery

Q15 — In order to evade defenses for unattended access, the malware executed commands to look for EDR and antivirus presence on the system. What is the full command line of the second command used to achieve this?

Sysmon Event ID 1 shows the AV and EDR checks as a pair of commands launched from the staged script’s process tree. The second is a findstr -I over a quoted list of vendor process names (Avast, AVG, Bitdefender, Norton, Sophos).

grep -i 'findstr' work/evtx/evtx.csv

Gotcha: The Sysmon CommandLine field shows a double space after findstr. The accepted answer has a single space, so normalise it.

Click flag to reveal findstr -I "avastui avgui bdservicehost nswscsvc sophoshealth"

Persistence

Q16 — What is the full command used to set up persistence on the system?

The last notable Sysmon Event ID 1 is a cmd /k at 07:32:49 that writes a two-line .url file into the user’s Startup folder. The URL= value points at the Q14 script, so it runs at every logon.

grep -i 'Startup' work/evtx/evtx.csv | grep -i 'InternetShortcut'
Click to reveal answer cmd /k echo [InternetShortcut] > "C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Virtuoso.url" & echo URL="C:\Users\user\AppData\Local\Immersive Creations Co\Virtuoso.js" >> "C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Virtuoso.url" & exit

Attack Summary

PhaseAction
Initial AccessUser logs on and opens Chrome, then visits a phishing page on Netlify
ExecutionPasted command in File Explorer runs PowerShell, which fetches a reverse shell from an internal host
ImpactNotepad opens with a message and contact email from the attacker
ExecutionDisguised update binary dropped in the Windows temp folder, product name is Virtuoso
ExecutionMalware creates junk-named directories under the Windows folder
ExecutionBatch file staged with a copy-over-itself trick, then a renamed AutoIt interpreter runs and drops a script
Discoveryfindstr checks for common AV and EDR processes
PersistenceStartup-folder .url shortcut relaunches the dropped script at logon

Forensic Timeline

TimestampEvent
2025-08-11 06:46:52Last successful interactive logon of user
2025-08-11 07:12:17Chrome last opened
2025-08-11 07:12:24Phishing page visited in Chrome
2025-08-11 07:12:51PowerShell downloads and runs rev.ps1
2025-08-11 07:32:49Startup-folder persistence command runs

IOCs

TypeValue
URL (phishing)hxxps[://]cool-bunny-55393d[.]netlify[.]app/
URL (payload)hxxp[://]192[.]168[.]26[.]128:8000/rev.ps1
Email0xSh3rl0cK@protonmail[.]com
FileC:\Windows\Temp\WindowsUpdate.exe (product name Virtuoso)
FileC:\Users\user\AppData\Local\Temp\Cricket.bat
FileC:\Users\user\AppData\Local\Temp\316094\Intranet.pif (AutoIt 3.3.14.3)
FileVirtuoso.js in C:\Users\user\AppData\Local\Immersive Creations Co\
FileVirtuoso.url in the user’s Startup folder

MITRE ATT&CK

TechniqueIDDescription
Phishing: Spearphishing LinkT1566.002Lure page reached through a phishing link
User Execution: Malicious Copy and PasteT1204.004Victim pasted the attacker’s command into the File Explorer address bar
Command and Scripting Interpreter: PowerShellT1059.001IEX of a remote rev.ps1
Ingress Tool TransferT1105Reverse shell script and the disguised binary pulled onto the host
Command and Scripting Interpreter: Windows Command ShellT1059.003cmd /c batch staging and the persistence cmd /k
Software Discovery: Security Software DiscoveryT1518.001findstr over AV and EDR process names
Boot or Logon Autostart Execution: Registry Run Keys / Startup FolderT1547.001.url shortcut in the Startup folder

Defender Takeaways

Treat a PowerShell child of explorer.exe as hostile. A user typing into the File Explorer address bar should never lead to powershell.exe fetching a script with IEX and DownloadString. Sysmon process creation caught this at 07:12:51, so alerting on that parent-child pair would have fired within seconds of the paste.

Sysmon was the whole investigation, so keep it on and keep it long. Process creation and file-create events gave the payload, the staging command, the AV check and the persistence command with full command lines. Without them, the same questions would have needed prefetch, Amcache and $MFT carving.

Flag version-resource mismatches. A binary named WindowsUpdate.exe in C:\Windows\Temp with a Product of something else, and a .pif whose OriginalFileName is AutoIt3.exe, are both cheap detections. Compare the on-disk name against the PE metadata and alert when they disagree.

Watch the Startup folder for .url files. The persistence command writes a shortcut through cmd /k echo, which is easy to match on InternetShortcut plus a Startup path. A file-create rule for that folder gives the same coverage.

User awareness has to cover the File Explorer variant. Training that only warns against the Run dialog misses a paste into the address bar. The lure works because the pasted text looks like a path or a search.

Conclusion

The attacker got a reverse shell, a malware drop and logon persistence from one pasted command, without exploiting a single vulnerability. The whole chain was visible in Sysmon within about twenty minutes, so the lesson is detection on the process tree rather than on any one file.