> For the complete documentation index, see [llms.txt](https://dudisamarel.gitbook.io/oscp-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dudisamarel.gitbook.io/oscp-notes/linux/local-privileges-escalation/kernel-exploits.md).

# Kernel Exploits

**Gathering System and Kernel Information**

To identify kernel-based vulnerabilities, first gather information about the operating system and Linux kernel version:

```bash
uname -r            # Kernel version
cat /etc/os-release # Distro version
```

**Searching for Exploits**

Use `searchsploit` to find local privilege escalation exploits that match the target system:

```bash
searchsploit <kernel_version> <distro_version> "Local Priv"
```

{% hint style="info" %}
**Important Note:**

Compiling exploits **on the target system** is often more successful because the system libraries and dependencies are compatible with the exploit's requirements.
{% endhint %}
