Sample Report - For Public Release

AD.LAB Internal and Web Application Penetration Test Report

Engagement Dates: February 3, 2025 – February 6, 2025

Report Date: February 9, 2025

Prepared for: AD.LAB Security Team

Prepared by: Andrew Lobenstein

Page 1

Table of Contents

Page 2

1. Executive Summary

Purpose and Objectives

The AD.LAB penetration test was conducted to evaluate the security posture of both external web applications and the internal Active Directory (AD) environment. Our primary objectives were to identify critical vulnerabilities, assess lateral movement and privilege escalation vectors, and provide actionable recommendations to remediate these issues.

Key Highlights

Overall Risk and Impact

The vulnerabilities identified pose a High/Critical risk. An attacker could leverage these weaknesses to gain full domain control, exfiltrate sensitive data, deploy ransomware, and cause significant reputational and operational damage.

Page 3

2. Scope and Engagement Details

In-Scope Systems and Services

The assessment included the following systems:

Out-of-Scope Items

Systems or networks not explicitly listed above were excluded. The assessment was limited to the approved testing window and did not involve any destructive or denial-of-service testing.

Constraints and Assumptions

Testing was conducted from February 3 to February 6, 2025. Authorization was provided for simulated Domain Administrator actions under strict engagement rules.

Page 4

3. Methodology

Our testing approach was based on industry standards (PTES and NIST SP 800‑115) and comprised the following phases:

  1. Reconnaissance & Information Gathering: We performed active and passive scanning (using tools such as Nmap, WhatWeb, and DNS queries) to identify and map in‑scope systems and services.
  2. Threat Modeling & Vulnerability Identification: Vulnerability assessments and manual testing uncovered misconfigurations and code injection flaws, particularly in web login forms and Active Directory configurations.
  3. Exploitation: We simulated attacks by exploiting SQL injection vulnerabilities to bypass authentication, write files (web shells), and trigger system-level commands. Additionally, we exploited misconfigured services, weak file permissions, and insecure remote management settings.
  4. Post-Exploitation & Lateral Movement: Using techniques such as DC Sync, ticket forgery (both Silver and Golden Tickets), and abuse of privileges (e.g., SeImpersonatePrivilege, DCOM), we demonstrated how an attacker could move laterally and escalate privileges across the network.
  5. Reporting & Remediation: All findings were documented at a high level, with remediation recommendations provided to reduce risk and strengthen the overall security posture.
Page 5

4. Risk Assessment and Overall Findings

Our high-level risk matrix was based on both technical severity and potential business impact. Key findings include:

Vulnerability Area Severity Impact
SQL Injection in Web Login Forms Critical Remote Code Execution and Credential Exposure
Unquoted Service Paths High Local Privilege Escalation to SYSTEM
Insecure WebDAV & Email Relay Medium Code Staging and Phishing Attacks
Service File Replacement / DLL Hijacking Critical Remote Code Execution on Affected Hosts
Abuse of SeImpersonatePrivilege High Escalation to SYSTEM
Unrestricted DCOM Execution High Remote Command Execution
Credential Exposure & Misconfigured Document Storage Medium Exposure of Sensitive Data
Weak File/Service Permissions High Service Replacement and Remote Code Execution
DC Sync Abuse & Ticket Forgery Critical Full Domain Compromise
Misconfigured Remote Management and RDP Settings High Unauthorized Remote Access
Excessive SMB Share Permissions Medium Data Exposure
Scheduled Task & Remote Service Abuse High Arbitrary Code Execution
Mimikatz-Based Credential Dumping Critical Further Lateral Movement and Ticket Forgery
Golden Ticket Attacks Critical Indefinite AD Access

The overall risk to the AD.LAB environment is assessed as High/Critical given the possibility for an attacker to gain fullDomain Administrator privileges.

Page 6

5. Detailed Technical Findings

The following sections provide a high-level explanation of the vulnerabilities identified, the attacks performed, and their overall impact. (Detailed commands and tool outputs are provided separately.)

  1. SQL Injection in Web Login Forms (WEB01 & WEB02): The login forms were not properly sanitized, allowing:
    • Injection of SQL payloads to bypass authentication.
    • File writing (e.g., planting a web shell such as shell.php) for remote code execution.
    • Triggering of system-level commands via xp_cmdshell to download utilities (e.g. nc.exe) and spawn reverse shells.
  2. Unquoted Service Path Vulnerability (BetaService): A service was configured with an unquoted executable path that contained spaces. An attacker replaced the legitimate binary with a malicious payload (Beta.exe), which executed with SYSTEM privileges upon service restart.
  3. Insecure WebDAV Configuration and Email Relay Abuse: The WsgiDAV server (MAIL01) allowed anonymous read–write access. This enabled:
    • Uploading of files such as a Windows Library file and a PowerShell shortcut (with a reverse shell payload) to the WebDAV share.
    • Using SMTP relay (via a tool like swaks) to send emails with these malicious attachments to stage remote code execution.
  4. Service File Replacement / DLL Hijacking: Improper file permissions on DEV01 and ADMIN01 allowed the replacement of legitimate service executables or DLLs. The attacker:
    • Replaced a service’s executable with a malicious payload that executed upon reboot or service restart.
    • Downloaded and placed a missing DLL (NewService.dll) into the service directory, then started the service to spawn a reverse shell as SYSTEM.
  5. Abuse of SeImpersonatePrivilege: The nt service\mssqlserver account had the SeImpersonatePrivilege enabled. This was exploited using SigmaPotato to impersonate a SYSTEM-level token and spawn a reverse shell on WEB02.
  6. Unrestricted DCOM Remote Command Execution: Insecure DCOM settings allowed remote instantiation of COM objects. An attacker created an instance of the MMC20.Application COM object on ADMIN02 and used its shell-execution method to run base64-encoded PowerShell commands.
  7. Credential Exposure and Misconfigured Document Storage: Sensitive credentials were inadvertently exposed (e.g., in environment variables and Office documents). Office document hashes were extracted and cracked (via hashcat) to recover credentials, which were then used to create scheduled tasks and new services that furthered lateral movement.
  8. Weak or Misconfigured File/Service Permissions Allowing Replacement: Several systems (DEV01, ADMIN02, ADMIN01) had service directories with insufficient protections, allowing:
    • Replacement of legitimate executables with malicious payloads.
    • Insertion of missing DLLs that triggered remote code execution when the service restarted.
  9. DC Sync Abuse and Golden Ticket Generation: The domain controller (DC01) allowed replication requests (DC Sync) and had exposed AES keys. Using mimikatz, high-privilege account hashes (e.g., for Administrator and krbtgt) were dumped, and a Golden Ticket was forged using a custom tool, enabling persistent AD access.
  10. Misconfigured Remote Management and RDP Settings: Although remote management features were initially disabled, registry settings and firewall rules were modified to enable RDP and WMI. This allowed an attacker to remotely execute commands (using WMIC and wmiexec) on critical systems such as DC01.
  11. Excessive Permissions on SMB Shares and Sensitive Data Exposure: An SMB share (e.g., DomainAdminsShare on FILES01) was misconfigured with overly permissive access, allowing an attacker (using a forged ticket) to enumerate and retrieve sensitive documents, including the domain flag.
  12. Scheduled Task and Remote Service Abuse for Code Execution: The environment allowed the creation of scheduled tasks and remote services without sufficient restrictions. This was abused to:
    • Create scheduled tasks that executed encoded PowerShell commands to download and run reverse shell payloads.
    • Create new services that, when started, executed malicious code and provided Domain Admin shells.
  13. Mimikatz for Privilege Escalation and Credential Dumping: With administrative access, mimikatz was used to extract password hashes and Kerberos keys from LSASS, enabling further lateral movement and the forging of tickets.
  14. Golden Ticket Attacks Against the Domain: Weak key management enabled the forging of Kerberos tickets. Using the extracted AES256 key and the domain SID, a Golden Ticket was generated, providing indefinite access to the AD environment.
Page 7

6. Recommendations and Remediation Roadmap

Immediate Actions (0–30 Days)

Short-Term Actions (30–90 Days)

Long-Term Actions (90+ Days)

Page 8

7. Conclusion

The AD.LAB penetration test uncovered a wide array of vulnerabilities that, if exploited by an adversary, could lead to full domain compromise. Our assessment demonstrated that the web applications were vulnerable to SQL injection, allowing remote code execution and credential harvesting. Additionally, misconfigurations in service paths, remote management, file permissions, and the use of powerful privileges (such as SeImpersonatePrivilege) enabled extensive lateral movement and privilege escalation.

Critical attacks, such as DC Sync abuse and Golden Ticket forgery, illustrate the potential for an attacker to achieve persistent and indefinite access to the AD environment. Immediate remediation, as outlined in this report, is essential to prevent exploitation and secure the AD.LAB network.

Page 9

8. Appendices

Detailed technical evidence—including command logs, tool outputs, and screenshots—has been compiled in separate appendices:

Page 10

9. References

  1. PTES (Penetration Testing Execution Standard)
  2. NIST SP 800‑115: Technical Guide to Information Security Testing
  3. MITRE ATT&CK Framework – Active Directory Techniques
  4. OWASP Top 10 – Web Application Vulnerabilities
  5. Impacket Documentation and GitHub Repository
  6. Microsoft Security Guidance on Kerberos, WinRM, and SMB Hardening
  7. Mimikatz Documentation – DC Sync and Ticket Forgery Techniques
Page 11

10. Enumeration & Exploitation Steps



Page 12