Jinkies Sherlock Walkthrough
Investigation of shared-folder abuse and data exfiltration: registry share enumeration, NTUSER.DAT RecentDocs, SAM hash extraction, and MFT recovery of a deleted file.
Solved Jinkies from Hack The Box!
Jinkies — HackTheBox Sherlock Walkthrough
Attack Timeline
| Time (UTC) | Event | Evidence Source |
|---|---|---|
| Pre-Exploitation | ||
| 2023-09-20 10:28:14 | Shared folders configured (Users, Documents) | Registry: LanmanServer\Shares |
| 2023-09-20 13:05:17 | Velma accesses .ibd database files |
RecentDocs |
| Attack Day — 2023-10-06 | ||
| 17:15:56 | First network logon from 192.168.157.151 (LogonType 3) | Security Event 4624 |
| 17:16:09 | Second network logon | Security Event 4624 |
| 17:17:23 | Interactive logon (LogonType 3) — LogonId: 0x3e4 | Security Event 4624 |
| 17:17:24 | RDP session established (LogonType 10) — LogonId: 0x20f48f7 | Security Event 4624 |
| 17:17:25 | Windows session initialization (explorer.exe, userinit.exe) | Sysmon Event 1 |
| 17:17:43 | Attacker opens cmd.exe | Sysmon Event 1 |
| 17:17:45 | First command: whoami | Sysmon Event 1 |
| 17:17:52 | Account enumeration: net group |
Sysmon Event 1 |
| 17:17:56 | User enumeration: net users |
Sysmon Event 1 |
| 17:18:26 | Opens VSCode with Version-1.0.1 - TERMINAL LOGIN.py |
Sysmon Event 1 |
| 17:18:41 | Launches Chrome browser | Sysmon Event 1 |
| 17:19:35 | Visits pastes.io (data exfiltration) | Chrome History |
| 17:21:44 | Accesses Version-1.0.1 - TERMINAL LOGIN.py again |
RecentDocs (.py) |
| 17:23:50 | Creates learn.txt containing handle pwnmaster12 |
RecentDocs (.txt) |
| 17:37:33 | Last RecentDocs timestamp | NTUSER.DAT |
| Post-Attack | ||
| 2023-10-06 | Attacker deletes learn.txt to cover tracks |
MFT recovery |
Q1 — Which folders were shared on the host?
Answer: C:\Users, C:\Users\Velma\Documents
Methodology
Using RegRipper shares plugin
$ regripper -r Jinkies_KAPE_output/TriageData/C/Windows/system32/config/SYSTEM -p shares
RegRipper shares output
- Permissions 0 = Everyone (full access) — CRITICAL exposure
- Permissions 9 = Read + Full Control — exposes all files in Documents
- MITRE ATT&CK: T1135 (Network Share Discovery)
Q2 — What was the file that gave the attacker access to the user’s account?
Answer: bh_db.ibd
Methodology
Using RegRipper’s recentdocs plugin on Velma’s NTUSER.DAT:
$ regripper -r NTUSER.DAT -p recentdocs
The output shows recently accessed .ibd files (MySQL InnoDB tablespace):
.ibd
LastWrite Time: 2023-09-20 13:05:17Z
MRUListEx = 1,0
1 = bk_db.ibd
0 = login.ibd
The Most Recently Used List Extended order shows bk_db.ibd as the most recently accessed, containing user credentials.
Q3 — How many user credentials were found in the file?
Answer: 216
Methodology
Use the strings command to extract readable text from the binary .ibd file, then count email addresses using regex:
$ strings bk_db.ibd | grep -cE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
216
Q4 — What is the NT Hash of the user’s password?
Answer: 967452709ae89eaeef4e2c951c3882ce
Methodology
NT hashes (NTLM hashes) are stored in the SAM (Security Account Manager) registry hive, which is protected by the SYSTEM hive. To extract them offline, we need both the SAM and SYSTEM hives — and optionally the SECURITY hive for additional credential material like cached domain credentials and LSA secrets.
Step 1 — Locate the registry hives in the triage data
The Windows registry hives are located at:
TriageData/C/Windows/system32/config/SYSTEM
TriageData/C/Windows/system32/config/SAM
TriageData/C/Windows/system32/config/SECURITY
These are the raw registry hive files — they don’t have extensions. The .LOG1 and .LOG2 files alongside them are transaction logs that can be used for hive recovery if the main hive is corrupted.
Step 2 — Extract hashes using impacket-secretsdump
impacket-secretsdump is the go-to tool for offline extraction of Windows credentials from registry hives. It parses the SAM database structure and decrypts the password hashes using the boot key derived from the SYSTEM hive:
$ sudo impacket-secretsdump \
-system TriageData/C/Windows/system32/config/SYSTEM \
-sam TriageData/C/Windows/system32/config/SAM \
-security TriageData/C/Windows/system32/config/SECURITY \
LOCAL
secretsdump output
From the output we can see all local accounts:
[*] Target system bootKey: 0x0fcab1a9630872ac6f23b1d98a3d9ed6
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:b47a9f2da3e6d7b88213822b52232627:::
test:1001:aad3b435b51404eeaad3b435b51404ee:3dbde697d71690a769204beb12283678:::
Velma:1002:aad3b435b51404eeaad3b435b51404ee:967452709ae89eaeef4e2c951c3882ce:::
The NT hash for Velma (RID 1002) is: 967452709ae89eaeef4e2c951c3882ce
Q5 — Is the user’s computer password the same as the password found in the .ibd file?
Answer: Yes
Methodology
To answer this question, we need to:
- Extract Velma’s password from the
.ibddatabase file - Compare it against Velma’s NT hash from the SAM dump (Q4)
Step 1 — Extract Velma’s credentials from the .ibd file
Filter the database strings for Velma’s account specifically:
$ strings bk_db.ibd | grep gmail | grep velma
Velma’s database record
The output reveals Velma’s record from the logon website database:
peakTwins2023fc velma.dinkley@gmail.com velmavelma dinkley
The password stored in the database is: peakTwins2023fc
Step 2 — Verify against the NT hash using hashcat
Save the NT hash (from Q4) to a file and the extracted password to a wordlist:
# hashes.txt contains: 967452709ae89eaeef4e2c951c3882ce
# password_Test.txt contains: peakTwins2023fc
$ hashcat hashes.txt password_Test.txt
hashcat cracking result
Hashcat confirms the match:
967452709ae89eaeef4e2c951c3882ce:peakTwins2023fc
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 1000 (NTLM)
Hash.Target......: 967452709ae89eaeef4e2c951c3882ce
Candidates.#1....: peakTwins2023fc -> peakTwins2023fc
Q6 — What was the time the attacker first interactively logged on to our user’s host?
Answer: 2023-10-06 17:17:23 UTC
Methodology
To determine when the attacker first interactively logged on, we need to analyze Windows Security Event Log Event ID 4624 (Successful Logon). The key field is LogonType, which indicates the method of logon:
| LogonType | Description |
|---|---|
| 2 | Interactive (local console) |
| 3 | Network (e.g., shared folder access) |
| 10 | RemoteInteractive (RDP) |
| 5 | Service (service account) |
Step 1 — Extract Security Event 4624 logs
Using chainsaw (or directly from the EVTX), filter for Event ID 4624 and look for the target user (Velma):
$ jq '[.[] | select(.Event.System.EventID == 4624) | {time: .Event.System.TimeCreated_attributes.SystemTime, user: .Event.EventData.TargetUserName, logonType: .Event.EventData.LogonType, ip: .Event.EventData.IpAddress}] | map(select(.user == "Velma" and (.logonType == 3 or .logonType == 10))) | sort_by(.time)' chainsaw-all.json
Output:
alt text
Step 2 — Identify the first interactive logon
Looking at Velma’s logon events:
- 17:15:56 — LogonType 3 from 192.168.157.151 (network logon, likely from SMB share access)
- 17:16:09 — LogonType 3 from 192.168.157.151
- 17:17:23 — LogonType 3 from local (no IP) — this is the first interactive logon
- 17:17:24 — LogonType 10 (RDP) from 192.168.157.151
The first interactive logon occurs at 2023-10-06 17:17:23 UTC, marked by LogonType 3 (Network/Interactive) with no source IP, indicating the session was established locally.
Q7 — What’s the first command the attacker issues into the Command Line?
Answer: whoami
Methodology
- Identify attacker logon time (17:17:23 from Q6)
- Search Sysmon Event ID 1 for processes after that time
$ jq '.[] | select(.Event.System.Provider_attributes.Name == "Microsoft-Windows-Sysmon" and .Event.System.EventID == 1 and .Event.EventData.UtcTime > "2023-10-06 17:17:23" and .Event.EventData.User == "VELMAD100\\Velma" and .Event.EventData.ParentImage == "C:\\Windows\\System32\\cmd.exe") | "\(.Event.EventData.UtcTime): \(.Event.EventData.ParentImage) --> \(.Event.EventData.Image)"' chainsaw-all.json
- Filter output:
- ParentProcess: cmd.exe (not system processes like services.exe)
- User: VELMAD100
- Time: After 17:17:23
- Sort by timestamp - first entry is the answer Output
2023-10-06T17:17:45.697Z: C:.exe –> C:.exe
The attacker ran whoami at 17:17:45 to verify their user context.
—
The first command executed by the attacker is whoami, run at 2023-10-06 17:17:45 UTC.

Q8 — What is the name of the file that the attacker opens in VSCode shortly before launching the web browser?
Answer: Version-1.0.1 - TERMINAL LOGIN.py
Using Splunk to search the chainsaw JSON output for VSCode process creation:
source="chainsaw-all.json"
Event.System.EventID=1
Event.EventData.User="VELMAD100\Velma"
Event.EventData.ParentUser="VELMAD100\Velma"
Event.EventData.ParentImage="C:\Users\Velma\AppData\Local\Programs\Microsoft VS Code\Code.exe"
| table Event.EventData.UtcTime Event.EventData.User Event.EventData.ParentImage Event.EventData.ParentCommandLine
| sort Event.EventData.UtcTime
alt text
The result shows VSCode was launched with the file Version-1.0.1 - TERMINAL LOGIN.py as an argument
Q9 — What’s the domain name of the location the attacker likely exfiltrated the file to?
Answer: pastes.io
Methodology
Since no DNS events (Sysmon Event ID 22) were captured for the attacker’s activity, we turn to Chrome browsing history to identify where data was exfiltrated.
$ sqlite3 History "SELECT url, last_visit_time FROM urls WHERE url LIKE '%paste%' ORDER BY last_visit_time DESC;"
Chrome history showing pastes.io visit pastes.io is a paste site commonly used for sharing text anonymously. Attackers leverage such services to exfiltrate stolen data without requiring authentication or leaving traces on their own infrastructure. This technique maps to MITRE ATT&CK T1567 (Exfiltration Over Web Service).
alt text
Q10 What is the handle of the attacker?
Answer: pwnmaster12
Q10 — What is the handle of the attacker?
Answer: pwnmaster12
Methodology
Step 1 — Identify suspicious files via RecentDocs
Using RegRipper’s recentdocs plugin on Velma’s NTUSER.DAT:
$ regripper -r NTUSER.DAT -p recentdocs
The output shows learn.txt at 17:23:50 UTC — created shortly after the attacker gained access.
alt text
Step 2 — Locate the deleted file via MFT Explorer
Since learn.txt does not appear in the TriageData file system (deleted by the attacker), use MFT Explorer to scan the MFT for the file record. MFT Explorer recovers metadata and contents of deleted files from the Master File Table.
The file was located at:
C:\Users\Velma\Pictures\learn.txt
alt text
Step 3 — Read file contents from MFT
MFT Explorer reveals the contents of the deleted file:
pwnmaster12
alt text