Skip to content
HackIndex logo

HackIndex

Linux Local System Enumeration

4 min read Apr 24, 2026

System enumeration establishes the full picture of the host: OS version, kernel, architecture, installed software, and environment. This feeds directly into kernel exploit selection, identifying installed tools you can use, and understanding what services are present. Run this early — before you start chasing privilege escalation paths.

OS and Kernel Version

user@host ~ $ uname -a
Linux target 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

The kernel version and architecture are the two most actionable fields. The kernel version determines which local privilege escalation CVEs apply. See Linux Kernel Local Privilege Escalation and Dirty Pipe (CVE-2022-0847).

user@host ~ $ cat /etc/os-release
user@host ~ $ cat /etc/issue
user@host ~ $ cat /etc/*release

These give the distribution name and version. Useful for identifying distribution-specific package versions and default configurations.

Architecture

user@host ~ $ uname -m
user@host ~ $ arch

Determines which compiled exploit binaries or payloads to use. x86_64 is the most common. aarch64 or armv7l requires different binaries.

Hostname and Domain

user@host ~ $ hostname
user@host ~ $ hostname -f
user@host ~ $ cat /etc/hostname

The FQDN (hostname -f) indicates whether the host is domain-joined. A hostname like web01.corp.local tells you the internal domain name without any active queries.

Environment Variables

user@host ~ $ env
user@host ~ $ printenv
user@host ~ $ cat /proc/1/environ | tr '\0' '\n'

Environment variables frequently contain credentials, API keys, database connection strings, and application secrets — especially in containerized or cloud-hosted environments. AWS_ACCESS_KEY_ID, DB_PASSWORD, SECRET_KEY, and similar variables appear here regularly.

/proc/1/environ is the environment of PID 1 (init/systemd). It requires root to read on most systems, but the attempt itself tells you what access you have.

Installed Packages

user@host ~ $ dpkg -l 2>/dev/null
user@host ~ $ rpm -qa 2>/dev/null

The package list reveals installed software versions, which feeds into CVE matching. Also check for security tools that indicate the host is monitored:

user@host ~ $ dpkg -l | grep -E 'fail2ban|auditd|ossec|aide|tripwire|rkhunter|chkrootkit'
user@host ~ $ rpm -qa | grep -E 'fail2ban|audit|ossec|aide|tripwire'

Their presence does not mean you stop — it means you work with more awareness of what generates alerts.

Available Binaries and Tools

Knowing what is installed determines what post-exploitation and data transfer options are available without uploading anything.

user@host ~ $ which wget curl nc netcat ncat python3 python perl ruby php gcc make git socat screen tmux
user@host ~ $ find /usr/bin /usr/local/bin /opt -maxdepth 2 -type f -executable 2>/dev/null | sort

The presence of gcc or make means you can compile exploits locally. python3, perl, or ruby means interpreter-based payloads work. wget or curl means file transfer is straightforward.

Running Shell and Terminal

user@host ~ $ echo $SHELL
user@host ~ $ echo $TERM
user@host ~ $ echo $PATH

$PATH shows where the shell resolves commands. Non-standard entries in PATH are worth noting — they feed directly into Writable PATH Hijacking for Privilege Escalation.

System Uptime and Load

user@host ~ $ uptime
user@host ~ $ cat /proc/uptime

Long uptime suggests a stable, unpatched system — kernel exploits become more viable. Recent reboots can indicate recent patching activity.

Disk and Filesystem Usage

user@host ~ $ df -h
user@host ~ $ lsblk

lsblk lists all block devices including unmounted ones. Unmounted partitions are a specific privilege escalation vector covered in Unmounted Filesystem Privilege Escalation.

Container and Virtualization Detection

user@host ~ $ cat /proc/1/cgroup
user@host ~ $ systemd-detect-virt 2>/dev/null
user@host ~ $ ls /.dockerenv 2>/dev/null

If /.dockerenv exists, you are inside a Docker container. The cgroup path in /proc/1/cgroup typically contains docker or lxc if containerized. This changes the privilege escalation focus — container escape techniques apply rather than standard host privesc. See Docker Container Escape and Host Privilege Escalation.

SELinux and AppArmor

user@host ~ $ getenforce 2>/dev/null
user@host ~ $ sestatus 2>/dev/null
user@host ~ $ cat /etc/selinux/config 2>/dev/null
user@host ~ $ aa-status 2>/dev/null

Enforcing SELinux or AppArmor profiles restrict what exploits and techniques work. Enforcing means many filesystem and exec-based attacks will be blocked. Permissive logs but does not block. Disabled means no MAC restrictions apply.

Writable Directories

Common writable staging locations for file upload and exploit compilation:

user@host ~ $ find / -writable -type d 2>/dev/null | grep -v proc | head -20

/tmp, /dev/shm, and /var/tmp are almost always writable. Non-standard writable directories in paths like /opt or /var/www are more interesting.