Re: Detecting a swtich

From: Walter Roberson (roberson_at_ibd.nrc-cnrc.gc.ca)
Date: 04/27/05


Date: 27 Apr 2005 15:10:10 GMT

In article <1114590799.617477.218320@o13g2000cwo.googlegroups.com>,
 <manohar.katoch@gmail.com> wrote:
:Is there a tool that lets u detect if the device is a hub, unmanaged
:switch or a managed switch connected on a network.?

Not reliably.

Another poster indicated that with a hub, you can see frames
destined for other MAC addresses, but not with a switch.
That is not quite the case, as there are instances when you will
see other destination MACs:

a) The switch doesn't know which port the destination is on, and
so floods the packet to all ports in the same VLAN;

b) The switch MAC table is full and the switch is designed to flood
packets in that situation;

c) Multicast and broadcast and various other packets don't have -your-
MAC address as their destination: they have standard MAC addresses
that are specially recognized by your system.

d) The switch has been configured to 'span' (or 'mirror') traffic
to your port. When traffic is spanned/mirrored, it is switch dependant
as to whether VLAN tags are removed, and switch dependant as to
whether the original source MAC is preserved or if the source MAC is
replaced with the MAC of the egress switch port.

e) Your system might be on a shared media segment itself, rather than
a fully-switched segment, so there might be legitimate other destination
MAC addresses on your segment.

These factors don't mean you can't apply heuristics -- e.g., if you
see TCP SYN packets for other destinations, but seldom SYN ACK, then
you are likely connected to a switch. Similarily, if you see ARP
replies from other hosts then either you are attached to a hub or
you are on a shared segment.

One factor you can look at is whether your connection is full
duplex or not. If it is full duplex, then either there is a
misconfiguration problem, or else you are attached to a switch:
hubs are inherently half-duplex.

You cannot reliably detect whether a switch is "managed" or not.

You can monitor for packets addressed to the switch IP, but
you probably won't see them unless you are on a shared media segment
yourself -- because when a packet arrives at a switch that is
addressed to the switch, the switch is going to know exactly which
port and MAC address the packet is from, and is only going to reply
there.

Similarily, you can monitor for packets -from- the switch IP, but
again you are not likely to see them because of the above factor.

If you see RIP broadcasts or RIP or OSPF multicasts coming from
the switch, the switch is -probably- managed and probably a Layer 3
or higher device... but then one gets into debates about what it means
for a switch to be "managed". A configurable switch is not
necessarily a "managed" switch, and a switch which allows you to
telnet or http in and see per-port error counters and so on, is
not necessarily going to be willing to talk SNMP or RMON.

-- 
This signature intentionally left... Oh, darn!


Relevant Pages

  • Re: Catalyst 4000 - Ciscos Response
    ... on a variety of factors such as Switch load and traffic patterns. ... Flooding packets ... database on the switch containing switch ports and the MAC addresses sourced ... Sniffer is on a different port than the workstation and servers. ...
    (Bugtraq)
  • RE: mac duplication
    ... MAC addresses are globally unique. ... What a switch does when it sees a duplicated MAC is completely arbitrary... ... And for the interval between updates, the packets get routed only to that ... > duplication in that case so that i can sniff data. ...
    (Vuln-Dev)
  • Re: Building a local network on switches (ANTISNIFFER measures)
    ... >> arpa entries and the switch will fall back into hub mode. ... >> is true for all hubs and if I can use non SNMP controllable hub. ... > MAC address table of a certain finite size. ... Packets received from other MAC ...
    (FreeBSD-Security)
  • RE: ARP Spoof Question
    ... Hardware MAC addresses are supposed to be globally unique. ... If you have duplicate MAC addresses on a shared-media network, ... > spoofed ARP packets to receive packets but have been unable to locate ... > my switch table. ...
    (Security-Basics)
  • RE: Exploit code for IP Smart Spoofing
    ... If there is a MAC violation, this is logged and the port is ... traffic of one other host on the switch. ... but there is no way to protect against ...
    (Bugtraq)