Pivoting tools work because networks allow more than they should. Hardening is about shrinking what’s allowed, baselining what’s normal, and watching for traffic that doesn’t fit the baseline. This note is the defender-facing counterpart to the rest of the module — same tools, opposite perspective.
The Three Legs — People, Process, Technology
No single control stops pivoting. Hardening is layered:
- People — admin discipline, MFA, security awareness, BYOD policy
- Process — asset inventory, change management, incident response, disaster recovery
- Technology — firewalls, IDS/IPS, SIEM, EDR, network segmentation, MFA
A network that nails all three is still breachable — but detection and response happen in hours instead of months.
Start With a Baseline
You can’t detect abnormal until you’ve documented normal. The baseline covers:
| Category | What to record |
|---|---|
| Enterprise hosts | Every device that should exist on the network, by role |
| Application inventory | What’s installed per host category |
| DNS records | Internal zones, delegations, allowed external resolvers |
| DHCP leases | Scopes, reservations, expected MAC ranges |
| Admin users | Who has elevated access, where, and why |
| Dual-homed hosts | Any host with more than one NIC — these are pivot candidates |
| Network diagram | Current (not from 2019) topology of VLANs, firewalls, trust boundaries |
Without this, every alert is “is that normal?” with no answer.
MITRE ATT&CK Mapping
Pivoting techniques map cleanly to ATT&CK. Pair every alert rule with its technique for faster triage.
| Technique | ID | Defensive focus |
|---|---|---|
| External Remote Services | T1133 | VPN hardening, exposed service review |
| Remote Services | T1021 | MFA on SSH/RDP/WinRM, geofencing |
| Non-Standard Port | T1571 | Monitor protocol/port mismatches (HTTPS on :444) |
| Protocol Tunneling | T1572 | Detect DNS/ICMP/HTTP tunnels; enforce allowed protocols |
| Proxy (External / Internal) | T1090 | Proxy allowlists, netflow analytics |
| Ingress Tool Transfer | T1105 | Monitor uncommon downloads, EDR file reputation |
| Living Off the Land | — | Baseline normal use of PowerShell, WMI, certutil, netsh |
Detection Strategies by Pivot Type
SSH Tunnels
- Baseline who’s allowed to SSH outbound. Workstations rarely need outbound 22.
- Alert on
AllowTcpForwarding yescombined with sessions from unprivileged accounts. - EDR hook on
ssh -D,ssh -L,ssh -Rcommand lines. - Network: long-lived TCP connections to external IPs on port 22 from non-admin hosts.
Chisel / HTTPS Tunnels
- Chisel’s default WebSocket handshake has recognizable signatures (JA3, specific HTTP headers).
- Long-lived WebSocket connections to uncategorized external IPs — alert.
- SNI mismatch (connecting to IP with no SNI, or SNI not in corporate allowlist) — alert.
- Chisel binaries hashable; feed hashes to EDR.
DNS Tunneling (dnscat2, iodine, dns2tcp)
- Volume: a workstation making hundreds of queries per second to the same zone is abnormal.
- Entropy: subdomain labels with high Shannon entropy (base64/base32-looking) indicate encoded data.
- TXT/NULL/CNAME requests at unusual ratios vs. baseline.
- Queries to recently registered domains (NRD lists catch this).
- Beaconing — same source polling the same domain at fixed intervals with no human activity.
Umbrella, Infoblox ADP, and Cisco DNS Security all flag dnscat2 defaults within minutes. Real adversaries randomize beacon timing and use high-reputation parent domains; detection shifts to volume and entropy.
ICMP Tunneling
- ICMP payload size: a normal ping is small and fixed. ptunnel packets are large and variable — simple size histograms flag them.
- Ratio of echo requests to echo replies that’s not 1:1.
- ICMP from hosts that shouldn’t ping externally (servers, segmented workstations).
Protocol Tunneling in General
- Port/protocol mismatch — SSH on 443, HTTPS on 8080, etc. Deep packet inspection or JA3 fingerprinting catches it.
- Allowlist outbound by protocol per host role. Workstations don’t need direct outbound TCP 22, 1080, 4444.
- Egress firewall logs are the single highest-value log source — ingest them into SIEM.
Proxy Pivots (rpivot, SocksOverRDP)
- Netflow showing a single internal host as the source of connections to many internal subnets within short windows.
- RDP sessions with abnormally high data volume (SocksOverRDP tunneling pushes DVC volume well above normal).
- Unexplained Proxifier / ProxyCap installs on user endpoints.
Core Hardening Controls
Network Segmentation
Flat networks make pivoting trivial. Segmenting into user / server / admin / DMZ / management zones means a single foothold doesn’t yield the whole network.
- East-west firewalls between zones, not just north-south
- Admin networks reachable only from jump hosts, MFA required
- DMZ hosts talk back to internal networks over explicitly allowed services only
- OOB management network for switches/firewalls, air-gapped from user networks
Least Privilege + MFA
- No standing domain admin — Just-In-Time elevation via PAM
- MFA on every remote access path (VPN, RDP, SSH, Citrix, VDI)
- Service accounts non-interactive, managed service accounts (gMSA/MSA) over password-based
- Regular access reviews — former employees disabled within 24h
Egress Filtering
Most tunneling tools die here if egress is locked down:
- Deny all outbound by default; allow by service/destination
- Force all web traffic through an inspection proxy
- Block direct external DNS; internal resolvers only
- Rate-limit ICMP outbound
- Alert on outbound to IPs without SNI or to uncategorized hostnames
Monitoring & Detection Stack
| Layer | Tool class | What it catches |
|---|---|---|
| Endpoint | EDR | Unusual process trees, tunneling binaries, LotL abuse |
| Network | IDS/IPS | Protocol anomalies, JA3 fingerprints, signature matches |
| Logs | SIEM | Correlation across hosts, baseline comparison |
| DNS | DNS Security | Query entropy, beaconing, NRD |
| Flow | NetFlow / Zeek | Long-lived flows, data volume anomalies |
The gaps in this stack are where attackers live. SIEM without endpoint = you see traffic but not who initiated it. EDR without egress logs = you see the tool but not the exfil.
Response Playbook (Abbreviated)
- Contain — isolate the suspected pivot host at the network level (quarantine VLAN or EDR network isolation).
- Preserve — image volatile state before shutdown (memory, netstat, process list).
- Analyze — identify tool (binary hashes, network signatures, command-line history).
- Pivot the investigation — if host A was pivoting, who was it pivoting to? Check the next hop.
- Eradicate — rotate credentials used by compromised accounts, remove persistence.
- Recover — rebuild from clean images; don’t trust in-place cleanup.
- Lessons learned — update baseline, add detection rules that would have caught it sooner.
Quick Reference — Defender’s Grep List
# Linux hosts: unexpected tunneling binaries in common paths
find / -name 'chisel*' -o -name 'ssh' -newer /etc/passwd 2>/dev/null
find / -name 'ptunnel*' -o -name 'dnscat*' 2>/dev/null
# Linux: long-lived outbound connections
ss -tnp state established
# Linux: suspicious listeners on non-standard ports
ss -tlnp | grep -vE ':22|:80|:443|:3306'
# Windows: netsh portproxy entries
netsh interface portproxy show v4tov4
# Windows: scheduled tasks that persist tunnels
schtasks /query /fo LIST /v | findstr /i "chisel plink ssh"
# Windows: SocksOverRDP plugin registered
reg query HKLM\SOFTWARE\Microsoft\Terminal Server Client\Default\AddInsThe Attacker-Defender Loop
Everything in this module is about finding and crossing boundaries. Defenders win by:
- Shrinking the boundaries (segmentation, egress filtering)
- Instrumenting the boundaries (logs on every firewall, DNS, proxy)
- Defining normal at each boundary (baseline)
- Alerting when traffic doesn’t fit normal (SIEM correlation, EDR detections)
An attacker with full knowledge of a network can usually still pivot — but every tool they drop, every protocol they abuse, every long-lived connection they leave behind is a chance for the defender to see them. Make the pivot expensive, slow, and loud.
