Guide Demonstrates Six Port-Forwarding Techniques for Reaching Isolated Services

· Original article ↗

Summary

A hands-on lab demonstrates six ways to reach an Apache2 service bound to localhost through a compromised host, then outlines defenses including SSH restrictions, monitoring for tunnels and listeners, and network segmentation.

Key points

  • The lab isolates Apache2 on 127.0.0.1:8080 to demonstrate access to a service unavailable to remote connections.
  • SSH local forwarding, Ligolo-ng, Chisel, Meterpreter portfwd, socat, and Ligolo-MP are demonstrated for tunneling or relaying traffic through a compromised host.
  • Ligolo-ng and Ligolo-MP use TUN interfaces and routes for network pivoting; Ligolo-MP also supports port redirectors.
  • Chisel carries forwarding traffic over HTTP/WebSocket, while Meterpreter portfwd uses an existing session and socat creates a TCP relay.
  • Suggested defenses include disabling unnecessary SSH forwarding, monitoring unexpected TUN interfaces and listeners, and detecting unusual outbound connections and long-lived WebSocket sessions.
  • The guide also recommends strict egress controls, network segmentation, least privilege, centralized logging, and monitoring socat execution.

Article Details

Topic
Port forwarding and network pivoting techniques for accessing localhost-bound services, with detection and mitigation guidance.

MITRE ATT&CK

Products

Tools

Related Articles