Linux File Permissions Cheat Sheet
1 min read
Table of Contents
Permission Bits
| Permission | File | Directory |
|---|---|---|
| r (4) | Read content | List contents |
| w (2) | Modify content | Create/delete files |
| x (1) | Execute | Enter directory |
chmod Examples
chmod 755 file.sh # rwxr-xr-x
chmod u+s binary # Set SUID
chmod g+s dir/ # Set SGID
chmod +t dir/ # Set sticky bit
Special Permissions
- SUID (4) — File executes as owner
- SGID (2) — File executes as group / new files inherit group
- Sticky Bit (1) — Only owner can delete files in directory
Finding SUID Binaries
find / -perm -4000 -type f 2>/dev/null
PrivEsc
SUID binaries are a common Linux privilege escalation vector. Always check GTFOBins for known exploits.
Related Posts
LooseEnds | TryHackMe Writeup
Compromised LooseEnds through Vvveb CMS 1.0.5 by decoding exposed administrator credentials, exploiting CVE-2025-8518 …
11 min read
#linux#vvveb
Overpass | TryHackMe Writeup
Compromised the Overpass machine by bypassing the administrator authentication through an improperly validated …
9 min read
#linux#web-enumeration
Pickle Rick | TryHackMe Writeup
Compromised the Pickle Rick machine by discovering a username in the website source code, recovering the password from …
6 min read
#linux#web-enumeration
RootMe | TryHackMe Writeup
Compromised the RootMe machine by discovering the hidden /panel/ directory, bypassing the PHP upload restriction with a …
6 min read
#linux#web-enumeration