Use nmap standalone binary to scan other machines on the internal network. This is the best option to scan large networks without proxy all the traffic.
Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH. Single executable including both client and server. Written in Go (golang). Chisel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into your network.
Secure Socket Funneling (SSF) is a network tool and toolkit. It provides simple and efficient ways to forward data from multiple sockets (TCP or UDP) through a single secure TLS tunnel to a remote computer.
1. We need to upload the certifications into the target machine
2. Download the windows and Linux binaries from GitHub repository
3. Execute the ssfd (server) on the Linux side
On target host I will start the client, telling it to connect back to my box. I’ll use the following options:
-g - allow gateway ports. This allows client to bind local sockets to address besides localhost.
-F 1080 - This runs a socks proxy on the server on port 1080.
-Y 1111 - This opens local port 1111 as a shell on the client.
-L 172.19.0.4:2222:10.10.14.3:2222 and -L 172.19.0.4:3333:10.10.14.3:3333 - These will open listeners on the target machine that will forwards back to my attacker box. This will come in handy when I want to exploit further machines that can’t talk to my attacker box directly.
Imagine you have "www" access to a web-server located at the DMZ. With this technique, you can pivot through the infrastructure easily via Internet without exposing ports in your home-router.
:> ifconfig
:> run autoroute -s ip/mask
CTRL+Z
:> search socks4
:> run (1080)
search exploit
run
Double pivoting with proxychains
First, create a dynamic port forwarding through the first network:
ssh -f -N -D 9050 root@10.1.2.1
Edit /etc/proxychains.conf and add as default gateway:
socks4 127.0.0.1 9050
Use the proxy to create a second dynamic port forward to the second network:
proxychains ssh -f -N -D 10050 root@10.1.2.1 -p 22
Edit again /etc/proxychains.conf and add as default gateway:
socks4 127.0.0.1 10050
You can now use proxychains to pivot to the target network:
proxychains nmap -sTV -n -PN 10.1.2.1 -254