Guides

Catch a Windows PowerShell connection with a ConPTY listener

Free, and no account needed for one session. Create a listener and follow along.

Create a listener

Authorized use only. Use RevSheller only on CTFs, your own labs, training platforms and engagements where you have permission.

The problem with Windows shells

Getting a usable shell back from a Windows lab machine is harder than on Linux. A plain netcat connection to cmd.exe or powershell.exe is a pipe, not a console. There is no line editing worth the name, Ctrl+C can kill the whole connection, programs that expect a console behave oddly, and screen-oriented tools do not render. Many Windows lab boxes also have no Python installed, which rules out Python-based clients.

RevSheller ships a PowerShell client that needs nothing but the PowerShell already on the machine, and it hosts the program behind a Windows pseudoconsole so you get a terminal rather than a pipe.

How it works

  1. You create a session on revsheller.com and copy the Windows payload. The API returns it as payloads.auto_windows, and it can be encoded with powershell_b64 for use with -EncodedCommand when quoting is awkward. See the API docs.
  2. You run it on the lab machine you are authorized to test. It is a small stager that sets a few environment variables (the session base URL, path and target token) and fetches a bootstrap script from RevSheller.
  3. The bootstrap builds the WebSocket URL for the session and downloads the PowerShell client, rs-powershell-ws.ps1. This is pure PowerShell using the .NET ClientWebSocket class, so no Python is required on the target.
  4. The client connects out over WSS on port 443 with a per-session token carried as a WebSocket subprotocol, never in the URL.
  5. It picks the first shell it finds from powershell.exe, pwsh.exe and cmd.exe, starts it behind a ConPTY pseudoconsole and relays everything to your browser terminal.

Because the connection is outbound HTTPS-style traffic, it works from a Windows VM behind NAT with no inbound rules. If the lab machine cannot reach the internet at all, use the bridge agent from your VPN-connected machine (see the THM and HTB guide).

What a full PTY on Windows gives you

The client launches PowerShell with -NoLogo -NoProfile -NoExit and removes the PSReadLine module for the session. Without that, each keystroke would echo twice when input arrives through the pseudoconsole's pipe. The practical effect is that you do not get PSReadLine niceties such as syntax colouring and predictive history, and the profile is not loaded.

Requirements and fallbacks

Running it for a lab exercise

Treat it like any other lab tool. Run it in a VM you control, a Windows box in a training platform you are enrolled in, or a host explicitly in your scope document. When you finish, delete the session in the interface so the token stops working. Shell I/O is relayed live to your browser and is not stored.

FAQ

Does the Windows target need Python?
No. The Windows stager and client are pure PowerShell using .NET ClientWebSocket.

What is ConPTY?
The Windows pseudoconsole API, available from Windows 10 version 1809. It hosts a console program behind a real terminal interface.

What happens on older Windows?
The client falls back to pipe-based I/O. It works, but without full terminal behaviour.

Can I use it on any machine?
Only on systems you own or have explicit permission to test. See the Terms of Service.

Ready to try it? One click creates a listener; you paste one command on a machine you are authorized to test.

Create a listener