[ad]
CDPSnarf if a network sniffer exclusively written to extract information from CDP packets. It provides all the information a “show cdp neighbors detail” command would return on a Cisco router and even more.
The application is written in C using the popular PCAP library.
Sample Output
Cisco AIR-AP1231G-E-K9 Access Point:
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 |
$ sudo ./cdpsnarf eth2 Waiting for a CDP packet... [#0] Sniffed CDP advertisement with a size of 367 bytes. ------------------------------------------------------- CDP Version: 2 TTL: 180 ms Checksum: 0x7282 Device ID: cisco-ap.mydomain.net Software version: Cisco IOS Software, C1200 Software (C1200-K9W7-M), Version 12.3(8)JEA, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2006 by Cisco Systems, Inc. Compiled Wed 23-Aug-06 16:42 by kellythw Platform: cisco AIR-AP1231G-E-K9 Addresses: 1 Address #: 1 Protocol type: [1] NLPID format Protocol: [0xCC] IP IP Address: 157.228.87.1 Port ID: Dot11Radio0 Capabilities: [0x02] Transparent bridge |
You can download CDPSnarf here:
Or read more here.
ZaD MoFo says
I must admit: I’am kinda addicted to this site…
Thank you http://www.darknet.org.uk !
You have a very informative website. I come to visit periodically and whenever I visit each time I learn new tricks & tools.
By the way: shutdown day this saturday…
My best regards.
ZaD MoFo
Giacomo says
I think ethereal/wireshark is enought to discover this infos, without any other extra tool, isn’t it ?
Bogwitch says
@Giacomo
Yes, Wireshark will discover this information but you cannot set a capture filter for JUST this information.
It’s the same as the dsniff tools, it has a much smaller footprint and performs a single task. I use the mailsnarf and urlsnarf utilities from dsniff on a regular basis for constant monitoring when Wireshark would be overkill.
watcher says
its nice to have something small like this, just think of how easy it is to see someone using wireshark or some other bandwidth hog, now try this one.
Reticent says
@Bogwitch: I think you’ll find typing ‘cdp’ in the filter will do exactly that.
Bogwitch says
@Reticent,
I was talking specifically about capture filters rather than view filters. Sure, it can filter the view of cdp packets but the background capture is still capturing more packets than are specifically required. On a heavily loaded network, Wireshark can start running out of memory pretty fast if it is capturing large numbers of packets.
Don’t get me wrong, wireshark is an exellent product and I use it often. If they could narrow the capture filters the same way that they narrow the view filters, I would probably use it even more!
yoshi says
nothing new here – cdpr has been doing this for years
Reticent says
true. I usually capture stuff using tcpdump and write it to a file I open with wireshark; tcpdump gives you lots of nice options so you only end up with the traffic you wan’t to analyse (so it still suitable on busy networks). Alternatively, using the -A flag means you get to see the clear text protocols without using any sort of specialised tool anyway.
Sorta offtopic, does anyone know a urlsnarf type application which is able to reconstruct html pages. Ie I run the tool and it’s able to write html pages locally as it see’s them? Wouldn’t mind having a play with such a tool.
Umesh Chaurasia says
Hi,
I want to capture CDP packets from windows environment. I downloaded you CDPSnarf sample.
I also downloded getopt.c and getopt.h file from some other website.
I am able to comile CDPSnarf application by commenting 2 lines //#include
//#include
In place of unistd.h, i am using getopt.h.
When I am running my binary I am getting “unable to open Adapter” error. Following is the error details.
———————————————————-
C:\Documents and Settings\umesh.c.PARSEC>D:\SW\CDPSnarf-v0.1.6\CDPSnarf-v0.1.6\R
elease\cdpsnarf.exe -i CDP
CDPSnarf v0.1.6 [$Rev: 797 $] initiated.
Author: Zapotek
Website: http://www.segfault.gr
Couldn’t open device CDP: Error opening adapter: The system cannot find the device specified. (20)
————————————————————–
Can you please suggest what I am doing wrong?
Regards,
Umesh
dentonj says
@yoshi
From the code, CDPSnarf supports more CDP value types than cdpr.