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
Startup | TryHackMe Writeup
Compromised the Startup machine by abusing an anonymous writable FTP share to upload a PHP web shell, recovered SSH …
8 min read
#linux
#ftp
TomGhost | TryHackMe Writeup
Exploited the Ghostcat vulnerability to read Tomcat configuration files, recovered SSH credentials, cracked a GPG …
6 min read
#linux
#ghostcat
Method | Vulnyx Writeup
Exploited a vulnerable WebDAV configuration to upload a PHP web shell, gained remote code execution, and escalated …
10 min read
#linux
#webdav
Cyborg | TryHackMe Writeup
Enumerated web directories, extracted Borg archives, recovered credentials, and exploited sudo permissions for root …
1 min read
#linux
#borg