Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- rem Requires WinDump @ http://www.winpcap.org/windump/install/
- rem + WinPcap @ http://www.winpcap.org/install/default.htm
- rem OR
- rem TCPDUMP @ http://www.microolap.com/products/network/tcpdump/
- echo Cisco CDP Port-ID Identifier v1.0 by Giovanni Heward (g[@]utahfd.com)
- set app=windump
- set output=\\?\UNC\127.0.0.1\c$\PortID.txt
- rem Modify output to central share if desired (e.g. \\?\UNC\server.domain.local\share\path\PortID.txt )
- for /f "tokens=4" %%i in ('route print -4 0.*^|find "0.0.0.0"') do (
- if not [%%i]==[Default] (
- for /f "tokens=3 delims=," %%s in ('wmic nicconfig get IPAddress^,SettingID /format:csv^|findstr "%%i"') do (
- for /f "delims=." %%i in ('!app! -D^|findstr "%%s"') do (
- !app! -i %%i -nn -v -s 1500 -c 1 ether[20:2] == 0x2000 | findstr "Device-ID Address Port-ID Platform"
- )>!output!
- )
- )
- )
- if exist !output! type !output!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement