Linux permissions look intimidating. They're just math.
4 = read 2 = write 1 = execute
Add them up:
7 = full access
6 = read + write
5 = read + execute
4 = read only
Three digits = three audiences (owner, group, everyone).
"chmod 777" means the entire world can read, write, and execute that file.
That's how privilege escalation starts.