Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2020-1472 PoC — Netlogon Elevation of Privilege Vulnerability

Source
Associated Vulnerability
Title:Netlogon Elevation of Privilege Vulnerability (CVE-2020-1472)
Description:An elevation of privilege vulnerability exists when an attacker establishes a vulnerable Netlogon secure channel connection to a domain controller, using the Netlogon Remote Protocol (MS-NRPC). An attacker who successfully exploited the vulnerability could run a specially crafted application on a device on the network. To exploit the vulnerability, an unauthenticated attacker would be required to use MS-NRPC to connect to a domain controller to obtain domain administrator access. Microsoft is addressing the vulnerability in a phased two-part rollout. These updates address the vulnerability by modifying how Netlogon handles the usage of Netlogon secure channels. For guidelines on how to manage the changes required for this vulnerability and more information on the phased rollout, see How to manage the changes in Netlogon secure channel connections associated with CVE-2020-1472 (updated September 28, 2020). When the second phase of Windows updates become available in Q1 2021, customers will be notified via a revision to this security vulnerability. If you wish to be notified when these updates are released, we recommend that you register for the security notifications mailer to be alerted of content changes to this advisory. See Microsoft Technical Security Notifications.
Description
Lab introduction to ZeroLogon
Readme
# ZeroLogon testing script

A lab setup to test a vulnerability for the ZeroLogon exploit (CVE-2020-1472).
It contains a Python script that uses the Impacket library to test the vulnerability, and a Virtual Machine (VM) with Windows Server 2019 configured as a Domain Controller (DC).

The script attempts to perform the Netlogon authentication bypass.
It will immediately terminate when successfully performing the bypass, and not perform any Netlogon operations.
When the DC is patched, the detection script will give up after sending a number of pairs of RPC calls and conclude the target is not vulnerable (with a false negative chance of 0.04%).

<details open>
    <summary><b>Requirements</b></summary>

- VMWare workstation/fusion
- Vagrant
- Python (^v3.7)

**Optional**

- Docker
  
</details>

Simply type `vagrant up` to load a vulnerable build of Windows Server 2019 as a VM.
Then, configure the VM as a Domain Controller following [this tutorial](https://www.virtualgyanis.com/post/step-by-step-how-to-install-and-configure-domain-controller-on-windows-server-2019).
Lastly, launch the attack on the DC (`zerologon_tester.py`).
It is recommended to use the Dockerised version of this attack or in a `virtual environment`.

- **`Docker` option.** Run:
  
    ```bash
    # NOTE: On Windows, you may need to enable the `Hyper-V` Wiwndows feature.
    # NOTE2: On Windows, you may need to switch to `Linux Containers`.
    $ docker build -f Dockerfile . -t zerologon
    # This command run the zerologon test on the DC with domain VAGRANT in the address 192.168.33.10
    $ docker run zerologon VAGRANT 192.168.33.10
    ```

- **`VirtualEnv` option.** Run:

    ```bash
    $ python3 -m virtualenv zerologon
    $ zerologon/Scripts/Activate.ps1
    # NOTE: This may give you some issues with your firewall!!
    $ pip install git+https://github.com/SecureAuthCorp/impacket
    $ pip install -r requirements.txt
    $ python zerologon_tester.py VAGRANT 192.168.33.10
    ```

---
The output of this attack should look something like this:

![zerologon](assets/attack.png)

This script is only meant to test the viability of the attack, it does not exploit the server in any other way.
The script does not perform any changes to the DC.
If you are curious about how to implement a PoC attack, check [this](https://medium.com/mii-cybersec/zerologon-easy-way-to-take-over-active-directory-exploitation-c4b38c63a915) writeup or a similar one.

---

The script targets can be used to target a DC or backup DC. It likely also works against a read-only DC, but this has not been tested. The DC name should be its NetBIOS computer name. If this name is not correct, the script will likely fail with a `STATUS_INVALID_COMPUTER_NAME` error. A whitepaper on this vulnerability will be published [here](https://www.secura.com/blog/zero-logon).


> **NOTE**:
> If something goes sideways and you receive a `STATUS_INVALID_COMPUTER_NAME` error, run `nbtstat -A 192.168.33.10`, this will give you some insight on what is going on in that address. Otherwise, you can always test wether the machine is reachable from your host by pinging it (`ping 192.168.33.10`).
>
> **NOTE2**:
> If the attack fails, it may be that the machine has been updated with security patches. Check the updates and remove anything that looks like `Security Patches` from 2020 onwards.
File Snapshot

[4.0K] /data/pocs/d674759dbabdfd498dbc7769ed6ace0abe5a568d ├── [4.0K] assets │   └── [ 26K] attack.png ├── [ 417] Dockerfile ├── [1.0K] LICENSE ├── [3.3K] README.md ├── [ 392] requirements.txt ├── [ 334] Vagrantfile └── [3.4K] zerologon_tester.py 1 directory, 7 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →