# PATH Hijacking

El PATH en Linux es una variable de entorno que indica al sistema operativo dónde buscar ejecutables.

Una búsqueda sencilla de carpetas con permisos de escritura puede realizarse utilizando el comando `find / -writable 2>/dev/null`

Con `strings /archivo` podemos ver las líneas legibles de un archivo/binario

Luego, podemos modificar el PATH asi : `export PATH=/tmp:$PATH`

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


---

# 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://eldeim.gitbook.io/brain_fuck/notes/linux-hardening/privilege-escalation-linux/path-hijacking.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.
