HackTricks
Searchโ€ฆ
๐Ÿ‘ฝ
Network Services Pentesting
Checklist - Linux Privilege Escalation
Support HackTricks and get benefits!

Best tool to look for Linux local privilege escalation vectors: LinPEASโ€‹

โ€‹System Informationโ€‹

โ€‹Drivesโ€‹

  • List mounted drives
  • Any unmounted drive?
  • Any creds in fstab?

โ€‹Installed Softwareโ€‹

โ€‹Processesโ€‹

  • Is any unknown software running?
  • Is any software with more privileges that it should have running?
  • Search for exploits for running processes (specially if running of versions)
  • Can you modify the binary of any running process?
  • Monitor processes and check if any interesting process is running frequently
  • Can you read some interesting process memory (where passwords could be saved)?

โ€‹Scheduled/Cron jobs?โ€‹

โ€‹Servicesโ€‹

  • Any writable .service file?
  • Any writable binary executed by a service?
  • Any writable folder in systemd PATH?

โ€‹Timersโ€‹

  • Any writable timer?

โ€‹Socketsโ€‹

  • Any writable .socket file?
  • Can you communicate with any socket?
  • HTTP sockets with interesting info?

โ€‹D-Busโ€‹

  • Can you communicate with any D-Bus?

โ€‹Networkโ€‹

  • Enumerate the network to know where you are
  • Open ports you couldn't access before getting a shell inside the machine?
  • Can you sniff traffic using tcpdump?

โ€‹Usersโ€‹

  • Generic users/groups enumeration
  • Do you have a very big UID? Is the machine vulnerable?
  • Clipboard data?
  • Password Policy?
  • Try to use every known password that you have discovered previously to login with each possible user. Try to login also without password.

โ€‹Writable PATHโ€‹

  • If you have write privileges over some folder in PATH you may be able to escalate privileges

โ€‹Capabilitiesโ€‹

  • Has any binary any unexpected capability?

โ€‹ACLsโ€‹

  • Has any file any unexpected ACL?

โ€‹Open Shell sessionsโ€‹

  • screen
  • tmux

โ€‹SSHโ€‹

โ€‹Interesting Filesโ€‹

  • Profile files - Read sensitive data? Write to privesc?
  • passwd/shadow files - Read sensitive data? Write to privesc?
  • Check commonly interesting folders for sensitive data
  • Weird Localtion/Owned files, you may have access or alter executable files
  • Modified in last mins
  • Sqlite DB files
  • Hidden files
  • Script/Binaries in PATH
  • Web files (passwords?)
  • Backups?
  • Known files that contains passwords: Use Linpeas and LaZagne
  • Generic search

โ€‹Writable Filesโ€‹

  • Modify python library to execute arbitrary commands?
  • Can you modify log files? Logtotten exploit
  • Can you modify /etc/sysconfig/network-scripts/? Centos/Redhat exploit

โ€‹Other tricksโ€‹

Support HackTricks and get benefits!