Skip to content

Sendai Walkthrough

Lab Name: Sendai
Difficulty: Medium
Platform: Vulnlab

Sendai is a medium-difficulty Active Directory lab from vulnlab. We work through delegated privileges and several attack paths to compromise the domain.


We start with RustScan to find open ports and exposed services.

image.png

From the scan results, several services are exposed. The most interesting ones are:

  • HTTP (80)
  • SMB (445)
  • Kerberos (88)
  • LDAP/LDAPS (389/636)

Service Enumeration:

image.png

  • We find the domain name and domain controller hostname and add them to /etc/hosts for name resolution during Kerberos-based enumeration and attacks.

Since HTTP is open, we began enumerating the web server to identify any exposed usernames, admin portals, or potential vulnerabilities.

image.png

  • The page appears to be hosted on a Windows Server, so the next step is directory fuzzing to look for hidden or sensitive paths.

Directory fuzzing did not reveal any useful endpoints. We can now move on to enumerating other exposed services.

While directory fuzzing runs, we enumerate SMB shares for sensitive information and guest write access.

image.png

Key Discoveries:

  • Read access was available on multiple shares (Users, Sendai)
  • $IPC$ was accessible, allowing RID cycling for domain user enumeration

We can access the readable SMB shares to look for sensitive data.

Sendai Share:

image.png

Two files were downloaded:

  • incident.txt
  • guidelines.txt

The incident.txt file says accounts with weak passwords have expired and must change their passwords at login. The guidelines.txt file contains the organization’s Acceptable Use Policy.

Terminal window
cat incident.txt
Output
Dear valued employees,
We hope this message finds you well. We would like to inform you about an important security update regarding user account passwords. Recently, we conducted a thorough penetration test, which revealed that a significant number of user accounts have weak and insecure passwords.
To address this concern and maintain the highest level of security within our organization, the IT department has taken immediate action. All user accounts with insecure passwords have been expired as a precautionary measure. This means that affected users will be required to change their passwords upon their next login.
We kindly request all impacted users to follow the password reset process promptly to ensure the security and integrity of our systems. Please bear in mind that strong passwords play a crucial role in safeguarding sensitive information and protecting our network from potential threats.
If you need assistance or have any questions regarding the password reset procedure, please don't hesitate to reach out to the IT support team. They will be more than happy to guide you through the process and provide any necessary support.
Thank you for your cooperation and commitment to maintaining a secure environment for all of us. Your vigilance and adherence to robust security practices contribute significantly to our collective safety.%

User Share:

image.png

  • I did not find any sensitive information in the User share.

Since $IPC$ is accessible, we use RID cycling to enumerate domain users.

Terminal window
nxc smb sendai.vl -u 'a' -p '' --rid-brute 10000
Output
SMB 10.10.71.14 445 DC [*] Windows Server 2022 Build 20348 x64 (name:DC) (domain:sendai.vl) (signing:True) (SMBv1:None) (Null Auth:True)
SMB 10.10.71.14 445 DC [+] sendai.vl\a: (Guest)
SMB 10.10.71.14 445 DC 498: SENDAI\Enterprise Read-only Domain Controllers (SidTypeGroup)
SMB 10.10.71.14 445 DC 500: SENDAI\Administrator (SidTypeUser)
SMB 10.10.71.14 445 DC 501: SENDAI\Guest (SidTypeUser)
SMB 10.10.71.14 445 DC 502: SENDAI\krbtgt (SidTypeUser)
SMB 10.10.71.14 445 DC 512: SENDAI\Domain Admins (SidTypeGroup)
SMB 10.10.71.14 445 DC 513: SENDAI\Domain Users (SidTypeGroup)
SMB 10.10.71.14 445 DC 514: SENDAI\Domain Guests (SidTypeGroup)
SMB 10.10.71.14 445 DC 515: SENDAI\Domain Computers (SidTypeGroup)
SMB 10.10.71.14 445 DC 516: SENDAI\Domain Controllers (SidTypeGroup)
SMB 10.10.71.14 445 DC 517: SENDAI\Cert Publishers (SidTypeAlias)
SMB 10.10.71.14 445 DC 518: SENDAI\Schema Admins (SidTypeGroup)
SMB 10.10.71.14 445 DC 519: SENDAI\Enterprise Admins (SidTypeGroup)
SMB 10.10.71.14 445 DC 520: SENDAI\Group Policy Creator Owners (SidTypeGroup)
SMB 10.10.71.14 445 DC 521: SENDAI\Read-only Domain Controllers (SidTypeGroup)
SMB 10.10.71.14 445 DC 522: SENDAI\Cloneable Domain Controllers (SidTypeGroup)
SMB 10.10.71.14 445 DC 525: SENDAI\Protected Users (SidTypeGroup)
SMB 10.10.71.14 445 DC 526: SENDAI\Key Admins (SidTypeGroup)
SMB 10.10.71.14 445 DC 527: SENDAI\Enterprise Key Admins (SidTypeGroup)
SMB 10.10.71.14 445 DC 553: SENDAI\RAS and IAS Servers (SidTypeAlias)
SMB 10.10.71.14 445 DC 571: SENDAI\Allowed RODC Password Replication Group (SidTypeAlias)
SMB 10.10.71.14 445 DC 572: SENDAI\Denied RODC Password Replication Group (SidTypeAlias)
SMB 10.10.71.14 445 DC 1000: SENDAI\DC$ (SidTypeUser)
SMB 10.10.71.14 445 DC 1101: SENDAI\DnsAdmins (SidTypeAlias)
SMB 10.10.71.14 445 DC 1102: SENDAI\DnsUpdateProxy (SidTypeGroup)
SMB 10.10.71.14 445 DC 1103: SENDAI\SQLServer2005SQLBrowserUser$DC (SidTypeAlias)
SMB 10.10.71.14 445 DC 1104: SENDAI\sqlsvc (SidTypeUser)
SMB 10.10.71.14 445 DC 1105: SENDAI\websvc (SidTypeUser)
SMB 10.10.71.14 445 DC 1107: SENDAI\staff (SidTypeGroup)
SMB 10.10.71.14 445 DC 1108: SENDAI\Dorothy.Jones (SidTypeUser)
SMB 10.10.71.14 445 DC 1109: SENDAI\Kerry.Robinson (SidTypeUser)
SMB 10.10.71.14 445 DC 1110: SENDAI\Naomi.Gardner (SidTypeUser)
SMB 10.10.71.14 445 DC 1111: SENDAI\Anthony.Smith (SidTypeUser)
SMB 10.10.71.14 445 DC 1112: SENDAI\Susan.Harper (SidTypeUser)
SMB 10.10.71.14 445 DC 1113: SENDAI\Stephen.Simpson (SidTypeUser)
SMB 10.10.71.14 445 DC 1114: SENDAI\Marie.Gallagher (SidTypeUser)
SMB 10.10.71.14 445 DC 1115: SENDAI\Kathleen.Kelly (SidTypeUser)
SMB 10.10.71.14 445 DC 1116: SENDAI\Norman.Baxter (SidTypeUser)
SMB 10.10.71.14 445 DC 1117: SENDAI\Jason.Brady (SidTypeUser)
SMB 10.10.71.14 445 DC 1118: SENDAI\Elliot.Yates (SidTypeUser)
SMB 10.10.71.14 445 DC 1119: SENDAI\Malcolm.Smith (SidTypeUser)
SMB 10.10.71.14 445 DC 1120: SENDAI\Lisa.Williams (SidTypeUser)
SMB 10.10.71.14 445 DC 1121: SENDAI\Ross.Sullivan (SidTypeUser)
SMB 10.10.71.14 445 DC 1122: SENDAI\Clifford.Davey (SidTypeUser)
SMB 10.10.71.14 445 DC 1123: SENDAI\Declan.Jenkins (SidTypeUser)
SMB 10.10.71.14 445 DC 1124: SENDAI\Lawrence.Grant (SidTypeUser)
SMB 10.10.71.14 445 DC 1125: SENDAI\Leslie.Johnson (SidTypeUser)
SMB 10.10.71.14 445 DC 1126: SENDAI\Megan.Edwards (SidTypeUser)
SMB 10.10.71.14 445 DC 1127: SENDAI\Thomas.Powell (SidTypeUser)
SMB 10.10.71.14 445 DC 1128: SENDAI\ca-operators (SidTypeGroup)
SMB 10.10.71.14 445 DC 1129: SENDAI\admsvc (SidTypeGroup)
SMB 10.10.71.14 445 DC 1130: SENDAI\mgtsvc$ (SidTypeUser)
SMB 10.10.71.14 445 DC 1131: SENDAI\support (SidTypeGroup)
  • The output contains domain users, service accounts, and groups. We sort it into a user list for password spraying.

We extract usernames from the RID cycling output for password spraying.

image.png

  • After extracting only user accounts (excluding groups and machines), we created a clean username list.
  • Final Usernames:
Output
sqlsvc
websvc
staff
Dorothy.Jones
Kerry.Robinson
Naomi.Gardner
Anthony.Smith
Susan.Harper
Stephen.Simpson
Marie.Gallagher
Kathleen.Kelly
Norman.Baxter
Jason.Brady
Elliot.Yates
Malcolm.Smith
Lisa.Williams
Ross.Sullivan
Clifford.Davey
Declan.Jenkins
Lawrence.Grant
Leslie.Johnson
Megan.Edwards
Thomas.Powell
ca-operators
admsvc
support

Password Spraying Using Null Pass

We test the username list with a null password in nxc and look for successful logins or different errors.

image.png

  • elliot.yates and thomas.powell return STATUS_PASSWORD_MUST_CHANGE for the tested blank password. That result gives us a known current password to try in the password-change flow; an expired-password condition alone would not allow an arbitrary reset.

We can now abuse this condition using impacket-changepasswd to reset the password for Elliot.Yates.

image.png

  • We reset the password for Elliot.Yates!

Verify Access:

image.png

  • We log in as Elliot.Yates with the new password. We can now collect AD objects for BloodHound analysis or check SMB again with this account’s permissions.

With valid Elliot.Yates credentials, we collect Active Directory objects.

Domain Object Data Dump:

image.png

Bloodhound Data Analysis:

We import the data into BloodHound and look for paths from Elliot.Yates.

image.png

  • BloodHound revealed an attack path from the compromised user Elliot to the MGTSVC$ service account, which was a member of the Remote Desktop Users group.

Elliot.Yates belongs to the Support group, which has GenericAll permissions over ADMSVC.

We use bloodyAD to add Elliot.Yates to ADMSVC.

image.png

  • Elliot is now a member of ADMSVC.

Since we have added the Elliot.Yates user to the ADMSVC group, which has gMSAReadPassword access, we can abuse this permission to retrieve the NT hash of the MGTSVC$ account.

image.png

We test WinRM with the recovered MGTSVC$ credentials. Remote Desktop Users membership alone does not grant WinRM access; the successful session below demonstrates that the account is allowed to use this endpoint.

image.png

  • We authenticated as MGTSVC$!

image.png

  • We retrieved and submitted the user flag.

We run PrivEscCheck to look for stored credentials or service vulnerabilities that could let us escalate privileges.

image.png

image.png

  • We found credentials for clifford.davey. We can check BloodHound for this user’s permissions.

Verify Access:

image.png

The user’s CA-Operators membership suggests AD CS is involved, so we enumerate it for vulnerabilities.

We can enumerate the certificate templates using certipy-ad, supplying valid domain user credentials and the domain controller IP address.

image.png

Terminal window
cat 20260201001906_Certipy.txt
Output
Certificate Authorities
0
CA Name :
DNS Name : dc.sendai.vl
Certificate Subject : CN=sendai-DC-CA, DC=sendai, DC=vl
Certificate Serial Number : 326E51327366FC954831ECD5C04423BE
Certificate Validity Start : 2023-07-11 09:19:29+00:00
Certificate Validity End : 2123-07-11 09:29:29+00:00
Web Enrollment
HTTP
Enabled : False
HTTPS
Enabled : False
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Active Policy : CertificateAuthority_MicrosoftDefault.Policy
Permissions
Access Rights
Enroll : SENDAI.VL\Authenticated Users
Certificate Templates
0
Template Name : SendaiComputer
Display Name : SendaiComputer
Certificate Authorities : sendai-DC-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : False
Certificate Name Flag : SubjectAltRequireDns
Enrollment Flag : AutoEnrollment
Extended Key Usage : Server Authentication
Client Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Schema Version : 2
Validity Period : 100 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 4096
Template Created : 2023-07-11T12:46:12+00:00
Template Last Modified : 2023-07-11T12:46:19+00:00
Permissions
Enrollment Permissions
Enrollment Rights : SENDAI.VL\Domain Computers
Object Control Permissions
Full Control Principals : SENDAI.VL\ca-operators
Write Owner Principals : SENDAI.VL\ca-operators
Write Dacl Principals : SENDAI.VL\ca-operators
Write Property Enroll : SENDAI.VL\Domain Computers
[+] User Enrollable Principals : SENDAI.VL\ca-operators
SENDAI.VL\Domain Computers
[+] User ACL Principals : SENDAI.VL\ca-operators
[!] Vulnerabilities
ESC4 : User has dangerous permissions.
  • The SendaiComputer template was flagged as vulnerable to ESC4 due to excessive permissions granted to the CA-Operators group.
  • Our current user, clifford.davey, belongs to CA-Operators and has Full Control over the template, including WriteOwner and WriteDacl.

We use certipy-ad with -write-default-configuration to apply an ESC1 configuration to the ESC4-vulnerable template. This enables certificate-based authentication abuse through the settings below.

  1. Enable the Enrollee Supplies Subject flag
    • Allows the requester to specify a custom Subject Alternative Name (SAN), such as the username of a privileged account (e.g., Domain Admin).
  2. Set the Certificate Name Flag to ENROLLEE_SUPPLIES_SUBJECT
    • Explicitly enables the behavior above, allowing spoofed identity fields in the certificate request.
  3. Configure the Extended Key Usage (EKU)
    • EKUs define how the certificate can be used. For authentication abuse, this must be set to Client Authentication or Any Purpose.
  4. Grant enrollment rights to low-privileged principals
    • Ensure groups such as Authenticated Users, Domain Users, or Domain Computers have permission to enroll in the template.
  5. Disable additional approval requirements
    • Set Requires Manager Approval to false and Authorized Signatures Required to 0 to prevent any manual approval during certificate issuance.

image.png

Changes Applied

  • Enabled ENROLLEE_SUPPLIES_SUBJECT
  • Allowed Client Authentication
  • Removed approval requirements
  • Granted enrollment rights to low-privileged principals

We run certipy-ad find again to verify the template changes.

image.png

image.png

The template is now marked as vulnerable to ESC1. We can use it to escalate to Domain Admin.

We request a certificate with the Domain Admin’s User Principal Name (UPN). The request must name the Certificate Authority (CA) hosting the template, since an environment can have multiple CAs with different templates. We also include the domain controller IP address.

image.png

We use auth in certipy-ad to authenticate as Administrator and retrieve the NT hash.

image.png

We can now use evil-winrm to obtain a shell using pass the hash and retrieve the root flag.

image.png

Celebration GIF on Tenor

  • We found and submitted the final root flag.

  • SMB access as guest exposed internal security notices and allowed RID cycling to enumerate domain users.
  • We used the expired-password condition to reset the credentials of Elliot.Yates and gain domain access.
  • BloodHound showed excessive delegated privileges for Elliot.Yates, which we used to control service-related security groups.
  • Misconfigured gMSA permissions let us extract the NT hash for mgtsvc$ and use it for remote access.
  • Local enumeration as mgtsvc$ revealed cached credentials for Clifford.Davey, a member of ca-operators.
  • We modified an ESC4 certificate template to make it vulnerable to ESC1, then used it to impersonate Administrator and compromise the domain.