THREATS EXPLAINED · ENDPOINT SECURITY

Reverse shells and reverse tunnels: how one click becomes remote access

You may have heard that hackers can get a "reverse shell" or "reverse RDP" when someone opens a website. Here's what that actually means, why firewalls don't stop it, and the handful of settings that do.

Y
YogeshGlobal SOC · 14 October 2026 · 9 min read

The short answer: can a website hack you?

Simply opening a web page almost never gives anyone control of your computer. Modern browsers run websites in a locked box (a "sandbox"), and a site can't start programs on your machine by itself. For an attacker to get a shell, some code has to run on your computer first. Websites are how they get you to run it. There are three common ways:

  1. You're tricked into running a command. This is the big one right now, often called ClickFix. A page shows a fake CAPTCHA or error ("Verify you are human"), quietly copies a command to your clipboard, and tells you to press Win + R, then Ctrl + V, then Enter. That pastes and runs the attacker's command. You did the hacking for them.
  2. You download and open something. A fake browser update, a "missing font" or video codec, or a fake Zoom or Teams installer from a search ad that looks like the real download page.
  3. A browser bug (rare). Occasionally a flaw lets a malicious page escape the sandbox. These are expensive, get fixed quickly, and are mostly used against high-value targets. Keeping your browser updated closes them.
The one rule to teach everyoneNo genuine website, CAPTCHA, IT team or bank will ever ask you to paste something into the Run box, PowerShell, Command Prompt or Terminal. If a page asks, close it.

Why "reverse" gets past your firewall

Your office or home router lets traffic out freely (so you can browse) but blocks unsolicited traffic coming in. So an attacker on the internet can't just connect to your PC.

A reverse connection flips it around: the malicious code on your PC calls out to the attacker's server. To your firewall, that looks like any other outbound connection, the same as opening a website, so it's allowed. Once that connection is up, the attacker sends commands back down it.

Normal attack (blocked)
  Attacker ──────────► your firewall  ✖  your PC

Reverse connection (allowed)
  your PC ──────────► your firewall ──────────► attacker's server
          ◄══════ attacker's commands come back down the same connection ══════

Attackers usually make this connection over port 443, the same port as normal HTTPS web traffic, so it blends in even more.

What a reverse shell is

A shell is a command prompt: the text window where you type commands and the computer runs them. A reverse shell is that command prompt handed to someone else over a reverse connection. With it, the attacker can do anything you could do from a command prompt: look through files, steal saved passwords and browser sessions, install more tools, and move on to other computers on your network.

It's usually only the first step. The goal is to settle in quietly, steal credentials, and work towards the valuable systems: email, accounting, file servers and, in the worst case, deploying ransomware.

ssh -R: a sysadmin tool turned back door

SSH is the standard secure way IT people log in to servers. Since 2018 an SSH client (ssh.exe) has been built into Windows 10 and 11, and it's always been on macOS and Linux. That's convenient for admins, and convenient for attackers, because they don't need to bring their own tools. Security people call this "living off the land".

The -R option is remote port forwarding. It tells the SSH connection: "open a door on the remote server, and send anything that comes through it back down this connection to a place on my side." Admins use it legitimately, for example to reach a home lab while travelling. In the documentation it looks like this:

ssh -R <port on the remote server>:<destination on this side>:<port> user@remote-server

When an attacker runs it from a victim's PC, the "remote server" is theirs, and the "destination on this side" can be the victim's own PC or any machine on the victim's internal network, such as a file server or a domain controller. The attacker now has a private doorway from their server straight into your network, carried inside an encrypted SSH connection that your firewall let out.

Why this matters for small businessesMost small offices allow any PC to make outbound SSH connections on port 22, because nobody ever thought to block it. One ClickFix click can run a single ssh -R command that opens a tunnel into the whole office network.

"Reverse RDP" and remote-support tools

RDP (Remote Desktop) lets you see and control a Windows PC's screen remotely. Exposing RDP directly to the internet is a well-known ransomware entry point, so most firewalls block it coming in. "Reverse RDP" gets around that the same way as above: the victim's PC tunnels its own RDP port out to the attacker, often using ssh -R, so the attacker gets a full remote desktop even though RDP was never opened on the firewall.

Attackers also use:

Warning signs

How to prevent it: a small-business checklist

None of these need expensive tools. Together they break the attack at several points, which is the idea behind the ACSC's Essential Eight.

Do thisWhy it helps
Block outbound SSH (TCP port 22) from staff PCs at the firewall. Allow it only from the few admin machines that need it.Stops the ssh -R tunnel from connecting out. Most staff never need SSH.
Remove the OpenSSH client from PCs that don't need it (Settings → System → Optional features → OpenSSH Client → Remove), or block ssh.exe with application control.No tool, no tunnel. Application control is Essential Eight strategy #1.
Turn on application control (Windows App Control/WDAC, AppLocker, or Intune policies) so only approved programs run.Blocks unknown remote-access tools, tunnelling apps and fake installers, even if someone runs them.
Pick one approved remote-support tool and block the rest (AnyDesk, ngrok and so on) with web/DNS filtering.Removes the attacker's favourite "legitimate" back doors.
Remove the Run box for standard users (Group Policy: "Remove Run menu from Start Menu") and limit PowerShell for non-IT staff.Breaks the ClickFix "Win + R, paste, Enter" trick.
Never expose RDP to the internet. Use a VPN with MFA, and require Network Level Authentication.Closes the direct route as well as the reverse one.
Keep browsers and Windows updated automatically, and run an EDR such as Microsoft Defender for Business.Patches the rare browser escapes and flags suspicious behaviour like a browser-launched PowerShell.
Use protective DNS such as Quad9, Cloudflare for Families or your firewall's DNS filtering.Blocks known malicious and newly registered domains that ClickFix pages and command servers use.
Remove local admin rights from everyday accounts.Limits what anything that does run can install or change.
Train staff on the one rule above, with a two-minute demo of a fake CAPTCHA.The attack depends on someone pressing Enter. People who've seen it once don't fall for it.

For IT: how to detect it

Check a single PC

The Run box keeps a history of what was typed or pasted into it. ClickFix commands often show up here:

reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU"

Look for entries containing powershell, mshta, curl, ssh or a web address. Then check whether the SSH client is installed and whether anything is connected out over SSH right now:

Get-WindowsCapability -Online -Name OpenSSH.Client*
Get-NetTCPConnection -State Established -RemotePort 22 |
  Select-Object LocalAddress, RemoteAddress, OwningProcess,
    @{n='Process';e={(Get-Process -Id $_.OwningProcess).Path}}

Hunt across the business (Microsoft Defender / Sentinel)

SSH run with remote port forwarding on a workstation is rare and worth a look every time:

DeviceProcessEvents
| where FileName =~ "ssh.exe"
| where ProcessCommandLine matches regex @"(^|\s)-[A-Za-z]*R\s"
| project Timestamp, DeviceName, AccountName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine

Outbound SSH from staff PCs to the internet:

DeviceNetworkEvents
| where RemotePort == 22 and RemoteIPType == "Public"
| summarize Connections = count(), Targets = make_set(RemoteIP, 10)
    by DeviceName, InitiatingProcessFileName
| order by Connections desc

ClickFix leaves its mark in the Run history in the registry:

DeviceRegistryEvents
| where RegistryKey has @"Explorer\RunMRU"
| where RegistryValueData has_any ("powershell", "mshta", "curl", "ssh", "http")
| project Timestamp, DeviceName, InitiatingProcessAccountName, RegistryValueData

Also alert on remote-access and tunnelling tools you haven't approved (AnyDesk, ngrok, cloudflared and similar) appearing in process or network events, and on PowerShell or cmd.exe started by explorer.exe straight after a browser was active.

If you think it's happened

  1. Disconnect the computer from the network: unplug the cable and turn off Wi-Fi. Don't shut it down, so evidence in memory is kept.
  2. From a different, clean device, change the passwords for email, banking and anything saved in that browser, and sign out of all sessions. Turn on MFA where it's off.
  3. Tell your IT provider (or us) straight away. The sooner the tunnel and any installed tools are found, the less spreads.
  4. Report it to the Australian Cyber Security Centre at cyber.gov.au/report, or call 1300 CYBER1 (1300 292 371) for urgent help.

Want us to check your office?

We'll review your firewall's outbound rules, remote-access tools and PC settings, set up the checklist above, and give your team the two-minute ClickFix demo. Local to Glen Waverley, happy to come to you.

Talk to YogeshRun a free DNS Audit →
Y
Yogesh runs Global SOC, a security-first app and IT studio in Glen Waverley, Melbourne, helping small businesses build software and keep it secure.