2021-10-23 02:03:06 +02:00
|
|
|
# Linux enumeration
|
|
|
|
|
|
|
|
* `cat /etc/*-release` * `cat /proc/version`
|
2022-05-31 21:08:28 +02:00
|
|
|
* `hostname` or `cat /etc/hostname`
|
|
|
|
* `cat /etc/hosts`
|
|
|
|
* `cat /etc/resolve.conf`
|
2021-10-23 02:03:06 +02:00
|
|
|
* `uname -a`
|
|
|
|
* `cat /etc/issue`
|
|
|
|
* `ps wuax ` or `ps ajxf` or `ps -A`
|
|
|
|
* `printenv` or `env`
|
2022-05-31 21:08:28 +02:00
|
|
|
* `cat /etc/timezone` or `timedatectl`
|
2021-10-23 02:03:06 +02:00
|
|
|
* `sudo -l`
|
|
|
|
* `id`
|
|
|
|
* `whoami`
|
2022-05-31 21:08:28 +02:00
|
|
|
* `groups` and `getent group` or `cat /etc/group`
|
|
|
|
* `cat /etc/passwd | column -t -s :`
|
|
|
|
* `cat /etc/sudoers`
|
2021-10-23 02:03:06 +02:00
|
|
|
* `history`
|
|
|
|
* `ip` or `ifconfig`
|
|
|
|
* `ip route`
|
2022-05-31 21:08:28 +02:00
|
|
|
* `cat /etc/network/interfaces`
|
|
|
|
* `netstat -natup` or `ss -natup`
|
2021-10-23 02:03:06 +02:00
|
|
|
* `netstat -s` and `netstat -i`
|
|
|
|
* `lsof -i`
|
2022-05-31 21:08:28 +02:00
|
|
|
## Login Info
|
|
|
|
```sh
|
|
|
|
last -f /var/log/wtmp
|
|
|
|
last -f /var/log/btmp
|
|
|
|
last
|
|
|
|
w
|
|
|
|
who
|
|
|
|
```
|
2021-10-23 02:03:06 +02:00
|
|
|
|
2022-05-31 21:08:28 +02:00
|
|
|
## Syslog
|
|
|
|
|
|
|
|
```sh
|
|
|
|
journalctl -xe
|
|
|
|
less /var/log/syslog
|
|
|
|
```
|
|
|
|
|
|
|
|
## Auth Logs
|
|
|
|
```sh
|
|
|
|
cat /var/log/auth.log | less
|
|
|
|
cat /var/log/access.log | less
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
## Find Files
|
2021-10-23 02:03:06 +02:00
|
|
|
* Find SUID permissions on files and dirs
|
|
|
|
* `find / -perm /6000 -ls 2>/dev/null`
|
|
|
|
|
|
|
|
* Find writeables dirs
|
|
|
|
* `find / -writable -type d 2>/dev/null` or `find / -perm -o w -type d 2>/dev/null`
|
|
|
|
* `find / -perm -o x -type d 2>/dev/null`
|
|
|
|
|
|
|
|
* Find writeable subdirs
|
|
|
|
`find / -writable 2>/dev/null | cut -d "/" -f 2,3 | grep -v proc | sort -u`
|
2022-05-31 21:08:28 +02:00
|
|
|
|
|
|
|
* `cat ~/.viminfo`
|
|
|
|
|
|
|
|
## Services
|
|
|
|
|
|
|
|
```sh
|
|
|
|
ls -al /etc/systemd/system && ls -la /var/lib/systemd/system || ls -la /etc/init.d
|
|
|
|
```
|
|
|
|
```sh
|
|
|
|
cat /etc/crontab
|
|
|
|
crontab -l
|
|
|
|
cat /etc/bash.bashrc ; cat /etc/profile
|
|
|
|
```
|