
Proxy SOCKS et serveur SOCKS inversé utilisant PowerShell.
Crée un proxy SOCKS local ou « reverse » en utilisant PowerShell.
Le proxy local est un simple proxy SOCKS 4/5.
Le proxy reverse crée un tunnel TCP en initiant des connexions SSL sortantes qui peuvent passer par le proxy système. Le tunnel peut ensuite être utilisé comme un proxy SOCKS sur l'hôte distant pour pivoter vers le réseau de l'hôte local.
Créer un proxy SOCKS 4/5 sur le port 1080 :
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -bindPort 1080
Augmenter le nombre maximum de threads de 200 à 400
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -threads 400
Créer un proxy SOCKS 4/5 « reverse » sur le port 1080 d'un hôte distant :
# 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
Crédit pour l'astuce du proxy système : https://github.com/Arno0x/PowerShellScripts/blob/master/proxyTunnel.ps1
Ce projet est destiné aux chercheurs en sécurité et aux testeurs de pénétration et ne doit être utilisé qu'avec l'approbation des propriétaires du système.