Invoke SocksProxy is a tool that creates a local or “reverse” Socks proxy using powershell. The local proxy is a simple Socks 4/5 proxy.
The reverse proxy creates a tcp tunnel by initiating outbond SSL connections that can go through the system’s proxy. The tunnel can then be used as a socks proxy on the remote host to pivot into the local host’s network.
Examples
Local
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -bindPort 1080
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -threads 400
Reverse
#On the remote host:
#Generate a private key and self signed cert
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out cert.pem
#Get the certificate fingerprint to verify it:
openssl x509 -in cert.pem -noout -sha1 -fingerprint | cut -d “=” -f 2 | tr -d “:”
#Start the handler
python3 ReverseSocksProxyHandler.py 443 1080 ./cert.pem ./private.key
#On the local host:
Import-Module .\Invoke-SocksProxy.psm1
Invoke-ReverseSocksProxy -remotePort 443 -remoteHost 192.168.49.130
#Go through the system proxy:
Invoke-ReverseSocksProxy -remotePort 443 -remoteHost 192.168.49.130 -useSystemProxy
#Validate certificate
Invoke-ReverseSocksProxy -remotePort 443 -remoteHost 192.168.49.130 -certFingerprint ‘93061FDB30D69A435ACF96430744C5CC5473D44E’
#Give up after a number of failed connections to the handler:
Invoke-ReverseSocksProxy -remotePort 443 -remoteHost 192.168.49.130 -maxRetries 10
Credit for the System Proxy trick: https://github.com/Arno0x/PowerShellScripts/blob/master/proxyTunnel.ps1
Limitations
Disclaimer
This project is intended for security researchers and penetration testers and should only be used with the approval of system owners.
PatchWerk is a proof-of-concept (PoC) tool designed to clean NTDLL syscall stubs by patching syscall…
Network fingerprinting is a critical technique for identifying and analyzing network traffic patterns, particularly in…
"HowToHunt" is a platform designed to assist hunters in improving their skills, planning their expeditions,…
SkyFall-Pack is an advanced infrastructure automation toolkit designed for Command and Control (C2) operations. It…
LummaC2 is a commodity malware designed as an information stealer, targeting browsers, cryptocurrency wallets, and…
RustOwl is an innovative tool designed to enhance the Rust programming experience by visualizing ownership…