DTPScan is a Windows PowerShell port of the original Bash-based VLAN DTP scanner by Daniel Compton. It passively listens for Dynamic Trunking Protocol (DTP) packets to detect VLAN hopping vulnerabilities on Cisco switches.
This version works entirely on Windows and uses tshark
(included with Wireshark) for packet sniffing.
- Sniffs DTP traffic to identify trunking mode
- Detects
auto
,desirable
,trunk
,access
, and other common DTP states - Fully passive — no packets are sent
- CLI-only, suitable for security assessments and red team labs
- Wireshark installed with
tshark
(CLI capture tool) - PowerShell (tested on Windows 10/11 with PowerShell 5.1+)
- Admin privileges (to capture packets from interfaces)
-
Install Wireshark
- Ensure you check "Install TShark" during setup
- Also install Npcap when prompted
-
Add Wireshark to your system
PATH
:- Add this to your
PATH
if not already:C:\Program Files\Wireshark
- Add this to your
-
Clone this repository:
git clone https://github.com/SwampSec/dtpscan-windows.git cd dtpscan-windows
- Open PowerShell as Administrator
- Run the script:
.\DTPScan.ps1
- When prompted, choose the correct interface number (you can run
tshark -D
to list them ahead of time)
[+] DTP was found enabled in mode 'switchport mode dynamic desirable'.
[+] VLAN hopping should be possible.
If DTP is not detected:
[!] No DTP packets were found. DTP is probably disabled and in 'switchport nonegotiate' mode.
DTP Mode Code | Meaning | VLAN Hopping? |
---|---|---|
0x03 | Dynamic Auto (default) | ✅ Possible |
0x83 / 0x04 | Dynamic Desirable | ✅ Possible |
0x84 | Dynamic Auto | ✅ Possible |
0x81 | Trunk | ❌ Not Possible |
0x02 | Access | ❌ Not Possible |
0xa5 | Trunk (802.1Q encapsulation forced) | ❌ Not Possible |
0x42 | Trunk (ISL encapsulation forced) | ❌ Not Possible |
- This script only tests the port you're connected to
- Just because one port blocks DTP doesn't mean others do
- Useful in red team or lab environments to validate switch misconfigurations
This tool is intended for educational and authorized security testing purposes only.
Unauthorized use on networks you do not own or have permission to test is strictly prohibited.
- Original Bash Script by: Daniel Compton
- PowerShell Port by: SwampSec