Enumeration is the Key
(Linux) privilege escalation is all about:
- Collect — Enumeration, more enumeration and some more enumeration
- Process — Sort through data, analyse and priorisation.
- Search — Know what to search for and where to find the exploit code.
- Adapt — Customize the exploit, so it fits. Not every exploit work for every system “out of the box”.
- Try — Get ready for (lots of) trial and error
What’s the distribution type? What version?
What’s the kernel version? Is it 64-bit?
What can be learnt from the environmental variables?
Applications & Services
What services are running? Which service has which user privilege?
Which service(s) are been running by root? Of these services, which are vulnerable — it’s worth a double check!
What applications are installed? What version are they? Are they currently running?
Any of the service(s) settings misconfigured? Are any (vulnerable) plugins attached?
What jobs are scheduled?
Any plain text usernames and/or passwords?
Communications & Networking
What NIC(s) does the system have? Is it connected to another network?
What are the network configuration settings? What can you find out about this network? DHCP server? DNS server? Gateway?
What other users & hosts are communicating with the system?
Whats cached? IP and/or MAC addresses
Is packet sniffing possible? What can be seen? Listen to live traffic
tcpdump tcp dst [ip] [port] and tcp dst [ip] [port]
Have you got a shell? Can you interact with the system?
Is port forwarding possible? Redirect and interact with traffic from another view
FPipe.exe -l [local port] -r [remote port] -s [local port] [local IP]
ssh -[L/R] [local port]:[remote IP]:[remote port] [local user]@[local IP]
mknod backpipe p ; nc -l -p [remote port] < backpipe | nc [local IP] [local port] > backpipe
Is tunnelling possible? Send commands locally, remotely
Confidential Information & Users
Who are you? Who is logged in? Who has been logged in? Who else is there? Who can do what?
What sensitive files can be found?
Anything “interesting” in the home directorie(s)? If it’s possible to access
Are there any passwords in; scripts, databases, configuration files or log files? Default paths and locations for passwords
What has the user being doing? Is there any password in plain text? What have they been editing?
What user information can be found?
Can private-key information be found?
Which configuration files can be written in /etc/? Able to reconfigure a service?
What can be found in /var/ ?
Any settings/files (hidden) on website? Any settings file with database information?
Is there anything in the log file(s) (Could help with “Local File Includes”!)
If commands are limited, you break out of the “jail” shell?
How are file-systems mounted?
Are there any unmounted file-systems?
What “Advanced Linux File Permissions” are used? Sticky bits, SUID & GUID
Where can written to and executed from? A few ‘common’ places: /tmp, /var/tmp, /dev/shm
Any “problem” files? Word-writeable, “nobody” files
Preparation & Finding Exploit Code
What development tools/languages are installed/supported?
How can files be uploaded?
Finding exploit code
Finding more information regarding the exploit
CVE security vulnerability database. Security vulnerabilities, exploits, references and more
CVEdetails.com is a free CVE security vulnerability database/information source. You can view CVE vulnerability…
(Quick) “Common” exploits. Warning. Pre-compiled binaries files. Use at your own risk
Is any of the above information easy to find?
Try doing it! Setup a cron job which automates script(s) and/or 3rd party products
Is the system fully patched?
Kernel, operating system, all applications, their plugins and web services
Are services running with the minimum level of privileges required?
For example, do you need to run MySQL as root?
Scripts Can any of this be automated?!
Other (quick) guides & Links