Pivoting techniques
Proxychains Pivot
Getting known machines
Setup SSH Dynamic on the attacking box
Setup proxychains in /etc/proxychains.conf
Reduce timeout in /etc/proxychains.conf to gain speed
Then
Scanning (nmap) can be very long through proxychains
You can speed it up by using xargs and multithreading
The main goal is to spread ports between different threads (-P 50)
Take care of some options
You can't just run -oA but need the --append-output option
The same behavior can be used to scan multiple machines
The base command
Become
Pivot 1 using proxychains
Configure /etc/proxychains to set port 1080
Pivot 2 using proxychains
Configure /etc/proxychains to set port 1081
Windows
Metasploit
Reverse ssh tunnel, port forwarding 8090 from target to us:
Local port forward, forward local 8090 to target:
Local port forwarding
Local port opened on 127.0.0.1 (bind)
-N == no command executed (only ssh tunnel)
$ ssh user@pivoting_machine -L [bind_address:]local_port:destination_host:destination_hostport -N
Transparent proxy over SSH
Forwarding traffic through the pivot
It will then auto create necessary iptables rules
You can also let sshuttle detect networks based on the target
-x == exclude some network to not transmit over the tunnel
Reverse Shell generation
Setup listener
Autoroute module
On windows you can use post/windows/gather/arp_scanner to discover other machines
On Linux you can try arp -a
SOCKS proxy setup
Now, equivalent to a dynamic SSH
Double Pivoting
Reverse shell from the pwned2 to the pwned1
Setup handler and exploit the found vulnerability
Ncat =/= netcat
Enhanced version, developped by nmap dev and often packaged with
Ciphered connexion, IP restriction
To pivot, needed on both attacker and pivot machine
Attacker (broker == accept multiple connexions)
Pivot
We connect to attacker and target
Chisel offers to encapsulate TCP connexions in HTTP tunnels
Everything is encrypted using SSH
Local port forwarding
Pivot machine
Attacker machine
Local port forwarding + SOCKS proxy
Pivot machine
Attacker machine
Reverse remote port forwarding
Attacker machine
Pivot machine
Similar features to other tools but support multilevel pivot
Like Metasploit
"Remote" local port forwarding
On the pivot
"Remote" dynamic port forwarding
Everything is through HTTP
Bypass some IPS/IDS
First step is to deploy webshell on the target
Some are available with the tool (but not good)
Can be hard to use
Then on the attacker machine
Last updated
