Sploitus

Exploit for CVE-2021-42278 CVE-2021-42278 CVE-2021-42287

gitee · 2024-03-05

Exploit Code

MARKDOWN15 lines
## https://sploitus.com/exploit?id=6D7B585E-0CA4-540B-8614-7D4570E78941
This is a Python script for exploiting CVE-2021-42278 and CVE-2021-42287 to impersonate a Domain Administrator (DA) from a standard domain user. The script uses the Impacket library to interact with the Active Directory.

The script has several components:

1. `sam_the_admin.py`: This is the main script that orchestrates the exploitation. It takes several options as input, including the domain, username, password, and hashes.
2. `utils/S4U2self.py`: This script is used to request a Service Ticket (ST) for a user. It can be used to impersonate a user if the account has constrained delegation privileges.
3. `utils/addcomputer.py`: This script is used to add a computer to the domain. It uses the SAMR protocol to add the computer.
4. `utils/helper.py`: This script provides several helper functions, including getting the machine name from the domain controller.

The script works as follows:

1. The user runs the `sam_the_admin.py` script with the required options.
2. The script initializes the Impacket library and sets up the connection to the domain controller.
3. The script uses the `S4U2self.py` script to request a Service Ticket for the DA.