> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/enum/linux-discovery/linux-os-enumeration.md).

# Linux OS Enumeration

## **Get general system information**

### **Determine linux distribution and version**

```bash
cat /etc/issue
cat /etc/*-release
cat /proc/version
```

### **Determine kernel version - 32 or 64-bit?**

```bash
cat /proc/version
uname -a
uname -mrs
rpm -q kernel
dmesg | grep Linux
ls /boot | grep vmlinuz-
```

## List running processes

### Unix style (options)

```bash
ps -ef
```

### BSD style (options)

To list all processes with users

```bash
ps aux
```

The `aux` option will show processes for all users (`a`), display the user that launched the process (`u`), and show processes that are not attached to a terminal (`x`).

#### Tree view

To list all running processes in a visual tree view

```bash
ps axjf
```

The `f` options stands for "forest".

## Resources

dmesg - Linux manual page: <https://linux.die.net/man/1/dmesg>

ps - Linux manual page: <https://man7.org/linux/man-pages/man1/ps.1.html>

uname - Linux manual page: <https://man7.org/linux/man-pages/man1/uname.1.html>
