> 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/fr/privesc/permissions/etc-passwd-write-abuse-linux-privilege-escalation.md).

# Abus d'écriture sur /etc/passwd - Élévation de privilèges Linux

## Ce que c’est

L’escalade de privilèges basée sur les permissions exploite des fichiers inscriptibles, une propriété faible, des secrets exposés ou des chemins sensibles qui ne devraient être contrôlés que par root. De petites erreurs de permissions peuvent devenir un accès root direct lorsqu’elles affectent des fichiers d’authentification ou des chemins d’exécution privilégiés. Cette page spécifique se concentre sur **Gestion des permissions (/etc/passwd)** et maintient le flux d’exploitation pratique : identifiez la condition, validez-la en toute sécurité, puis exécutez la charge utile minimale nécessaire pour prouver l’impact.

## Énumération

Commencez par confirmer le contexte local et la mauvaise configuration exacte avant d’exécuter la voie d’exploitation.

```bash
find / -writable 2>/dev/null
ls -la /etc/passwd /etc/shadow 2>/dev/null
```

## Exemples

Si nous filtrons les fichiers selon l’\*\*inscriptibilité\*\* du système, alors /etc/passwd

```bash
find / -writable 2>/dev/null
```

<figure><img src="/files/86bd02811338374dbf819147fefa315dadfc5dc5" alt=""><figcaption></figcaption></figure>

<div data-full-width="true"><figure><img src="/files/ae1adae3052992fda1ec7ec4140cfd605b85af74" alt=""><figcaption></figcaption></figure></div>

Avec **openssl**, si nous créons un mot de passe, il le renvoie au format SSL

```bash
openssl passwd
```

<div data-full-width="true"><figure><img src="/files/093a4b0b240b50d5161c7a068a485b64aa07e891" alt=""><figcaption></figcaption></figure></div>

Nous collons cette chaîne sur l’utilisateur root et le système la lira dans /etc/passwd avant /etc/shadow :

<figure><img src="/files/61f664345bee318f4c908c77c6fbfc89ab1c3026" alt=""><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/fr/privesc/permissions/etc-passwd-write-abuse-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.
