Jinkies Sherlock Walkthrough

Solved Jinkies from Hack The Box!

Field Details
Case Reference HTB-SHRLCK-JINKIES
Platform Hack The Box — Sherlock
Category DFIR — Shared-Folder Abuse & Data Exfiltration
Difficulty —
Date Opened 2023-10-06
Severity High
Status Closed — training scenario
Host Velma’s workstation (VELMAD100)
Evidence Registry hives (SYSTEM, SAM, NTUSER.DAT), $MFT, Chrome History
Tools RegRipper, impacket-secretsdump, MFT Explorer, chainsaw, Splunk, strings

1. Executive Summary

On 2023-10-06 an attacker gained access to Velma’s workstation (VELMAD100) via RDP from 192.168.157.151, using credentials recovered from a MySQL .ibd file (bk_db.ibd) containing 216 user records. The attacker’s password (peakTwins2023fc) matched Velma’s NT hash (967452709ae89eaeef4e2c951c3882ce), confirming password reuse. The attacker enumerated accounts, opened a Python file in VSCode, visited pastes.io (likely data exfiltration), and created learn.txt containing the handle pwnmaster12 before deleting it (recovered via MFT). The shared folders C:\Users and C:\Users\Velma\Documents (with “Everyone” full control) enabled the initial access. The entire chain was reconstructed from registry hives, MFT, and Chrome History.

1.1 Incident Summary

Field Details
Incident Type Shared-folder abuse → credential theft → RDP access → data exfiltration
Initial Access Credentials from bk_db.ibd (MySQL InnoDB tablespace) — password reuse
Discovery Registry/MFT/Chrome History forensics
First Execution 2023-10-06 17:15:56 UTC (first network logon)
Persistence None observed
Overall Severity High

1.2 Key Findings

  • Shared folders: C:\Users and C:\Users\Velma\Documents (Permissions 0 = Everyone full access).
  • Credentials leaked via bk_db.ibd (MySQL InnoDB) — 216 user records.
  • Velma’s password peakTwins2023fc matched her NT hash 967452709ae89eaeef4e2c951c3882ce (hashcat-confirmed).
  • Attacker RDP’d from 192.168.157.151 at 17:17:23 UTC (first interactive logon).
  • First command: whoami at 17:17:45 UTC.
  • VSCode opened Version-1.0.1 - TERMINAL LOGIN.py; Chrome visited pastes.io.
  • Deleted file learn.txt recovered via MFT — contained handle pwnmaster12.

2. Investigation Scope & Artifacts

2.1 Artifacts Analyzed

Artifact Format What it answers
SYSTEM hive Registry hive Shared folders (LanmanServer\Shares) — Q1
NTUSER.DAT (Velma) Registry hive RecentDocs (recently accessed .ibd files) — Q2
bk_db.ibd MySQL InnoDB tablespace 216 user credentials — Q3/Q5
SAM hive Registry hive NT hashes (Velma: 96745270…) — Q4
Security Event Log EVTX Logon events (4624, LogonType 3/10) — Q6
Sysmon Event Log EVTX Process creation (Event ID 1) — Q7/Q8
Chrome History SQLite pastes.io visit — Q9
$MFT Master File Table Deleted learn.txt recovery — Q10

2.2 Tools & Methods

Tool Purpose
RegRipper (shares, recentdocs plugins) Registry hive analysis
impacket-secretsdump Offline SAM hash extraction
hashcat NT hash verification
strings, grep, regex Credential extraction from .ibd
chainsaw EVTX parsing
Splunk Process creation queries (Sysmon ID 1)
MFT Explorer Deleted file recovery
sqlite3 Chrome History analysis

3. Technical Analysis

3.1 Scenario

Investigation of shared-folder abuse and data exfiltration. Credentials were leaked via a MySQL .ibd file, enabling RDP access to Velma’s workstation. The attacker enumerated accounts, opened files in VSCode, visited pastes.io, and created/deleted learn.txt (handle pwnmaster12).

3.2 Q1 — Which folders were shared on the host?

Answer: C:\Users, C:\Users\Velma\Documents

Using RegRipper shares plugin on the SYSTEM hive:

$ 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).

Detection angle. RegRipper shares plugin on SYSTEM hive — enumerates shared folders even when share events (5140/5142/5143) are absent.

3.3 Q2 — What was the file that gave the attacker access to the user’s account?

Answer: bh_db.ibd

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. (Note: Q2 asks for bh_db.ibd but the recentdocs output references bk_db.ibd and login.ibd.)

Detection angle. RegRipper recentdocs plugin on NTUSER.DAT — reveals recently accessed .ibd files.

3.4 Q3 — How many user credentials were found in the file?

Answer: 216

Use strings 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

Detection angle. strings + email regex on a .ibd file — counts leaked credentials.

3.5 Q4 — What is the NT Hash of the user’s password?

Answer: 967452709ae89eaeef4e2c951c3882ce

NT hashes (NTLM hashes) are stored in the SAM (Security Account Manager) registry hive, protected by the SYSTEM hive. To extract them offline, we need both the SAM and SYSTEM hives (and optionally SECURITY).

Locate the registry hives in the triage data:

TriageData/C/Windows/system32/config/SYSTEM
TriageData/C/Windows/system32/config/SAM
TriageData/C/Windows/system32/config/SECURITY

Extract hashes using impacket-secretsdump:

$ 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

From the output, all local accounts are listed. The NT hash for Velma (RID 1002) is: 967452709ae89eaeef4e2c951c3882ce.

Detection angle. impacket-secretsdump on SAM+SYSTEM hives — offline NT hash extraction.

3.6 Q5 — Is the user’s computer password the same as the password found in the .ibd file?

Answer: Yes

Step 1 — Extract Velma’s credentials from the .ibd file:

$ strings bk_db.ibd | grep gmail | grep velma

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:

# hashes.txt contains: 967452709ae89eaeef4e2c951c3882ce
# password_Test.txt contains: peakTwins2023fc
$ hashcat hashes.txt password_Test.txt

Hashcat confirms the match:

967452709ae89eaeef4e2c951c3882ce:peakTwins2023fc
Status: Cracked

The password reuse confirms that the credentials leaked via the .ibd file were used for local account access.

Detection angle. hashcat verification of extracted password against NT hash — confirms password reuse.

3.7 Q6 — What was the time the attacker first interactively logged on to our user’s host?

Answer: 2023-10-06 17:17:23 UTC

To determine when the attacker first interactively logged on, we analyzed Windows Security Event Log Event ID 4624 (Successful Logon). The key field is LogonType: 2 = Interactive (local console), 3 = Network, 10 = RemoteInteractive (RDP), 5 = Service.

Extract Security Event 4624 logs and filter for user Velma with LogonType 3 or 10. Looking at Velma’s logon events:

  • 17:15:56 — LogonType 3 from 192.168.157.151 (network logon, likely SMB share access)
  • 17:16:09 — LogonType 3 from 192.168.157.151
  • 17:17:23 — LogonType 3 from local (no IP) — 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.

Detection angle. EID 4624 LogonType 3 (local, no IP) followed by LogonType 10 (RDP) — interactive logon identification.

3.8 Q7 — What’s the first command the attacker issues into the Command Line?

Answer: whoami

Identify attacker logon time (17:17:23 from Q6), then search Sysmon Event ID 1 for processes after that time, filtering by user VELMAD100\Velma and parent cmd.exe. Sort by timestamp — first entry is the answer.

Output: 2023-10-06T17:17:45.697Z: C:\Windows\System32\cmd.exe --> C:\Windows\System32\whoami.exe. The attacker ran whoami at 17:17:45 to verify their user context.

Detection angle. Sysmon EID 1 after the interactive logon, filtered by cmd.exe parent — first attacker command.

3.9 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 (Event ID 1, user Velma, parent VSCode). The result shows VSCode was launched with the file Version-1.0.1 - TERMINAL LOGIN.py as an argument.

Detection angle. Sysmon EID 1 with parent Code.exe — file opened in VSCode.

3.10 Q9 — What’s the domain name of the location the attacker likely exfiltrated the file to?

Answer: pastes.io

Since no DNS events (Sysmon Event ID 22) were captured, 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 shows a visit to pastes.io at 17:19:35 UTC. 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 maps to MITRE ATT&CK T1567 (Exfiltration Over Web Service).

Detection angle. Chrome History SQLite query for %paste% URLs — exfiltration via paste site.

3.11 Q10 — What is the handle of the attacker?

Answer: pwnmaster12

Step 1 — Identify suspicious files via RecentDocs: RegRipper recentdocs plugin on Velma’s NTUSER.DAT shows learn.txt at 17:23:50 UTC — created shortly after the attacker gained access.

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. The file was located at C:\Users\Velma\Pictures\learn.txt.

Step 3 — Read file contents from MFT: MFT Explorer reveals the contents of the deleted file: pwnmaster12.

Detection angle. MFT recovery of deleted learn.txt — attacker handle pwnmaster12.


4. Challenge Q&A Log

# Question Answer Method
1 Shared folders on the host C:\Users, C:\Users\Velma\Documents RegRipper shares
2 File giving attacker access bh_db.ibd (MySQL InnoDB) RegRipper recentdocs
3 User credentials in the file 216 strings + email regex
4 NT Hash of the user’s password 967452709ae89eaeef4e2c951c3882ce impacket-secretsdump
5 Computer password same as .ibd password? Yes (peakTwins2023fc) hashcat verification
6 First interactive logon time (UTC) 2023-10-06 17:17:23 EID 4624 (LogonType 3/10)
7 First command issued whoami Sysmon EID 1
8 File opened in VSCode Version-1.0.1 - TERMINAL LOGIN.py Splunk (Sysmon EID 1)
9 Exfiltration domain pastes.io Chrome History (sqlite3)
10 Attacker handle pwnmaster12 MFT recovery of learn.txt

5. Incident Narrative

On 2023-10-06 an attacker gained access to Velma’s workstation (VELMAD100) via RDP from 192.168.157.151, using credentials recovered from a MySQL .ibd file (bk_db.ibd) containing 216 user records. The attacker’s password (peakTwins2023fc) matched Velma’s NT hash (967452709ae89eaeef4e2c951c3882ce), confirming password reuse. The attacker enumerated accounts, opened a Python file in VSCode, visited pastes.io (likely data exfiltration), and created learn.txt containing the handle pwnmaster12 before deleting it (recovered via MFT). The shared folders C:\Users and C:\Users\Velma\Documents (with “Everyone” full control) enabled the initial access. The entire chain was reconstructed from registry hives, MFT, and Chrome History.


6. Attack Timeline

Timestamp (UTC) Event Artifact ATT&CK
2023-09-20 10:28:14 Shared folders configured (Users, Documents) Registry: LanmanServer\Shares T1135
2023-09-20 13:05:17 Velma accesses .ibd database files RecentDocs T1083
2023-10-06 17:15:56 First network logon from 192.168.157.151 (LogonType 3) Security Event 4624 T1078
2023-10-06 17:16:09 Second network logon Security Event 4624 T1078
2023-10-06 17:17:23 Interactive logon (LogonType 3) — LogonId: 0x3e4 Security Event 4624 T1021.001
2023-10-06 17:17:24 RDP session established (LogonType 10) — LogonId: 0x20f48f7 Security Event 4624 T1021.001
2023-10-06 17:17:25 Windows session initialization (explorer.exe, userinit.exe) Sysmon Event 1 —
2023-10-06 17:17:43 Attacker opens cmd.exe Sysmon Event 1 T1059.003
2023-10-06 17:17:45 First command: whoami Sysmon Event 1 T1033
2023-10-06 17:17:52 Account enumeration: net group Sysmon Event 1 T1087
2023-10-06 17:17:56 User enumeration: net users Sysmon Event 1 T1087
2023-10-06 17:18:26 Opens VSCode with Version-1.0.1 - TERMINAL LOGIN.py Sysmon Event 1 T1083
2023-10-06 17:18:41 Launches Chrome browser Sysmon Event 1 —
2023-10-06 17:19:35 Visits pastes.io (data exfiltration) Chrome History T1567
2023-10-06 17:21:44 Accesses Version-1.0.1 - TERMINAL LOGIN.py again RecentDocs (.py) T1083
2023-10-06 17:23:50 Creates learn.txt containing handle pwnmaster12 RecentDocs (.txt) T1083
2023-10-06 17:37:33 Last RecentDocs timestamp NTUSER.DAT —
(post-attack) Attacker deletes learn.txt to cover tracks MFT recovery T1070.004

7. Indicators of Compromise (IOCs)

7.1 File IOCs

Type Value Context
File Name bk_db.ibd MySQL InnoDB tablespace with 216 credentials — Q2/Q3
File Name learn.txt Deleted file containing attacker handle pwnmaster12 — Q10
File Path C:\Users\Velma\Pictures\learn.txt Deleted file location — Q10
File Name Version-1.0.1 - TERMINAL LOGIN.py File opened in VSCode — Q8

7.2 Network IOCs

Type Value Context
IP Address 192.168.157.151 Attacker IP (RDP source) — Q6
Domain pastes.io Exfiltration destination — Q9

7.3 Behavioral IOCs

Type Value Context
Account Velma Compromised account (password reuse)
NT Hash 967452709ae89eaeef4e2c951c3882ce Velma’s NT hash — Q4
Password peakTwins2023fc Velma’s password (from .ibd file) — Q5
Handle pwnmaster12 Attacker’s handle — Q10
Share C:\Users, C:\Users\Velma\Documents Shared folders with “Everyone” full control — Q1
LogonType 3 (Network) then 10 (RDP) Interactive logon pattern — Q6

8. Detection Opportunities

Source What to look for Why it matters
Registry (SYSTEM hive) Shares under LanmanServer\Shares with Permissions=0 (Everyone full control) Overly permissive shares — Q1
Registry (NTUSER.DAT) RegRipper recentdocs showing .ibd file access Credential database access — Q2
SAM hive (secretsdump) NT hashes for local accounts — cross-check against leaked passwords Password reuse detection — Q4/Q5
Windows Security (EID 4624) LogonType 3 (network) followed by LogonType 10 (RDP) from external IP Interactive logon pattern — Q6
Sysmon EID 1 whoami, net group, net users after RDP logon Post-exploitation enumeration — Q7
Chrome History Visits to paste sites (pastes.io) Data exfiltration — Q9
MFT Deleted files (learn.txt) recovered from MFT Anti-forensics (file deletion) — Q10

9. MITRE ATT&CK Mapping

TTP ID Tactic Technique Evidence
T1135 Discovery Network Share Discovery Shared folders enumerated via registry — Q1
T1083 Discovery File and Directory Discovery .ibd file access via RecentDocs — Q2
T1078 Defense Evasion Valid Accounts Password reuse (Velma’s creds from .ibd) — Q5
T1021.001 Lateral Movement Remote Services: RDP RDP session from 192.168.157.151 — Q6
T1033 Discovery System Owner/User Discovery whoami — Q7
T1087 Discovery Account Discovery net group, net users — Q7
T1567 Exfiltration Exfiltration Over Web Service pastes.io visit — Q9
T1070.004 Defense Evasion Indicator Removal: File Deletion learn.txt deleted (recovered via MFT) — Q10

10. Conclusions & Recommendations

10.1 Incident Summary

What Happened An attacker exploited shared folders with “Everyone” full control to access a MySQL .ibd file containing 216 credentials. Velma’s password (peakTwins2023fc) was reused for her local account, enabling RDP access. The attacker enumerated accounts, opened files in VSCode, visited pastes.io (likely exfiltration), and created/deleted learn.txt (handle pwnmaster12).
Root Cause Overly permissive shared folders (Everyone full control) exposed credential databases; password reuse between the .ibd file and the local account.
Impact Assessment Confidentiality: High — 216 credentials leaked, Velma’s account compromised. Integrity: Medium — learn.txt created/deleted. Availability: Low — no service disruption.

10.2 Recommendations

Priority Timeframe Recommendation
Immediate Within 24h Disable Velma’s account; remove “Everyone” full control from shared folders; block 192.168.157.151
High Within 7 days Reset all 216 passwords from the .ibd file; review .ibd file access; check for data exfiltration to pastes.io
Medium Within 30 days Alert on EID 4624 LogonType 3/10 from external IPs; alert on MFT recovery of deleted files; monitor Chrome for paste-site visits
Low Within 90 days User awareness for password reuse; restrict shared folder permissions
Strategic Ongoing File integrity monitoring on shared folders; centralized log collection for registry/MFT events

11. Analyst Notes & Learning

11.1 What I Did Well

Correlated registry hives (SYSTEM shares, NTUSER.DAT RecentDocs, SAM) with MFT recovery and Chrome History to reconstruct the full attack chain. Used hashcat to confirm password reuse between the .ibd file and the local account.

11.2 Key Takeaways

  • Overly permissive shares (“Everyone” full control) are a critical exposure — they allow access to credential databases.
  • Password reuse between application databases and OS accounts enables lateral movement.
  • MFT recovery can retrieve deleted files even when they don’t appear in the file system.
  • Chrome History is a valuable artifact for identifying exfiltration destinations when DNS events are absent.
  • RecentDocs in NTUSER.DAT reveals recently accessed files, including .ibd database files.

11.3 New Techniques

RegRipper shares/recentdocs plugins, impacket-secretsdump for offline SAM hash extraction, hashcat NT hash verification, MFT Explorer for deleted file recovery, and Chrome History SQLite analysis for exfiltration destinations.


12. References

HTB Sherlock · Jinkies · DFIR · 2023-10-06