Enumeration
Basic enumeration commands (Linux)
hostnameuname -aFiles to view with the
catcommand
a) /proc/version
b) /etc/issue
c) /etc/passwd and /etc/shadow
Readable /etc/shadow file
Writable /etc/passwd and /etc/shadow
# rx /etc/passwd
$ ls -l /etc/passwd
-rw-r--r-x 1 root shadow xxxx xxx xx xxxx /etc/passwd
# rx /etc/shadow
$ ls -l /etc/shadow
-rw-r--r-x 1 root shadow xxxx xxx xx xxxx /etc/shadowenvid
Suppose a user is in the adm group. This user will be able to read the log files present in the /var/log or other related folder:
Practical example: https://jarrettgxz-sec.gitbook.io/penetration-testing-ethical-hacking/write-ups/tryhackme/silver-platter
historysudo -l
The target system may be configured to allow users to run some (or all) commands with root privileges. The
sudo -lcommand can be used to list all commands your user can run usingsudo
find
a) Files with SUID bit:
b) Files with SGID bit:
c) Files with certain permission
0777: readable, writable and executable by all users003: writable and executable byothers. Ignoring permissions forownerandgroup/001: atleast executable permissions for others
Find world-writable folders
Find world-executable folders
Files to look out for
Writable
/etc/systemd/system,/lib/systemd/services,/usr/lib/systemd/system,/run/systemd/system(systemd services) and other similar directories
Automated tools
LES (Linux Exploit Suggester): https://github.com/mzet-/linux-exploit-suggester
Linux Smart Enumeration: https://github.com/diego-treitos/linux-smart-enumeration
Linux Priv Checker: https://github.com/linted/linuxprivchecker
Last updated