> For the complete documentation index, see [llms.txt](https://heathen.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://heathen.gitbook.io/oscp+-notes/misc/pivoting-and-tunneling.md).

# Pivoting and Tunneling

## SSH

Pivoting through SSH

```
ssh -L localport:IP:internaport user@machine.com
```

Pivoting using TOR port

```bash
ssh adminuser@10.10.155.5 -i id_rsa -D 9050 #TOR port

#Change the info in /etc/proxychains4.conf also enable "Quiet Mode"

proxychains4 crackmapexec smb 10.10.10.0/24 #Example
```

## Chisel

Attacker

```bash
chisel server -p 8000 --reverse
```

Victim

```
// Some code
```
