# Dot (.) In PATH

Example of a **vulnerable** PATH. Note the dot in the front:

```
.:/usr/bin:/usr/local/sbin
```

If a user named `admin` has the above PATH, then if you put a malicious executable named `ls` in a folder the `admin` user frequently visits, then if they type `ls` into their terminal while they are in that folder, they’ll execute your program.

If the dot is at the **end** of the PATH, then exploitation is slightly more difficult, since the `ls` executable in `/usr/bin/ls` will be found before `./ls` is found, and `/usr/bin/ls` will be executed instead of your malicious `./ls`. In that case, you can add a `./sl` executable and hope that the `admin` user makes a typo.


---

# 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://heinosass.gitbook.io/leet-sheet/post-exploitation/linux/linux-privilege-escalation/dot-.-in-path.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.
