Linux Privilege Escalation
Last updated
Last updated
Enumeration
Scan the local network
:Find one many hosts there are in the network by doing a ping sweep
:
If nc
is installed can be use to scan for open ports:
Other wise get a nmap
binary.
Grepping files
:Search for the string pass
(case-insensitive) in all files and directories recursively:
Search for the string password
in files with double extension, recursively:
Search for ssh
keys recursively from the current directory you are in:
Is also possible to look for hashes
by using regex to look for the hash length:
Polkit
Important Files
/etc/passwd
If is possible to write the file:
/etc/shadow
Crack the hash with john
Now crack it:
/var/log
adm
group can read log files.
/etc/sudoers
If the file is read-only, you need to change its permissions to allow write access:
Add the following line:
Restore the original file permissions to make it read-only again: