☼
⌃
☰

Linux Exploit Suggester

Table of Contents

Linux Exploit Suggester (LES) is a straightforward, non-invasive script utilized during the Post Exploitation phase of a penetration test. Its primary goal is to help an attacker, who has gained initial low-privileged access, quickly identify publicly available kernel and software vulnerabilities that can be leveraged to gain a higher privilege level, typically root. Unlike configuration-focused tools (Linux Smart Enumeration, LinPEAS), LES focuses specifically on version-based vulnerabilities in the kernel and installed packages.

Related: Linux Smart Enumeration LinPEAS Linux Privilege Escalation Windows Exploit Suggester SearchSploit [[Denote query for ‘20260718T113500’]]

How LES Works

  1. Data Collection: LES first gathers essential information from the target system using built-in commands like uname -a (for kernel version) and checks for OS release information.
  2. Comparison: The script contains a large, internally stored database of publicly known vulnerabilities, often referenced by their CVE (Common Vulnerabilities and Exposures) identifiers.
  3. Suggestion: LES compares the target's kernel version, specific distribution (e.g., Ubuntu, Debian, CentOS), and architecture (x86, x64) against its database. It then outputs a list of potential exploits that are likely to work on that specific system version.

Running LES

SHELL
# Basic run — outputs all matching CVEs for the detected kernel/OS
./linux-exploit-suggester.sh

# Verbose mode — includes lower-confidence matches too
./linux-exploit-suggester.sh -k <specific-kernel-version>

# Check against a specific kernel version rather than the current host
# (useful if you've already confirmed the version via other means)
./linux-exploit-suggester.sh -k 4.4.0

Attack Workflow Integration

LES significantly reduces the time an attacker spends manually cross-referencing the target's kernel version with online exploit databases (like Exploit-DB or SearchSploit). By automating this step, the attacker can quickly move from enumeration to exploitation.

The output usually includes the following details for each suggestion:

  • Vulnerability Name/CVE: The official identifier of the vulnerability.
  • Target Type: Specifies which kernel version or distribution the exploit is effective against.
  • Link/Source: Often provides a link to the exploit source code or a relevant resource.

Verifying and Using a Suggested Exploit

LES tells you a CVE might apply — it doesn't confirm the exploit will actually work, and it doesn't hand you working exploit code directly for most entries.

SHELL
# Cross-reference the suggested CVE against SearchSploit for actual
# exploit code
searchsploit <CVE-ID>
searchsploit -m <exploit-id>   # copy the exploit locally

# Kernel exploits often need compilation on a matching architecture —
# check for a Makefile or compile instructions before assuming it's
# ready to run
gcc exploit.c -o exploit
./exploit

LES vs. Manual Enumeration

While manual enumeration (checking SUID bits, permissions, etc.) remains crucial, LES provides the fastest way to check for kernel exploits — vulnerabilities in the core operating system that can bypass all traditional file permission controls. This is often the most direct path to root access if the system is unpatched.

Tips

  • A LES suggestion is a starting point, not a confirmed working exploit — always verify the exact kernel version and architecture match before spending time compiling and testing a suggested CVE
  • Kernel exploits carry real risk of crashing the target system — on a CTF box this just means a reset, but the caution is worth internalizing as a habit before it matters in a production environment
  • Run LES early alongside your standard privesc enumeration tool (LinPEAS/LSE) rather than as an afterthought — a kernel exploit can be the fastest path to root when the target is genuinely unpatched, bypassing the need to find a configuration weakness at all
  • If LES returns nothing, that's meaningful information too — it suggests the kernel is reasonably current, so time is better spent on configuration-based privesc (LinPEAS/manual enumeration) rather than continuing to search for a kernel exploit that likely doesn't exist