Skip to main content

The Mindset

As a pentester, you’re looking for two things:
  • What can I access that I shouldn’t? — World-readable sensitive files, writable system scripts
  • What can I run as someone else? — SUID/SGID binaries, sudo rights, writable cron scripts

Reading Permission Strings

Run ls -l on any file and you’ll see this:
Break it down character by character:

File Type (First Character)

Permission Characters

Execute permission on a directory doesn’t let you run anything — it lets you cd into it. Without x on a directory, you can’t access anything inside even if you have r.

Octal Notation

Permissions are also expressed as numbers. Each permission has a value: Add the values for each group (owner / group / others):
So chmod 754 means:

Changing Permissions

chmod — Change File Mode

chown — Change Ownership


SUID & SGID — Privilege Escalation Gold

What They Are

  • SUID (Set User ID) — When set on an executable, it runs with the file owner’s privileges, not the caller’s. If root owns a SUID binary, anyone who runs it gets root-level execution.
  • SGID (Set Group ID) — Same concept but for groups.
They appear as s in place of the execute bit:

Finding SUID/SGID Binaries

What To Do With Them

Take every result and check it against GTFOBins (https://gtfobins.github.io/). Common SUID abuses:
When you find a SUID binary you don’t recognize, Google it before running it. Custom SUID binaries are often vulnerable to path injection, buffer overflows, or argument abuse.

Sticky Bit

The sticky bit on a directory means only the file’s owner (or root) can delete or rename files inside it — even if others have write access to the directory.

World-Writable Files & Directories

World-writable means any user can write to it. In a privesc context, this means you can modify a file that a privileged process may later read or execute.
What to look for:
  • World-writable scripts that are called by root-owned cron jobs
  • World-writable config files for services running as root
  • World-writable directories in PATH (path hijacking)

PATH Hijacking via Writable Directories

If a directory in the system’s PATH is world-writable, you can plant a malicious binary that gets executed instead of the real one.

Permission Enumeration Checklist


Quick Reference


Next: User & Group Management — enumerating users, reading /etc/shadow, and finding lateral movement targets.