Linux Local Enumeration
#Local Enumeration
#System Information
In the
Meterpretersession
getuid
Server username: uid=0, gid=0, euid=0, egid=0sysinfo
Computer : 192.218.227.3
OS : Debian 9.5 (Linux 5.4.0-131-generic)
Architecture : x64
BuildTuple : i486-linux-musl
Meterpreter : x86/linuxshell
/bin/bash -i
cd /rootIn the
/bin/bashsession
hostname
victim-1cat /etc/issue
Debian GNU/Linux 9
cat /etc/*releaseEnumerate kernel
Enumerate environment variables for the current user
Display CPU information
Show RAM usage
List storage devices
Enumerate installed packages
#Users & Groups
Privilege escalation is not necessary in this case.
Enumerate users
Check if a user is part of the
root/sudogroup
Enumerate current/recent logged-on users
#Network Information
Back into the
MeterpretersessionShow network adapter info
Display the current running TCP/UDP services
Display the routing table and the ARP cache
In the
/bin/bashsession
List locally mapped domains
Show default DNS name server
Display the
ARPtable
#Processes & Cron Jobs
Enumerate all running processes, from a
Meterpretersession
In the
/bin/bashsessionList running processes (on the Kali Linux if the target machine does not have to commands)
Dynamic check of running processes

List the cron jobs
📌 Scheduled cron jobs can be misconfigured and vulnerable to exploitation and privilege escalation!
Show cron jobs for the current user
#Automating Local Enum
LinEnum - bash script that automates common Linux local enumeration
Enumeration & Exploitation

#Metasploit Post-Exploitation
Enumerate configuration files
Metasploit - post/linux/gather/enum_configs

Enumerate network fino

Enumerate local system information

Check if the target is a VM or a container

#LinEnum
Copy the content of the LinEnum.sh script and save it in the lab environment
Back into the
Meterpretersession, copy theLinEnum.shfile into the/tmptarget directory
Run
LinEnum.shand output the results in a file

#Some Post Exploitation imp modules
Enumerate ssh directories

Enumerate users' .ecrypts directories

Enumerate WiFi credentials

Check for PPTP VPN chap-secrets credentials

Last updated