
وكيل SOCKS وخادم SOCKS العكسي باستخدام باورشيل.
يقوم بإنشاء وكيل Socks محلي أو "عكسي" باستخدام باورشيل.
الوكيل المحلي هو وكيل Socks 4/5 بسيط.
الوكيل العكسي يقوم بإنشاء نفق TCP عن طريق بدء اتصالات SSL صادرة يمكنها المرور عبر وكيل النظام. يمكن استخدام النفق بعد ذلك كوكيل Socks على المضيف البعيد للتنقل إلى شبكة المضيف المحلي.
إنشاء وكيل Socks 4/5 على المنفذ 1080:
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -bindPort 1080
زيادة الحد الأقصى لعدد الخيوط من 200 إلى 400
Import-Module .\Invoke-SocksProxy.psm1
Invoke-SocksProxy -threads 400
إنشاء وكيل Socks 4/5 "عكسي" على المنفذ 1080 لمضيف بعيد:
# 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
راجع خدعة وكيل النظام: https://github.com/Arno0x/PowerShellScripts/blob/master/proxyTunnel.ps1
هذا المشروع مخصص لباحثي الأمن ومختبري الاختراق ويجب استخدامه فقط بموافقة مالكي الأنظمة.