Re: sniffing plaintext protocols

From: Lee Lawson (leejlawson@gmail.com)
Date: Mon Jul 31 2006 - 04:35:01 EDT


I believe you are talking about ARP cache poisoning for the LAN.

This involves sending crafted ARP reply packets to two hosts so that
they update their ARP caches with the incorrect MAC to IP pairings.
This forces the two hosts to address their LAN packets incorrectly,
with the poisoned MAC addresses, the switch then switches the packets
according to the MAC address (layer 2) not the IP address (layer 3).

Begginning ARP cache on two LAN hosts.
192.168.1.1 - 00:0C:DE:36:2C:A1
192.168.1.2 - 00:0C:DE:36:2C:A2

They know their own and the other host to which they communicate with,
we need to change the ARP entry relating to the 'other' machine. If
the ARP cache is empty, the attack will simply enter new information
into the cache.

ARP reply packets sent by attacker (191.168.1.10 - 00:0C:8A:C8:AA:25):
"192.168.1.1 is at 00:0C:8A:C8:AA:25" sent to 192.168.1.2
"192.168.1.2 is at 00:0C:8A:C8:AA:25" sent to 192.168.1.1

End ARP cache on two LAN hosts.
192.168.1.1
192.168.1.2 - 00:0C:8A:C8:AA:25

192.168.1.2
192.168.1.1 - 00:0C:8A:C8:AA:25

Now we have changed (poisoned) the ARP caches of both machines, when
they try to send data to each other, they will address it with the
information from the ARP cache. This puts the MAC address of the
attacker on their packets, the switch looks at that instead of the IP
address! All data then flows to the attackers machine.

The attacker must send the ARP reply packets every few seconds (mostly
every 30 seconds) so that no one else can send an ARP reply to change
the pairings, this is done automatically by the tools. The attacker
must also have IP forwarding enabled so that all packets are put back
on the network with the correct IP to MAC pairings, this creates the
'man-in-the-middle' scenario and the victims have no idea their data
is being intercepted. This depends on the OS and tool in use, the
below Windows tool does it for you, but *nix tools require to you turn
it on manually.

The tools!
The easiest tool to use for this is Cain & Abel (www.oxid.it). It is
a Windows based tool that is fantastic for a number of different
attack vectors. It will ARP cache poison the hosts and sniff
usernames and passwords, but also logs FTP/Telnet/HTTP traffic to a
text file. It also intercepts VoIP traffic to a .wav file,
automatically intercepts SSL traffic (after injecting fake
certificates), it is great.

There are a number of *nix based tools that also do the same job.
Ettercap is probably the closest to C&A as it now has sniffing
capabilities in built. Another is arpspoof.

I won't go into the exact syntax's and uses of the tools, that would
spoil the fun of trying to work out how to do it! I will say that C&A
has a good online manual for the tool.

As for WAN based traffic, ARP cache poisoning will not work as WAN is
layer 3. What you require here is DNS poisoning or redirecting router
traffic with GRE tunnels. It is much more complex an attack, although
still relatively easy to implement with the right tools.

Have a read of this for GRE tunnelling:
http://www.hackingdefined.com/index.php/Sniffing_remote_traffic_via_GRE_tunnels

I hope this helps somewhat.

later,
lee.

On 7/30/06, itsec.info <itsec.info@gmail.com> wrote:
> Hi
>
> The background for the following questions is purely due to feasibiltiy
> reasons for pentests and there is no interest in hacking.
>
> I have read many articles about sniffing, spoofing and relaying.
> So far I learned that it is possible to connect a host, hostA, between two
> existing hosts, host1 and host2, in order to sniff e.g. plaintext protcols
> like telnet, pop3, and ftp.
>
> 1)
> Is this only in a local network possible or also in the Internet?
>
> 2)
> I would lik to test such a scenario in my private local network in order to
> prove myself and my team, that this is really possible.
>
> Can anybody provide me a kind of how-to for this scenario.
> I run different linux machines on my local network and on hostA I have various
> tools installed like dsniff, hunt, fakerout, P.A.T.H, wireshark, etc.
>
> --
> Any help is very much appreciated.
> Regards,
> Mike
>
> ------------------------------------------------------------------------------
> This List Sponsored by: Cenzic
>
> Concerned about Web Application Security?
> Why not go with the #1 solution - Cenzic, the only one to win the Analyst's
> Choice Award from eWeek. As attacks through web applications continue to rise,
> you need to proactively protect your applications from hackers. Cenzic has the
> most comprehensive solutions to meet your application security penetration
> testing and vulnerability management needs. You have an option to go with a
> managed service (Cenzic ClickToSecure) or an enterprise software
> (Cenzic Hailstorm). Download FREE whitepaper on how a managed service can
> help you: http://www.cenzic.com/news_events/wpappsec.php
> And, now for a limited time we can do a FREE audit for you to confirm your
> results from other product. Contact us at request@cenzic.com for details.
> ------------------------------------------------------------------------------
>
>

-- 
Lee J Lawson
leejlawson@gmail.com
leejlawson@hushmail.com
"Give a man a fire, and he'll be warm for a day; set a man on fire,
and he'll be warm for the rest of his life."
"Quidquid latine dictum sit, altum sonatur."
------------------------------------------------------------------------------
This List Sponsored by: Cenzic
Concerned about Web Application Security? 
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's 
Choice Award from eWeek. As attacks through web applications continue to rise, 
you need to proactively protect your applications from hackers. Cenzic has the 
most comprehensive solutions to meet your application security penetration 
testing and vulnerability management needs. You have an option to go with a 
managed service (Cenzic ClickToSecure) or an enterprise software 
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can 
help you: http://www.cenzic.com/news_events/wpappsec.php 
And, now for a limited time we can do a FREE audit for you to confirm your 
results from other product. Contact us at request@cenzic.com for details.
------------------------------------------------------------------------------


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:56:28 EDT