
Socksプロキシ、およびPowerShellを使用したリバースSocksサーバー。
PowerShellを使用してローカルまたは「リバース」Socksプロキシを作成します。
ローカルプロキシはシンプルなSocks 4/5プロキシです。
リバースプロキシは、システムのプロキシを通過できる発信SSL接続を開始することでTCPトンネルを作成します。このトンネルは、リモートホスト上のsocksプロキシとして使用され、ローカルホストのネットワークにピボットすることができます。
ポート1080でSocks 4/5プロキシを作成:
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -bindPort 1080
スレッドの最大数を200から400に増やす
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -threads 400
リモートホストのポート1080に「リバース」Socks 4/5プロキシを作成:
# 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
System Proxyのトリックのクレジット: https://github.com/Arno0x/PowerShellScripts/blob/master/proxyTunnel.ps1
このプロジェクトはセキュリティ研究者およびペネトレーションテスターを対象としており、システム所有者の承認がある場合にのみ使用すべきです。