Portfolio / Projects / ligolo-network-pivoting

Cybersecurity · Networking · Authorized academic lab

What changes when a compromised web server can see two network zones?

This hands-on lab starts with an internal Debian server that Kali cannot reach directly. The exercise shows how a dual-homed Ubuntu web server can become a pivot, then turns the attack path into concrete defensive lessons.

BlockedInitial pathKali → Debian
2Network zoneshost-only + internal
22 · 3306Observed portsSSH · MySQL
ValidatedPivot resultping · Nmap · SSH

Tools & technologies

Kali LinuxUbuntu / DebianLigolo-ngNmapSSH

01 / Scenario & problem

Segmentation works only while the systems that bridge network zones remain trustworthy.

The academic lab uses three virtual machines. Kali can reach the Ubuntu web server but cannot reach the Debian database server. Ubuntu has one interface in each zone and can communicate with both sides.

Lab objective

Demonstrate, in an isolated and intentionally vulnerable environment, how command execution on the public-facing server can be turned into indirect access to an internal network.

Scope.

This is an authorized academic pentesting exercise. The page explains the architecture, the reasoning and the evidence without reproducing the command-injection payloads used in the lab.

02 / Initial architecture

Kali and Debian have no direct route; Ubuntu is the only machine connected to both sides.

Kali Linux
192.168.56.103
Ubuntu Web Server
192.168.56.102 / 10.10.10.20
Debian DB
10.10.10.30
External zone192.168.56.0/24

Kali can communicate with the Ubuntu web server.

Internal zone10.10.10.0/24

Ubuntu and Debian can communicate inside the private network.

Trust boundaryDual-homed Ubuntu

The web server becomes security-critical because it touches both zones.

03 / Strategy & lab execution

The pivot is a chain of small steps, not a single tool action.

01Confirm reachability

Verify the initial segmentation: Kali reaches Ubuntu, not Debian.

02Gain command execution

Use the intentionally vulnerable PHP form in the lab to execute commands on Ubuntu.

03Connect the tunnel agent

Start the Ligolo-ng agent on Ubuntu and connect it back to the proxy on Kali.

04Route the private subnet

Create the virtual interface and route 10.10.10.0/24 through the pivot.

05Validate access

Use standard network tools to confirm that Debian is now reachable.

Kali Linux
external tester
Ubuntu Web Server
pivot host
Debian DB
internal host
Authentic lab evidence showing the Ligolo-ng session, virtual interface and tunnel
Evidence from the academic lab: the agent session is active and the internal route is established through the pivot.

04 / Result & evidence

The internal host changes from unreachable to reachable through the compromised intermediary.

Once the tunnel is active, Kali can reach 10.10.10.30. The lab then uses network reconnaissance to confirm that SSH (22) and MySQL (3306) are exposed, followed by an authorized SSH login to validate the path end to end.

Authentic lab evidence showing reachability, network scan and SSH access to the Debian server
Final proof: connectivity, service discovery and SSH access to the internal Debian host through the tunnel.
Before pivotNo route

Kali cannot reach Debian directly.

After pivotReachable

Traffic is routed through Ubuntu.

Observed services22 · 3306

SSH and MySQL on the internal host.

05 / Real-world meaning & defense

The important lesson is not the tunnel itself; it is where the trust model breaks.

A segmented internal host can still become reachable when an exposed system is compromised and is allowed to communicate across zones. The lab therefore connects offensive understanding with defensive design.

Application layer

Validate input and remove command-injection paths so the public-facing server cannot be turned into a remote shell.

Network layer

Apply least-privilege inter-segment rules and restrict outbound connections from exposed servers.

Host monitoring

Watch for unexpected processes, tunnel agents, new virtual interfaces and unusual route changes.

Detection & response

Correlate unusual outbound sessions, internal reconnaissance and authentication activity across network zones.

Why this project matters

It gives a concrete view of segmentation, Linux routing, tunneling and internal reconnaissance, while also showing why defense-in-depth matters when one intermediary host is compromised.

Main finding: the Ubuntu server does not create a new network weakness by itself; once compromised, an existing trust relationship between two zones becomes a pivot path.

06 / Limits & what I learned

The lab demonstrates one pivoting mechanism, not the full complexity of an enterprise network.

  • Three virtual machines in an isolated environment.
  • The PHP application is intentionally vulnerable for the exercise.
  • No production systems, real users or uncontrolled networks are involved.
  • The lab validates reachability and access, not persistence, stealth or enterprise-scale lateral movement.

What I learned

The most useful part was seeing segmentation from both sides: first as a barrier, then as something that can fail when a dual-homed host becomes a relay. The result connects the offensive mechanism directly to the defensive controls that matter: network least privilege, outbound restrictions and monitoring for unexpected routes, interfaces and tunnels.

Next project

HortiTrace · Final-Year Project: return to a production Data Engineering optimization.