Linux Privesc checklist
You have a low priv shell, now what?
OR
What can we do? who are we?
What binaries do we have on the machine?
What Arch?
Kernel?
Issue/Release?
Are we a real user?
Are any users a member of exotic groups?
Check out your shell’s environment variables…
What services are running, or not running..?
Linux Privilege Escalation using PATH Variable
Users?
Web Configs containing credentials?
SUID Binaries?
GUID Binaries?
SUID/GUID/SUDO Privilege Escalation: GTFOBins
Binary/Languages with “Effective Permitted” or “Empty Capability” (ep): GetCap and SetCap - File Capabilities
Its good to monitor the system while performing our enumeration…
What does the local network look like?
A quick explanation of the flags.
-antup :
a – all connections (listening and non-listening)
n – don’t resolve names (IP addresses and port numbers only)
t – TCP sockets
u – UDP sockets
p – show process using the socket
-tunlp :
t – TCP
u – UDP
n – numeric (no DNS/port name resolution)
l – only listening sockets
p – show the PID/program
Is anything vulnerable running as root?
MYSQL Credentials? Root Unauthorized Access?
Check to see if any user-level people did special things:
Anything other than root here?
-
Any config files left behind?
-
If we have root priv information disclosure - are there any
.secretin/etc/files?
any SSH Keys that can be used?
Quick look in:
Quick look in:
File Transfer Capability? What can I use to transfer files?
NFS? Can we exploit weak NFS Permissions?
[On Attacking Machine]
[On Target Machine]
Where can I live on this machine? Where can I read, write and execute files?
- /var/tmp/
- /tmp/
- /dev/shm/
Any exotic file system mounts/extended attributes?
Forwarding out a weak service for root priv (with meterpreter!): Do we need to get a meterpreter shell and forward out some ports that might be running off of the Loopback Adaptor (127.0.0.1) and forward them to any (0.0.0.0)? If we see something like Samba SMBD out of date on 127.0.0.1 - we should look to forward out the port and then run trans2open on our own machine at the forwarded port.
Port Forwarding with Meterpreter
Forwarding out netbios-ssn EXAMPLE:
Can we write as a low-privileged user?
Cron.
Look for unusual system-wide cron jobs:
Bob is a user on this machine. What is every single file he has ever created?
Any mail? mbox in User $HOME directory?
Linpease:
LinPEAS on GitHub
Traitor:
Traitor on GitHub
GTFOBins: GTFOBins Website
PSpy32/Pspy64:
PSpy on GitHub
credits: s1ren s1ren