Ettercorp
Ettercorp
By
SRIRAM KUMAR A
(Reg.No:20224012533117)
Associate Professor,
Centre for Information Technology and Engineering
Manonmaniam Sundaranar University, Tirunelveli - 627012
i
ARP Poisoning using Ettercap
By
SRIRAM KUMAR A
(Reg. No: 20224012533117)
ii
CERTIFICATE
Certified that this report “ARP Poisoning using Ettercap”, submitted for the mini
project (III Semester) of Master of Science in Cyber Security is the bonafide work
carried out the mini project under my supervision. Certified further, that to the best of
our knowledge the work reported here in does not form part of any other mini project
on the basis of which a degree or award was conferred on an earlier occasion on this
iii
DECLARATION
MASTER OF SCIENCE
in
CYBER SECURITY
on
is my original work and that it has not previously formed the basis for the award of
any Degree, Diploma, Associate ship, Fellowship or any other similar title
SRIRAM KUMAR A
iv
ACKNOWLEDGEMENT
I thank the God the almighty for showering this blessing which helped me to
complete my mini project successfully.
SRIRAM KUMAR A
v
TABLE OF CONTENTS
Description Page No
CHAPTER I.................................................................................................................. 3
1.1 INTRODUCTION
1.1.1 Overview..................................................................................................3
1.1.2 What is an ARP....................................................................................... 4
1.1.3 How it works: The Arp Process & RARP................................................4
1.1.4 Types of ARP/RARP Protocol Messages................................................ 5
1.1.5 ARP and RARP message formats............................................................ 8
1.1.6 TCP Standard Ports/Services................................................................. 9
1.2 BACKGROUND
1.2.1 Address resolution protocol……………………………………...……..9
1.2.2 ARP Cache Poisoning and Spoofing Attack.......................................... 11
1.2.3 ARP Request Spoofing.......................................................................... 11
1.2.4 ARP reply spoofing………………………………………………….12
1.2.5 THE ANATOMY OF ARP POISONING ….………………...………13
1.2.6 MAN-IN-THE-MIDDLE (MITM)……………………………………13
CHAPTER Ⅱ ……………………………………......................................................
15
CHAPTER III.............................................................................................................21
3.1.1 Methodology.......................................................................................... 21
3.1.2 Environment.......................................................................................... 21
3.1.3 Systems & Tools.................................................................................... 23
3.1.4 ARP Spoofing........................................................................................ 25
vi
3.1.5 Filtering..................................................................................................26
CHAPTER IV............................................................................................................. 28
CHAPTER V.............................................................................................................. 32
Experimental Result............................................................................................... 39
CHAPTER VI……………………………………………………………………….32
FUTURE ENHANCEMENT………………………….………………...……….42
CONCLUSION…………………………………………………………………..43
REFERENCE…………………………………………………………………….44
vii
LIST OF FIGURES
FIGURE PAGE NO
viii
5.10 Select the Sniff Option........................................................................... 37
5.11 ARP Poisoning victims….......................................................................37
5.12 Monitoring HTTP Packets….................................................................. 38
6.1 Open the Win7 machine search the Browse........................................... 39
6.2 Testing Website Page.............................................................................. 39
6.3 Open the Wireshark tools…................................................................... 40
6.4 Analysis packet in search the “ip addr”..................................................40
6.5 View follow HTTP Stream..................................................................... 41
6.6 Get the username & password................................................................ 41
ix
ABSTRACT
This project will provide a review and analysis of an open source sniffing and
ARP Cache Poisoning using Ettercap tool. Ettercap uses the insecure ARP protocol to
conduct man in the middle attacks on one or more than one targets by poisoning their
ARP cache. This feature enables it to sniff passwords, instant messages, e-mails and
sniffing methods on switched networks so they can be prepared against such tools.
This project discusses in Ettercap, its basic functionality, plug-ins that do specific
functions and finally, solutions to mitigate the risks presented will be discussed.
However, the pervasive use of ARP (Address Resolution Protocol) in local area
This feature enables it to sniff passwords, instant messages, e-mail and much
more on a switched local area network. This project sets out to comprehensively
address the issue of ARP poisoning by leveraging the power of the Ettercap tool.
1
,
,
.
Ettercap ,
,
,
,
. ,
ARP (
) ,
, ,
.
, ARP
2
.
3
CHAPTER I
INTRODUCTION
1.1 Introduction
1.1.1 Overview
4
MITM attacks enable eavesdropping between people, clients and servers. This
may include HTTPS connections to websites, other SSL/TLS connections, Wi-Fi
connections and more. When replay attacks are used, hackers do not necessarily need
to decrypt them. The attack network’s security is similar to standard data
transmission. A DoS attack involves blocking legitimate users” access to a network or
web resource. Typically, this is performed by flooding the target (usually a web
server) with traffic, or by sending malicious requests causing the target resource to
break down or become completely unreachable.
1.1.2 What is an ARP:
The Address Resolution Protocol (ARP) [4] is used by computers to map
network addresses (IP) to physical addresses or what is usually refer to: Media Access
Control addresses (MAC).
5
The figure (1.2) below shows the location of ARP in the TCP/IP Architectural
Model[7]:
There are four types of ARP massages that are sent by an ARP protocol:
a. ARP request
b. ARP reply
c. RARP request
d. RARP reply
As we just said in the definition, ARP is used to map network address (IP) to
physicaladdress (MAC) and when a host need to communicate with another host it
needs to know its MAC address. Here comes ARP protocol and works by
broadcasting a packet (ARP-Request) for any hosts connected over the Ethernet
network. The ARP packet contains the IP address of the sender and the IP address of
the target it is interested in communicating with. See Figure (1.3) and Figure (1.4):
6
Figure.1.4. ARP Request
However, the target host, identifying that the IP address in the ARP request
packet is belong to itself, so it returns an answer back in a unicast reply (ARP-Reply)
and the host which initiated the ARP request catches the [IP,MAC] pair and keeps it
in ARP cache memory. Keeping the host reply in cache will minimize the ARP traffic
in the LAN. See Figure (1.5):
7
So simply when the ARP request is broadcasted to all PC's on the network it asks the
following question:
‐Is x.x.x.x is your IP address? , if Yes send back your MAC address.
Then every PC checks if it's IP address is matching the one in ARP request
and sends ARP reply with it's MAC address.
But the repeated ARP requests especially when it is broadcasted every time a
MAC address is required; creates a high traffic in the network, and hence the
Operating Systems keep copy of the ARP replies in the computer's cache memory and
update itfrequently with any new <IP, MAC> pair, this will help in reducing the ARP
requests number[9]. By the way ARP spoofing technique which we are going to talk
about in the next chapter is occurring when forged ARP replies <IP destination, MAC
attacker> is created and sent to the source computer who initiated the ARP request
formerly and updated it's ARP cache with fake information. We will know afterward
this kind of exploitation is called "poisoning the ARP cache".
However, the most accurate expression which was adopted by kernel side is "Link-
Layer- Address" since it can be changed by some tools.
8
Figure 1.6 ARP request and reply messages
The ARP packet consists of Ethernet Header and Data packet; the
Ethernet header is divided to:
Where, the data packet structure of ARP packet is encapsulated and the
information that every part holds are demonstrated in the following table
9
Hardware address type (2 bytes). 1=Ethernet
The table below is showing, a list of services and ports used by TCP protocol:
1.2 BACKGROUND
10
Namely ARP request and ARP reply. The target host’s MAC address is included in the
ARP request, with the MAC address linked with that IP address possible to view in
the ARP reply.
11
1.2.2 ARP Cache Poisoning and Spoofing Attack
The principal objective of ARP spoofing is to exploit any ARP protocol
authentication vulnerabilities, through sending spoofed ARP messages to the LAN. In
the majority of instances, the idea underpinning the attack is to connect the attacker’s
host MAC address to the target host’s IP address, resulting in any communication sent
for the target host instead being rerouted to the attacker’s host. To evade detection, the
attacker may snoop on packets while forwarding traffic to the real default destination,
or amend the contents prior to forwarding it (an MITM attack).
A DOS attack may be performed by dropping some or all of the packets on the
network. ARP spoofing is used to capture bandwidth by preventing the
communication of all other devices. Protocols such as ARP are stateless. If a network
host receives an ARP request without requesting it, the network host will
automatically cache the response.
12
The victim believes that ARP request packet’s sender was a gateway, meaning that it
stores the information from the ARP request packet in its own ARP cache table;
similarly, the gateway is spoofed. All gateway-victim traffic is forwarded to the
attacker due to the poisoning. Subsequently, the perpetrator creates a path between
them.
13
Figure 1.12 ARP Reply Spoofing
14
1.2.5 The Anatomy of ARP Poisoning
ARP poisoning is one of the most straightforward existing attacks to carry out,
not at all sophisticated.
Very briefly, the adversary only needs to craft malicious packets and unleash
them into the network. The crafted packet can be either an ARP reply or request, as
both trigger changes in the APR cache. The protocol address length fields are left
untouched, and the only tampering is with the addresses. When targeting one device,
the destination protocol and MAC addresses are legitimate, the sender protocol
address is of the device the attacker aims to spoof, and the source MAC address is the
adversary’s own.
Upon receiving the malicious ARP packet, the victim’s ARP cache is updated,
and the specific entry with the source IP (e.g., 192.168.1.1) is now rewritten, resulting
in the network address to be associated with the adversary’s MAC. From this point,
all the communication intended to 192.168.1.1 goes to the attacker. To guard the
existence of this “poisonous” cache entry, the attacker keeps on sending malicious
ARP packets periodically. After poisoning the victim, the adversary can decide what
to do next.
15
CHAPTER II
LITERATURE REVIEW
16
2.2.1 Networking Basics
Figure.2.1 The Open Systems Interconnection Model (C. Servin, 2003 [8])
The Data Link layer provides an extra field called Frame Check
Sequence (FCS), used to correct errors and control the transmission. This model
provides standards for interactions and roles of the different protocols (Servin, C.,
2003 [8]). The conclusion is a modular network, where each protocol can be swapped
for another one of the same layers. The physical one is maybe the easiest to
understand, as Wi-Fi, Ethernet, or fiber are real objects. In this case, if an attacker
compromises the layer 2, all the above are compromised as well. Protocols using
encryption to provide security will be exposed to advanced attacks, as the attacker
will not see clear data without further exploitation. Vectors of attack are exposed by
different security researchers and security companies. The presentation by (Ornaghi,
A., Valleri, M., 2003 [9]) allows for an interesting understanding of the range and
possibilities in the different attacks. Based on the targeted mechanism, the
communications can be intercepted different ways: the attacks based on the layer 2
target the intra-network links, and can perform their activities directly on the Local
Area Network (LAN).
17
Attacks target 3 layers of the network, as they are presented in the OSI model.
The Data link layer, the Network one, and finally the Application one as well
(Ornaghi, A., Valleri, M., 2002 [9]). This is explained because of their use and role,
presented in the following parts of the document.
18
Figure 2.2. ARP role (Whalen, S., Engle, S., Romeo, D.,
2001 [11])
To mitigate such risk, there are various studies to propose a better protocol, or
implements security. The forgery of ARP packets can be easily detected using a
specialized tool such as ARP watch or Arp Alert. However to prevent them, the table
can be static and entries defined manually, not easy nor possible in all architectures,
the use of a different protocol implementing security represents the alternative (S-
ARP, Papaloe, G., 2008 [13]), switches can use a Dynamic ARP Inspection (DAI). A
DAI allows the switch to compare all ARP packets against a table of trusted hosts
(Cisco, 2010 [14]). This is used with DHCP snooping, explain can be implemented
with a dynamic architecture. Access Control Lists (ACLs) can also be used for static
entries. However, DAI is implemented on the switch, and will therefore protect only
the current broadcast Domain (Cisco, 2010 [14]).
19
The attack consists in the forgery of fake ARP packets to fill with non existent
addresses and overflow the switch's table (Bhaiji, Y., 2005 [16]). Once the operation
is successful (the size of the table varies between systems), the switch will start
behaving as a hub, allowing the attacker to receive all data (Nachreiner, C., 2008
[17]).
Among these solutions, the port security is a feature that can be enabled to
allow some security restrictions on the switch. Two types of security mechanisms can
be added this way (Cisco, 2010 [18]). The first consists in setting the maximum
amount of MAC addresses allowed per interface, avoiding a host to flood a huge
amount of random addresses; the second sets a sticky secure MAC address to a port,
as this cannot be changed by the host, only previously learned addresses can be used.
Both will prevent the switch from filling the entire CAM with the fake MAC
addresses received (Cisco, 2010 [18]).
20
List is not exhaustive (Harris, J., 2002 [22]). However, due to constraints and the
scope of this project, only a few will be experimented, covering the various issues.
For protocols that do not provide security, such as RIP version 1, they are
simply considered as obsolete (Malkin, G., 1994 [24]) and it is recommended to
switch for a more recent one.
21
• 0 – redirection for the network
• 1 – redirection for the host
• 2 – for a type of service and network
• 3 – for a type of service and host
The attack consists for the attacker to forge ICMP redirect packets for the
other hosts. They will update their routing table to use the compromised system as the
gateway (Ornaghi, A., Valleri, M., 2002 [9]), therefore allowing the attack to succeed.
In order to address the critical issue, two options are available, both involve to
disable ICMP redirect messages, on the hosts, or on the nodes of the network (it can
be individually disabled for specific interfaces). A secure implementation have been
developed for Linux, but do not seem to be effective against such attack (Ornaghi, A.,
Valleri, M., 2002 [9]).
22
CHAPTER III
EXISTING SYSTEM
3.1.1 Methodology
Based on the time that was allocated, the author decided a different order of
approach than used in the Literature. As the project had to respect delays, vectors
have been organized based on their role in the network, the functionalities involved,
their presence / activation on systems by default. The possibilities and interests it
represents to an attacker have also be taken in consideration. Vectors will be
addressed in the following order: ARP- based, ICMP, DNS, DHCP, IGPs, STP,
IRDP. And finally, the different advanced exploitations that can be conducted once
the MITM is in place in the victim network.
The process in use involved the testing of each vector, and the corresponding
defence(s). Clear-text protocols will be targeted first, represented by the use of FTP,
as explained in “Systems”. Then will be approached advanced exploitation. This
choice has been made to address efficiently the project: MITM attacks do not let the
attacker read or modify the encrypted data. However, it can be vulnerable to further
exploitation, and the defence it seems to provide has to be mitigated.
The first step will address the MITM itself, the different vectors and defences
in order to prevent them. Attacks are tested before the defence is implemented.
The second step will address encryption and the defence it provides, through
protocols such as IPSEC or SSH. Risks and potential vulnerabilities will be outlined
in order to raise concerns to users that decide to use this protection method. Advanced
exploits will be used to demonstrate vulnerabilities and possibilities or risks of an
eventual attack to privacy and security.
3.1.2 Environment
In order to perform experiments on a network, GNS3 and different
virtualization solutions are going to be used,such as VirtualBox. A testing
environment is set up and running as shown on figure 3.1.
23
Figure 3.1 Test Environment Topology
Four hosts are distributed between two networks. Systems noted Rx represent
the routers to simulate a remote environment. Equipment’s IP address(es) are
summarized as follow:
24
Figure 3.2 Example hosts lists
All networks use the netmask 255.255.255.0 (/24) allowing up to 254 hosts.
The 3.0.0.0/24 network represents the link between the two routers, and is the third
network of our topology.
25
Regarding the different nodes on the network, their virtualization with GNS3
implies compatible systems. In order to do so, equipment run the c3725
Adventerprisek9mz 124-15. T14 binary image of the IOS system. The choice to use
Cisco equipment’s is based on the precedent knowledge and practice of the author,
and the market share of about 75% for network switches and 50% for routers (
http://www.trefis.com). As this project does not aim to provide all defences on all
existing systems, the scope is limited to the equipment’s in use.
As switches do differ from bridges, their installation is the same as the other
nodes, but they do include the old NM-16ESW module. The last task is to ensure the
f0/* interfaces are not used to connect with other systems, as the switching operates
only on the interfaces above (f1/*).
The attacker machine runs a Kali Linux 1.0.6 distribution specialized for
penetration testing and other security related works. It is extremely useful as it comes
with a huge amount of packages and tools already ready to perform a wide range of
experiments and testing on networks, systems and equipment’s.
Tools
The different tools are available on Internet. They will be globally explained,
however this will be kept relatively short: the presentation will tend to focus more on
the use in the current project. Websites of the different projects provide information,
well beyond our scope.
Ettercap
‹‹ Ettercap is a comprehensive suite for man in the middle attacks. ››. website:
https://ettercap.github.io/ettercap/
26
Ettercap will be used to perform ARP and DHCP spoofing, as well as the advanced
exploits, involving filtering. Ettercap provides a language to write filters making it
really handy and useful.
The tool used on the attacker's system is Ettercap. This widely used software
provides a great toolbox for MITM attacks. An important amount of plugins and
filters can be used with Ettercap, covering a lot of cases and situations. The following
command starts the ARP spoofing of connections (including remote ones) between all
hosts and destinations (both left empty selects all):
ettercap -T -M arp:remote // //
27
Figure.3.3 Spoofing Attack
3.1.5 Filtering
Filtering allows an attacker to identify packets and choose the preferred action
to perform when forwarding it. Filtering can defeat IPSEC and PPTP connection
establishment.
The script presented in Appendix 7 shows the filter used to defeat IPSEC
connection establishment. The two parts cannot exchange key material, as Ettercap
will automatically drop the packet from or addressed by UDP to port 500.
In order to use a filter, it has to be compiled and loaded in the software. The
compilation is done using the Etterfilter tool. To load the filter in Ettercap, the MITM
attack can be initiated specifying the filter(s):
That command initiates a MITM attack using the “ARP Spoofing” method to
perform poisoning and uses the filter to forward packets and apply the required
changes.
Two outcomes can change the game. First, the connection can be set to
automatically fall back to a weakest protocol such as PPTP because of the
impossibility for the host to establish the encrypted channel. In this case, the attacker
will then be able to proceed with exploits such as key manipulation or cypher
downgrade, most of all the user can potentially never realize the change and think it is
a safe communication.
28
User does not establish at all. In that case, the attacker will probably look deeper into
its options, while the defender will try to figure out where and/or why the packets are
dropped.
As a defence, disabling the rollback to a weakest protocol is sufficient, but can
lead to the impossibility to connect while the attacker drops the required packets.
However this does not represent a data breach, busst the MITM issue is still present.
29
CHAPTER IV
PROPOSED SYSTEM
Since using ARP poisoning attacks can potentially change or mess up the
LAN configurations of the system, the experiments were conducted in an controlled
environment using Virtual Machines.
30
Figure.4.1. Host Machine (Gateway) & Attacker Machine
(Gateway)
Because of this insecure nature of the ARP protocol, all traffic can be
redirected from the intended host to the unintended (attackers) host.The process of
ARP Cache poisoning goes as follows:
Host A 192.168.1.100 00-40-
ab-0e-2c-b8 Host B
192.168.1.101 00-01-05-2a-
1b-5a Attacker X
192.168.1.102 00-55-02-2g-
4b-6a
1. X wants to poison the ARP cache of A and B.
2. X sends an ARP reply to A that looks like this
“I am B (192.168.1.101) and my Mac Address is 00-55-02-2g-4b-6a”.
31
3. X also sends an ARP reply to B that looks like this
“I am A (192.168.1.102) and my Mac Address is 00-55-02-2g-4b-6a”.
4. A and B both accept this information and add it to their ARP Cache.
5. Now all communication between A and B will go to X, which
sniffs all traffic and then forwards it to the intended hosts.
This is also referred to as the “man in the middle attack” An Attacker can
also poison these hosts by sending them completely non existing Mac addresses,
which will stop them from communicating on the network completely and thus
disable them to properly function as network clients, this type of attack is also
referred to as a DOS, (Denial of Service) attack.
32
-b This method will start a broad ping upon startup instead of an ARP
Broadcast upon startup.
-H This option, when given the arguments of IP1; IP2; IP3 will only
send ARP requests to these three hosts. This is a less invasive method.
-k This option is used to save the current host list which includes host
names, IP’s and Mac addresses.
33
CHAPTER V
Experimental Works
Open the VMware workstation setup the machine operating system the Kali
linux and Windows 7. The attack is monitoring kali linux and target is windows 7
machines.
34
Step 2. Start the win7 & Kali linux machines.
Figure 5.2. Open kali linux & win 7 in VMware Operating system run
in VMware workstation access the basic usage.
35
Figure 5.4: Check the Arp
36
Step 4. Click Open> Terminal to run a “Ettercap -G”
Step 5. Click Hosts > Scan for Hosts to run a quick scan and get a list of host
targets
37
We can run a quick scan of different hosts acting as parties in network traffic.
Click Hosts
> Scan for Hosts to run a quick scan and get a list of host targets. You should
see Ettercap populate a list of host IP and MAC addresses.
Now that you have a list of hosts, find your target in the list and click on it.
(Or, if you want to attack every computer on the network, don't select any list item.)
Step 6. Click MITM > Arp Poisoning to select the Arp Poisoning attack.
38
This will print a message letting you know that the ARP Poisoning attack is
beginning. As interesting/juicy information shows up on the wire, Ettercap will
extract it and display it, just in case you don't capture it or find it with Wireshark.
39
Step 8. The second terminal window, you will be monitoring HTTP packets.
In the second terminal window, you will be monitoring HTTP packets between the
LIN and WIN machines. Use the command:
40
Experimental Result:
Victim machine attack already now target machine search any
link in browser the packet capture.
41
Step 3: Open the Wireshark in kali linux VMware workstation.
42
Once the packet capture has started, we can test out Wireshark's abilities to
sniff out regular traffic. By running an ARP Poisoning MITM, we are able to see all
traffic to the Sheep as though we were physically sitting at the same network port as
them.
Step 5: Select the ip address & Protocol right click open the follow and view
follow HTTP Stream.
HTTP live streaming (HLS) is one of the most widely used video
streaming protocols. Although it is called HTTP "live" streaming, it is used for both
on-demand streaming and live streaming.
43
CHAPTER Ⅵ
FUTURE ENHANCEMENT
• Automated Mitigation
• Mobile Application
• These enhacements can make the ARP poisoning project more robust,
direction of future development should align with the projects goals and the
44
CONCLUSION
administrators by surprise if they are not aware of ARP cache poisoning and
unprepared to detect unauthorized activity on their network. Tools like Ettercap can
them silently. Once the attacker has a list of IP to MAC addresses, there is nothing to
stop them from sniffing passwords, sensitive information, corporate secrets, instant
messages, e-mails and any or all traffic that they want to sniff. A carefully executed
45
REFERENCE
[1] Eriksson, M., [no date]. An Example of a Man-in-The Middle Attack Against
Server Authenticated SSL-sessions.
[4] Masnick, M., 2013. The NSA Is Running Man In The Middle Attacks Imitating
Google's Servers.
[5] Pilosov, A., Kapela, T., 2008. An Internet-Scale Man In The Middle Attack.
[6] Schuba, C., August 1993. Addressing Weaknesses in the Domain Name System
Protocol.
[8] Servin, C., 2003. Réseaux et télécoms : cours et exercices corrigés [French].
[9] Ornaghi, A., Valleri, M., 2002. Man in the middle attacks [Italian].
[10] Nayak, G., N., Samaddar, S., G., 2010. Different flavours of Man-in-The- Middle
attack, consequences and feasible solutions.
[11] Whalen, S., Engle, S., Romeo, D., 2001. An Introduction to ARP Spoofing.
[12] Defta, L., 2010. Network security attacks ARP poisoning case study.
46
[14] Cisco, 2010. Configuring Dynamic ARP Inspection. In: Cisco. Cisco IOS
Software Configuration Guide, Release 12.2SX.
[15] Lauerman, K., King, J., 2010. MAC Address Overflow Attack and Mitigation
Techniques. Cisco.
[16] Bhaiji, Y., 2005. Layer 2 attacks & mitigation techniques. Cisco.
[18] Cisco, 2010. Configuring Port Security. In: Cisco. Cisco IOS Software
Configuration Guide, Release 12.2SX.
[19] Postel, J., 1981. Internet Control Message Protocol. RFC 792.
[20] Arkin, O., Yarochkin, F., 2001. ICMP based remote OS TCP/IP stack
fingerprinting techniques. Phrack Staff
[21] Odom, S., Nottingham, H., 2000. Cisco Switching Black Book.
[22] Harris, J., 2002. Cisco Network Security Little Black Book.
[23] Lair, M., 2011. OSPF: All your routes belongs to us…
[24] Malkin, G., 1994. RIP Version 2 Protocol Analysis. RFC 1721.
[25] Brown, M., A., 2007. Guide to IP layer network administration with Linux.
[27] Almquist, P., 1992. Type of Service in the Internet Protocol Suite. RFC 1349.
47
48