Pivoting is how an attacker who controls one machine uses it as a stepping stone into networks they cannot reach directly, usually by running a tunnelling tool that relays traffic between their own system and your internal network. It turns a single compromised laptop or web server into remote access to everything that machine can see. Defenders can make pivoting much harder with network segmentation and strict outbound filtering, and can detect it through new virtual network adapters, long-lived outbound connections, internal scanning from unusual hosts, and known tunnelling tools.
Very few attacks end on the first machine compromised. A phished laptop or an exposed web server is useful to an attacker mainly because of where it sits: inside your network, able to reach file servers, databases and domain controllers. Pivoting is the set of techniques that let attackers use that position from outside. Understanding it at a high level tells you where to put controls and what to look for.
What pivoting looks like
After compromising a “foothold” host, the attacker needs a way to send their tools’ traffic through it. Common approaches:
- SOCKS proxies: the foothold relays any connection the attacker requests, so their scanners and remote-admin tools appear to come from that host.
- Reverse tunnels: because inbound connections are usually blocked, the foothold connects out to the attacker’s server and the traffic flows back through that connection.
- Virtual network interfaces: modern tunnelling tools create a TUN adapter on the attacker’s side so whole internal subnets become routable, as if they were on a VPN.
- Port forwarding with built-in tools such as SSH or Windows
netsh interface portproxy. - Legitimate remote-access and tunnelling services: ngrok, Cloudflare Tunnel, Tailscale, ZeroTier, VS Code tunnels, or RMM products like AnyDesk. These are popular because their traffic looks normal and goes to reputable domains.
Open-source tools such as Ligolo-ng and Chisel are frequently seen in both penetration tests and real intrusions. Ransomware reports routinely list them, alongside abuse of legitimate remote-access software.
Why it matters
- Flat networks multiply damage. If a receptionist’s PC can reach the database server on any port, a single infection becomes database access.
- Outbound access is usually wide open. Most firewalls allow almost any outbound HTTPS, which is exactly what reverse tunnels need.
- Attacker tools never touch the inside. Scanners and exploit kits run on the attacker’s machine, so endpoint security inside your network may never see them; it sees only the relayed connections.
Prevention
Segment the network
- Separate user workstations, servers, management interfaces and OT/IoT into different VLANs or zones, with firewall rules between them.
- Workstations rarely need to talk to each other: block workstation-to-workstation SMB, RDP and WinRM with host firewalls or private VLANs.
- Allow administrative protocols (RDP, SSH, WinRM, SQL) to servers only from dedicated admin jump hosts.
Control outbound traffic
- Servers should not browse the internet. Default-deny outbound from server subnets, allowing only the update and API endpoints they need.
- Send workstation web traffic through a proxy with TLS inspection or at least domain categorisation; block uncategorised and newly registered domains.
- Block or tightly control consumer tunnelling and remote-access services you do not use (ngrok, personal Tailscale or ZeroTier networks, unapproved RMM tools) via DNS filtering and application control.
Application control
Most tunnelling tools are standalone executables dropped into user-writable folders. AppLocker or WDAC rules that stop binaries running from %TEMP%, Downloads and AppData remove a large share of them.
Detection
On endpoints and servers
- New network adapters: creation of TUN/TAP or WireGuard adapters on a host that has no business running a VPN.
- Port-proxy configuration: changes under
HKLMSYSTEMCurrentControlSetServicesPortProxy, ornetsh interface portproxyin process command lines. - Unknown executables listening on ports or making persistent outbound connections, especially from temp or user folders.
- SSH clients on Windows servers started with
-R,-Lor-Doptions. - Known tool names and hashes, but remember these are trivially renamed; behaviour is more reliable.
On the network
- Long-lived outbound sessions: a single TLS connection from a server that stays open for hours with steady bidirectional traffic is unusual. Zeek connection logs or firewall session logs reveal these.
- Beaconing: regular, evenly spaced connections to the same external IP.
- Internal scanning from an unusual source: a web server or workstation suddenly connecting to hundreds of internal IPs or ports.
- New services talking to new destinations: for example, a database server initiating SMB or RDP connections to other servers.
- DNS anomalies: very long or high-volume TXT queries to a single domain can indicate DNS tunnelling.
An example hunt in Microsoft Defender for Endpoint for processes from user-writable paths keeping outbound connections:
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where InitiatingProcessFolderPath has_any (@"AppData", @"Temp", @"Downloads", @"UsersPublic")
| summarize Connections = count(), Ports = make_set(RemotePort, 10)
by DeviceName, InitiatingProcessFileName, RemoteIP
| where Connections > 50
| order by Connections desc
Test it before an attacker does
A good internal penetration test or red-team exercise should include a pivoting phase: from a single assumed-compromised workstation, how far can the tester get, and does your monitoring notice the tunnel? The results usually point directly to the two or three firewall rules that matter most.
For Indian organisations
Many Indian SMB networks are still flat: one subnet for users, servers and CCTV. SEBI’s CSCRF and RBI’s cybersecurity frameworks both expect network segmentation and monitoring of critical systems. Restricting outbound traffic from servers alone blocks a large share of real-world tunnels and is usually achievable with the firewall you already own.
RingSafe’s internal VAPT and red-team engagements test exactly how far an attacker can move from a single foothold. Talk to us.
Get a VAPT scoping call
Senior practitioner-led VAPT — not a checklist run by juniors. CVSS-scored findings, free retest, attestation letter. India's SMBs and SaaS teams.