(SRCH) Module 8 Sniffing
(SRCH) Module 8 Sniffing
Sniffing
CEH V11
CEH V11
Module 8
Module 8
Ethical Hacker
Ethical Hacker
CEH
Certified Ethical Hacker
1
Module Objectives CEH
.
Wed Aim
OverviewofSniffingConcepts
Understanding VariousSniffingTechniques
UnderstandingHowtoDefendAgainstVarious
SniffingTechniques
Understanding
DifferentSniffingCountermeasures
UnderstandingDifferentTechniques
and Toolsto DetectSniffing
Eopyright
. try.-C
O EDamacilAllFoghts
,
Reserved
&
Reprocactioni
Suricty
.
Prohitated
2
Module Flow CEH
.
Copyright
ObyEt
-GhatiL allRants
.
Resanwd
s
&
Reprociction
Strictly
Proboter
.
3
Network Sniffing CEH
Carital Whel Muster
Packetsniffingis the processof monitoring and Asniffer turnsthe NICof asystemto the
capturing alldata packetspassing through a given promiscuous mode so that it listensto allthe data
network using a software application or hardware transmitted onits segment
device
Attacker PC
It allows an attacker to observe and access the running NICCard in
Promiscuous Mode
entire network traffic from agiven point
Attacker forces A
switch to behave
Packet sniffing allows an attacker to gather as ahub
email traffic
, syslog traffic
, router configuration
,
web traffic
, DNS traffic
, FTP passwords
, chat Internet
,
sessions and account information Switch
CopyrightUbyiB
-Catcael AllRights
). ,
Resurved
Roproduction
- Strictly,Prohibitut
es
4
The major difference between a hub and a switch is that a hub
transmits
line datato eachporton themachineandhasnolinemapping
, whereas
a switch
looksat the Media AccessControl )(MAC addressassociatedwith eachframe passingthrough it
and sendsthe datato the requiredport
. A MACaddress
is a hardwareaddressthatuniquely
identifies each node of a network
.
5
A switch isis more
Aswitch more secure
secure than a hub
than a ,hub, sniffing
sniffing the
the network
network is
is possible
possible using the following
using the following methods:
:
methods
.
ARP Spoofing
▪ ARP Spoofing ARP
ARP maps aa IP address
address to a permanent physical
permanent physical
machine
machine address
address in
in a
a local
local area network (LAN)
area network )(LAN
▪ ARP
ARP is
is stateless.
.
stateless
▪ A
.
A machine
machine cancan send
send an ARP reply even
anARPreply without asking for it and
evenwithout anditit can accept such aa reply
canacceptsuch .reply.
When aa machine
▪ When machine wants
wants to sniff the
tosniff the traffic
traffic originating from another
originating from another system,
,
system itit can ARP
ARP spoof
spoof the gateway
gateway of
the network
the .network.
ARP cache of
▪ The ARPcache of the target machine
the target machine will have
have an incorrect entry
an incorrect entry for
for the
the gateway
.gateway.
,Thus, all the
▪ Thus the traffic destined to
traffic destined to pass through
through the
the gateway
gateway will
will now pass through
throughthe
the machine
machine that
that spoofed the
gateway MACaddress
gateway MAC .address.
MAC Flooding
▪ MAC Flooding
Switches maintain
▪ Switches maintain aa translation
translation table
table that
that maps
maps various
various MAC
MAC addresses
addresses to the physical ports
the physical ports on the
the switch
.switch.
Switches have
▪ Switches have aa limited
limited memory.
.
memory
▪ MAC
MAC flooding makes use of this limitation
flooding makes limitation to
to bombard
bombard switches
switches with fake
fake MAC addresses until
MACaddresses until the
the switches
switches
can no
can no longer keep up.
longer keep .
up
this happens
▪ Once this
.
happens toto a switch,
,
switch will enter fail
it will -ofail-open
pen ,mode, wherein
mode wherein itit starts
starts acting hub by
acting as a hub by broadcasting
broadcasting
to all the
packets to the ports
ports on
on the .switch.
theswitch
6
Types of Sniffing CEN
I*
.
Copyrient
DbyEX
-GmaiL AllRights
.
Reserved
Reproduction
&Strictly
Probostett
7
How an Attacker Hacks the Network Using Sniffers EH
WheelHsim
An attackerconnects
hisdesktop
/laptop to a switchport /she
He runsdiscovery
toolstolearnaboutnetworktopology
•...........................> © • * *••-----..
D
Figure 8.4
: Discoveringa switch to accessthe network Figure8.5
: Usingnetworkdiscoverytoolsto learntopology
/she
He identifiesa victim's machineto target his
/her
/she
He poisonsthevictim'smachinebyusingARPspoofing
attacks
techniques
G
*..........
MiTM
Figure 8.6
: Identifying the victim's machine Figure 8.7
: Attacker sending fake ARP messages
The traffic destined for the victim's machine is redirected to The hackerextractspasswordsand sensitivedatafrom
the attacker the redirected traffic
0300
10 1814
-0717
Figure 8.9
: Attacker extractingsensitiveinformation
Figure 8.8
: Redirecting the traffic to the attacker
.
Copyright
ObyEb
.-Council All Rights
.Resurved
-Strictly
Reproductiones Prahout
8
Protocols Vulnerable toSniffing C EH
The 7
Telnet Keystrokesincludingusernames
Passwords and data are sent in
and and passwordsare sent in clear IMAP
clear text
Rlogin text
SMTP
Passwords and data are sent in
HTTP Data is sent in clear text and
clear text
NNTP
Passwords and data are sent Passwords and data are sent
POP FTP
in clear text in clear text
:
Copyright
Oby ,Et
-Coumet AllRights
,
Reserved
,
Roproductione
StrickyProhout
9
Hardware Protocol Analyzers CEH
It can be used to monitor networkusageand identify maliciousnetwork traffic generatedby hackingsoftware installed
in the network
KeysightE2960B
(https
www.keysight.com
://
STING ProtocolAnalyzer
)(https
utelsystems.com
://
S 5C
22,03AC
C RC
OS
E NETSCOUT's
OneTouch
ATNetworkAssistant
(https
enterprise.netscout.com
://
NETSCOUTs
OptiViewXGNetworkAnalysisTablet://
(https
enterprise.netscout.com
Agilent()Keysight Technologies
8753ES://
)(https
www.microleose.com
e
Figur: Voyage
8.11
r M4x
Protocol
Analyzer Figure
: N2X
8.12 N5540A
Agilent
Protocol
Analyzer
Copyright
DbyED
,-Calmed AllFoghts
.
Resurved
,
Reproductiones
Strictly
.
Proharut
10
10
SPAN Port CEH
hie late
Internet
:::
G J
:::: J
:::::
Figure 8.13
: Working of SPAN stul
11
11
Switched Port
Switched Port Analyzer
Analyzer
SPAN is
• SPAN is aa Cisco
Cisco switch
switch feature
,feature, also
also known
known as
as “port ,"mirroring,” that
"port mirroring that monitors
monitors network
network traffic
traffic on
on one or
one or
more ports
more ports on the
the switch.
.
switch
• A SPAN
SPANport is
isaa port that is configured
thatis to receivea
configuredto receive a copy of everypacket
copyof every packet that passes through a switch
passesthrougha .switch.
When port
• When port mirroring is on, network switch
, the network
on switch sends aacopy
copy of the
the network packets from the source
source
port to the destination
tothe ,port, which
destination port which studies
studies the network packets
packets with
with the help of
thehelp of aa network analyzer
.analyzer.
12
12
Wiretapping CEH
Wheel
Attackers
connectalisteningdevice
,(hardwaresoftware
, or acombination
ofboth
) to the circuitcarrying
information betweentwo phonesor hostson the Internet
:
Note Wiretappingwithoutawarrantor theconsentof the concerned
personisacriminaloffensein mostcountries
Copyright
ObyEb
.-CamEll Allfoghts
,
Resurved
Reprodoctione
Strictly
Profastu
13
13
Lawful Interception C EH
Ite nuie
Court order
/request for wiretap Service
Provider
<
..
.. Access
Switch
T
/ ap
an access switch
/tap
exchange router
on
User 1
411
Storage
Exchange :
User
System
Law enforcement Router
agencies can access
intercepted data
whenever required User 3
Figure 8.14
: /ISP
Telco lawful solution
This type of interception monitor messages exchanged on suspicious
interception is necessary only to monitor suspicious channels in
in which
which the
the users
users are
are
engagedin
engaged in illegal activity
.activity. Countriesaroundthe
Countries around the worldare
world are making strides tostandardize
to standardize this type
typeof procedureforinterception
of procedure for .interception.
14
14
Module Flow CEH
Wid luis
Copyright
8 byEB
,-Cac0 All Rochits
,
Resurved
Reproductions
Strictly.Prohiott
15
15
MAC /CAM
Address Table CEH
16hd anim
255 .ad34.123g
00d3 Dynamic Yes Gi5
/2
Organizationally Unique Network Interface
Identifier )(OUI Controller )(NIC Specific 5 .df45.45t6
as23 Dynamic Yes 0 /5
Gi2
a8 a2
: Unicast
0
: Multicast
1
: Globally unique
0
: Locallyadministered
1
Figure 8.15
: MAC address
Copyright
ObyEb
.-ConsO AllRights
.
Reserved
Reproduction
eStrictly
Prohitud
16
16
How CAM
How CAM works
works
•
•
If the CAM
If the table is
CAMtable is flooded
flooded with more MAC
with more MAC addresses
addresses than
than itit can
can hold
,hold, the
the switch
switch will turn into
will turn into aa hub.
.
hub
The CAM
• The
•
table does
CAM table does this
this to
to ensure
ensure the
the delivery
delivery of
of data
data to
to the
the intended .host.
intended host
• Attackers exploit
Attackers exploit this vulnerability in the
this vulnerability CAM table
the CAM table to sniff
sniff network
network data.
.
data
•
•
attacker who
An attacker who can connect
connect to
to the
the shared
shared switch
switch of the Ethernet segment
the Ethernet segment can easily
easily sniff network data.
sniff network .
data
•
•
Refer to
Refer to the diagrams of
the diagrams of the working of
the working of the
the CAM
CAM table
.table. Three machines are
Three machines are shown:
:
shown Machine ,A, Machine
Machine A ,B, and
Machine B and
Machine C
Machine ,C, each
each holding addresses A,
holding MAC addresses , B,
A , and
B and C.
.
C
Machine A
• Machine ,A, holding
holding the
the MAC address A
MACaddress ,A, wants
wants to interact
interact with Machine
Machine B.
.
B
Port 1
e
.........
om MAC C
3 MAC A B is unknown
, broadcasts
ARP for
the ARP
CAM Table
Figure 8.16
: Working of CAMtable step
-1
17
17
Machine Bpossessesthe /d
target
estination IP address
, so it sends an ARPreply along with its
MAC address
. The CAM table stores this MAC address along with the port on which this
machine is connected
.
MAC A A is on port
:
MAC C
CAM Table :
Learn B is on port 2
Figure 8.17
: Working ofCAM table step
-2
Figure8.18
: Workingof CAMtablestep
-3
18
18
What Happens When a CAM Table Is Full
? CEH
Wad lute
The figure
The figure illustrates
illustrates howa
how a CAM
CAM table
table can
can be
be flooded
flooded with
with fake
fake MAC
MAC addresses to
monitor the
monitor the frames sent from
frames sent from the victim host
the victim to another
host to another host
host without any CAM
without any CAM table .entry.
table entry
Y is on Port 3
MAC PORT Traffic A B
& MAC B
PO
Traffic A -------> B
Port
Figure 8.19
: Floodinga CAMtable Totaturt
19
19
MAC Flooding CEH
MAC floodinginvolvesthe flooding of the CAM Mac Flooding Switches with macof
table with fakeMAC address and IPpairs until it is macof is a Unix
/Linux tool that is a part of the dsniff
full collection
**
MAC
User 1 8f9
14
5
7
:2 3 fc :4
bb 22
21
:8 7 db 0.0.0.0.48709 > 0.0.0.0.15710
: S 1044800461
:1044
Address Flood )
(0
800461 win 512
:1e :9
12
f4
e : :3
9f 97
848 :55
ec 0.0.0.0.9433> 0.0.0.0.62409
: S 1330659371
:1330659
)
(0
371 win 512
05
53
3
:2 8 :42
c7 3f :1
4fa
6 c :d6
el 0.0.0.0.57830 > 0.0.0.0.6910
: S 628366088
:62836
Attacker Switch 6088 (0
) win 512
729
60
4
:ce c
f1 97d
a6
6
c2
:a 4
5 0.0.0.0.58215 > 0.0.0.0.56497
: S447162501
:4471
)
(0
62501 win
04
27
5
2
:7 5
e
6
3 : b9
cb : :6
57
b9
8 9
d 0.0.0.0.17385 > 0.0.0.0.28393
: S 1018850322
:101
)8850322
(0 win 512
23
35
:C : 59
5e :b6 :
8f : 9d
6a : : ea
2b : ec 0.0.0.0.27895 > 0.0.0.0.61217
: S 1066823910
:1066
User 2 )
(0
823910 win 512
: :a0
95 68 c: 1d
: fc b9
: f1
: 77
a4
6
:9 e 0.0.0.0.60630 > 0.0.0.0.3405
: S 99214739
:99214739
)
(0 win 512
:e
le d6
4
ab
:1 3 dd
:af 77
4
:2 e
6 0.0.0.0.56144 > 0.0.0.0.16970
: S 1864068613
:18640
)
(0
68613 512
Figure8.21
: MACfloodingusingmacof
20
20
Assume that there are three machines in a :
network Host A
, the target's Host B
, and the
attacker's Host C
.
Host A bfce
caa
d
-fe b
d 10.0.0.1 Port A
Host B cfcg
bb
d
fe
-g d
e 10.0.0.2 Port B
Host C dfh
cc
fe
g
-h d
e
g 10.0.0.3 Port C
Table 8.2
: Details of three hosts in a network
5 Host B cfcg
bb
d
fe
-g d
e 10.0.0.2 0 Port B 10.0.0.2 cbb
d
fe
g
-fcg
d
e
5 Host C dfh
cc
fe
g
-h d
e
g 10.0.0.3 0 Port C 10.0.0.3 dfh
cc
fe
g
-h d
e
g
Table 8.3
: MAC table Table 8.4
: ARP cache table
21
21
. Switch portstealing is asniffing technique used by an attacker who spoofsboth the IP
1
Port
addressand the MAC addressof the target machine(Host B ).
Port
Stealing
Machine MAC Address IP Address
Stealing Host A bfce
caa
d
-fe b
d 10.0.0.1
Ports
Port A
Host B cfcg
bb
d
fe
-g d
e 10.0.0.2 Port B
Host C cfcg
bb
d
fe
-g d
e 10.0.0.2 Port C
Table8.5
: Switchupdated with aspoofed entry
.
2 The attacker's machine runs a sniffer that turns the machine's NIC adapter to
promiscuous mode
.
. Host A
3 , associated with the IPaddress ),
1
( 0.0.0.1 wants to communicate with Host B
,
associatedwith the IP address ).
(10.0.0.2 Therefore
, host A sendsan ARPrequest (I
want to communicate with 10.0.0.2
. What is the MAC address of 10.0.0.2
?).
. The switch broadcasts this ARP request to all the machines in the network
4 .
.
5 Before Host B (the target machine
) can respond to the ARP request
, the attacker
responds to the ARPrequest by sendingan ARPreply containing the spoofed MAC and
IP addresses (I am 10.0.0.2
, and my MAC addressis ).
cfcg
bb
d
fe
-g d
e
The attacker canachievethis bylaunching an attack such as denial of service()DoS on
HostB
, whichslowsdownitsresponse
.
22
22
.
6 Nowthe ARPcache inthe switchrecords the spoofed MACand IPaddresses
.
IP MAC
10.0.0.1 bfce
caa
d
-fe b
d
10.0.0.2 cfcg
bb
d
fe
-g d
e
10.0.0.2 cfcg
bb
d
fe
-g d
e
Table8.6
: ARPcache updated with a spoofed entry
.
7 The spoofedMAC addressof target HostB )-g c(bfcg
d
fe b
d
e andthe port connect to
the attacker's machine (Port C
) and updatethe switch's CAMtable
. ,
Now aconnection is
established between Host A and the attacker's machine (Host C
).
255 Host A aa
cb
d
fe
-fce
b
d 10.0.0.1 0 Port A
Host B cfcg
bb
d
fe
-g d
e 10.0.0.2 0 Port B
Host C cfcg
bb
d
fe
-g d
e 10.0.0.2 0 Port C
Table8.7
: MACTableupdatedwith a spoofedentry
. ,Now the systemwill forward all the packets directed towards Host Bto HostC through
8
PortC
, i.e
., the attacker's machine
.
,
Thus an attacker cansniff the packets sent to Host B
.
23
23
How to Defend against MAC Attacks CEH
Thie -
0c
00
1
:c Only 1 MAC Address
0d
00
4
:d a
b Allowed onthe Switch Port
132,000
Bogus MACs
Figure 8.23
: FloodingCAMtables
Figure 8.24
: Blocking MACflooding
Configuring Port Security on Cisco Switch
: As shown the figure
shown in the ,figure, the
the number of MAC addresses allowed
MACaddresses allowed on the switch
switch port
port is
is
switchport port
-security limitedtoone
limited to ;one; therefore
,therefore, the
theMAC
MAC requests arerecognized
requests are recognized asflooding
as .flooding. Port
Portssecurity
ecurity
switchport port
-security maximum 1van access locks down
locks down the
the port
port and
and sends
sends an
an SNMP
SNMP trap
trap
switchportport
-security violationrestrict
Portsecurity canbeused to restrict inbound traffic
switchport port
-security agingtime2
from only aselected setof MAC addressesand limit
switchportport
-security agingtypeinactivity
MAC flooding attack
snmpserverenabletrapsport
-security -rate
trap 5
:
Copyright
Oby.Eb
-Caucu AllghtsResurved
. Roproduction
isStrictly
Prohibitut
24
24
How DHCP Works CEH
INks Adie
DHCPserversmaintainTCP
/IP configurationinformation
, suchasvalidTCP
/IP configurationparameters
, valid
IPaddresses
, and theduration of the lease offeredby the server
, inaa database
It provides address configurationsto DHCP
-enabled clients inthe form of a lease offer
DHCPDISCOVER
)(IPv4 / Send My DHCP
SOLICIT )(IPv6 )(Broadcast Configuration Information
....................) --•--•..............
-relay
DHCP agent
Figure 8.25
: Working of DHCP
25
25
DHCP Starvation Attack EH
Thad Aries
• Attacker
Attacker floods the theDHCP
DHCP server by sendingnumerous
by sending numerous DHCP requestsand
requests and
uses
uses all of the available IP addresses that the DHCP server can issue
all of the available IP addresses that the DHCP server can .issue. DHCP Starvation Attack Tool
: Versinia
• As
As aa result
,result, the
the server
server cannot
cannot issue
issue any
any more
more IP ,
addresses
IP addresses, leading
leading toto aa DoS
DoS yersinia 0.8.2
SIP
by Slay & tomac
DIP
DHCPmode
MessageType Iface Last seen
17
17
•[
:2
])9
.attack.
attack 0.0.0.0 255.255.255.255 DISCOVER etho 18 Dec :2
17
179
0.0.0.0 255.255.255.255 DISCOVER etho 18 Dec :2
17
179
• Because
Because of this issue,
,
issue valid users cannot obtain
valid obtainor
or renew their
their IP ;
addresses
IP addresses; 0.0.0.0 255.255.255.255 DISCOVER etho 18 Dec :2
17
179
0.0.0.0 255 255.255.255 DISCOVER eth0 18 Dec :2
17
179
,thus, they
thus they fail
fail to access
access their
their network
.network. 0.0.0.0 255.255.255.255 DISCOVER eth0 18Dec :2
17
179
•
0.0.0.0 255.255.255.255 DISCOVER etho 18 Dec :2
17
179
An attacker broadcasts
An attacker broadcasts DHCPDHCP requests
requests with
with spoofed
spoofed MAC
MAC addresses
addresseswithwith 0.0.0.0 255.255.255.255DISCOVER eth0 18 Dec :2
17
179
the
the help
help of tools suchsuch as Yersinia,
,
Yersinia ,
Hyenae
Hyenae, and .
Gobbler
and Gobbler. 0.0.0.0
0.0.0.0
255.255.255.255
255.255.255.255
DISCOVER
DISCOVER
eth0
eth0
18 Dec :2
17
17
18 Dec :2
17
17
9
9
0.0.0.0 255.255.255.255 DISCOVER etho 18 Dec 2:17
17
9
S
..
...
.*.
**A
sisHM A
M
A
CR
O
Dl
n
O
User DHCPServer
C
4
:2
b
1re
d
a
Total Packets
: 154037 DHCPPackets
: 154037 MACSpoofing[X
]
lB C
A
sic-C
re
d
a
Server runs out of IP
A
User will be
unable to get the
valid IP address
s
y
M
l
za
e
E
g
L C
A
Md
a
s
e
-3:4
h c2
2 s
r
b:
a
ss
dre
ids
addresses to allocate
to valid users
DHCPScope
DHCPFields
Source 41
02
3
6
0
:5 8
3
6
2
000.000.000.000
CH02
41
3
6
0
:5 8
3
6
2
I
Destination MACFF
000.000.000.000
Extra
: FF
: FF
: FF
: FF
: FF
SIP 000.000.000.000 DIP 255.255.255.255 SPort 00068 Port 00067
Op01 Htype 01 HLEN06 Hops 00 Xid 643C9869Secs 0000Flags 8000
000.000.000.000 GI 000.000.000.000
‡
10.10.10.1 Figure8.28
: ScreenshotofYersinia
10.10.10.2 DHCP
dhcpstarv(://
)https
github.com
Attacker sends many 10.10.10.3 Starvation
different DHCPrequests Attack Tools Gobbler ://
)(https
sourceforge.net
with many source MACs
DHCPig(://
/https
github.com
10.10.10.254
Attacker
O
.-
Copyrignt
byEf
-SometiLAllToghts
.
Reserved
Reprodicuion
&strictly
Prob
anted
Figure8.27
: DHCPstarvationattack 26
Rogue DHCP Server Attack CEH
Inas Saim
• Attacker can
Attacker can perform
perform MITM
MITM attacks such assniffing
as .sniffing.
• An attacker who
An attacker who succeedsin
succeeds in exhausting
exhausting the DHCP server's
the DHCP server’s IP address space
IP address space can
can set
set up
up aa rogue
rogue DHCP
DHCP server on the
server on the network
,network,
which
which isis not
not under the control
under the control ofof the
the network .
administrator
network administrator.
• The
The rogue
rogue DHCP
DHCP server impersonatesaa legitimate
server impersonates legitimate server
serverand
and offers
offers IP addressesand
IP addresses network information
and other network information toto other
other clients in
the network
,network, acting asa default gateway.
as a default .
gateway
• Clients connectedto
Clients connected to thenetwork
the network with theaddressesassigned
with the addresses assigned by therogueserver
by the will now
rogue server will nowbecomevictimsof MITM and
become victims of MITM and other
other
,attacks, whereby
attacks whereby packets
packets forwardedfromaclient'smachine
forwarded from a client’s machine will will reachtherogueserverfirst
reach the rogue server .first.
DHCPDISCOVERY
)(IPv4 / SOLICIT
)(IPv6 )(Broadcast
DHCPREQUEST
)(IPv4 /REQUEST
)(IPv6 )(Broadcast
............. .....................
DHCP Server
DHCPACK )(IPv4 / REPLY
)(IPv6 )(Unicast from RogueServer
User
Byrunning a roughDHCPserver
, anattacker
IP :
Address 10.0.0.20 cansend incorrect TCP
/IP setting
Subnet :
Mask 255.255.255.0
Default :
Routers 10.0.0.1
WrongDefaultGateway- Attackeris the gateway
DNS Servers
: ,
192.168.168.2
192.168.168.3 Wrong DNS server Attacker is the DNS server
Lease :
Time 2 days
WrongIP Address› DoSwith spoofed IP
Figure 8.29
: Rogue DHCPserver attack
27
27
How to Defend Against DHCPStarvation andRogue Server
C EH
Attacks Imam Stim
Defend
Defend Against
Against DHCP
DHCP Starvation
Starvation Enable DHCPsnooping
, whichallowsthe switchto accept
a DHCPtransaction directed from a trusted port
• Enable
Enable port security to
port security to defend
defend against
against aa DHCP
DHCP starvation
starvation
.attack.
attack Defend
Defend Against
Against Rogue Server Attack
Rogue Server Attack
• Port
Port security limits the maximum
security limits maximum number
number of MAC
MAC addresses
addresses • DHCP
DHCP snooping
snooping feature
feature that
that is available on
on switches can mitigate against
on the
on the switch
switch port
.port. rogueDHCP .
servers
rogue DHCP servers.
• When the limit
limit is ,
exceeded
is exceeded, switchdrops
the switch drops subsequent
subsequent • It isconfigured
It is configured onon the
the port
port on which the valid DHCP server
valid DHCP .
connected
server is connected.
MAC
MAC addressrequests( )packets from
address requests (packets) from external sources
,sources, • Once configured,
,
configured DHCP snoopingdoesnot
DHCP snooping does not allow
allow other
other ports
ports on the switch
switch
which
which safeguards the server against a DHCP
DHCP starvation
starvation to respond to DHCP Discover packets sent by
to respond to DHCP Discover packets sent by clients..
clients
.attack.
attack • ,Thus, evenan
Thus even an attackerwho
attacker who manages
manages to build aa rogue
rogueDHCP server
serverand
and
connectsto theswitch
connects to the cannotrrespond
switch cannot espondtoto DHCPDiscoverpackets
.
DHCP Discover packets.
DHCP Snooping
Enabled Trusted
DHCP
Server DHCP
Untrusted Untrusted
Server
Attacker User
Attacker User
Figure 8.30
: Defending against a DHCPstarvation attack Figure :
8.31 Defending against a rogue server attack
.
Copyright
ObyED
-SounciL AllRantsReserved
Reproduction
isStnctlyProbintet
28
28
What Is Address Resolution Protocol )?
(ARP EH
AddressResolutionProtocol()ARP is a statelessprotocolusedfor resolvingIP addresses
to machine )(MAC addresses
All network devices (that need to communicate on the network
) broadcast ARP queries on the network to discoverother machines
' MAC addresses
When one machine needs to communicate with another
, it looks up the P address in its ARP table
. If the MACaddress is not found in
in the table
, the
ARP REQUESTis broadcast over the network
Figure 8.32
: Working of ARP protocol Figure 8.33
: ARP cache 29
ARP Spoofing Attack CEH
Mad au
,
Yes I am here
This is 10.1.1.1 and my
MAC address is -A1
B1
ARP packetscan be forged to D11
C1
E
-F
send data to the attacker's
machine Poisoned ARP cache
MAC
ARP spoofinginvolves
10.1.1.0 21
8
9
5
-6 8
9
5
6
constructing many forged ARP
I want to connect to 10.1.1.1 26
11
3
4
5
-6 2
3
4
5
request andreply packets to ,
10.1.1.1 but I need User B User C
10.1.1.2 84
55
6
5
3
-4 8
6
5
3
overload the switch a MAC address
Switch broadcasts
Sends ARPrequestonto Actual legitimate user
The switch is set in ARP request the wire responds to the ARPrequest
"forwarding "
mode after the .....
é ......
é
Figure 8.34
: Workingof anARPspoofingattack
30
Threats of ARP Poisoning CEH
1
Usingfake ARPmessages
, anattackercandivert all communicationsbetweentwo machines
, resulting in all
traffic being exchangedvia the attacker's PC
• Packet :
Sniffing
Packet Sniffing: Sniffs traffic over
Sniffs traffic over aa network
network or
or aa part
part of
of the
the network
.network.
Session Hijacking:
• Session :
Hijacking Steals valid session
Stealsvalid session information
information and uses
usesitit to gain unauthorized access
togain to an
accessto an application
.application.
• VoIP
VoIP Call :
Tapping
Call Tapping: Usesportmirroring
Uses port ,mirroring, whichallowsthe VolPcalltapping
which allows the VoIP unittomonitorall
call tapping unit to monitor all networktraffic
network traffic
Manipulating Data
• Manipulating :Data: ARP spoofing allows
ARPspoofing allows attackers to capture
attackers to capture and
and modify
modify data,
,
data or stops the
or the flow
flow of traffic
.traffic.
iMan-in-the-Middle
• -M
tMan
n
heiddle Attack:
:
Attack attacker performs
An attacker performs a MITM
MITM attack they reside
attack where they reside between the victim
between the victim and
server.
.
server
Data Interception:
• Data :
Interception Intercepts IP
Intercepts ,addresses, MAC
IP addresses MAC addresses,
,
addresses and VLANs
and VLANs connected to the
connected to the switch
switch in
in aa network
.network.
• Connection Hijacking:
•
:
Hijacking ,hijacking, anattacker
In connection hijacking an attacker can
can manipulate a client's
client’s connection
connection to take
take
complete control
complete .control.
.
Copyright
ObyEn
.-SonadiL AllRight.Reserved
&
Reprocuction
StralyProt
-cited
31
31
Connection Resetting:
• Connection :
Resetting
Stealing Passwords
• Stealing :Passwords: An attacker uses
An attacker forged ARP
uses forged ARP replies and tricks
replies and tricks target
target hosts
hosts into
into sending
sending sensitive
sensitive
information such
information such as usernames
usernames and
and passwords.
.
passwords
different IPaddresses
different IP ,addresses, which
which will be overloaded
will be with aa huge
overloaded with huge amount
amount of
of traffic
.traffic.
32
32
ARP Poisoning Tools CEH
This Nim
Dynamic ARP
• Dynamic Inspection )(D
ARPInspection (DAI) prevents poisoning
Al prevents .attacks.
poisoning attacks
DAI is
• DAl a security
is a security feature
feature that
that validates ARP packets
validates ARP packets in
in aa network
.network.
DAI validates
• DAI validates the ARP packets
the ARP packets using a DHCP
using a DHCP snooping
snooping binding .table.
binding table
The DHCP
• The
•
snooping binding
DHCP snooping table consists
binding table consists of
of MAC ,addresses, IP
MAC addresses IP addresses,
,
addresses and
and VLAN .interfaces.
VLAN interfaces
validate the
• To validate
•
the ARP
ARP packet
,packet, the
the DA
DAI performs
performs IP-address-to-MAC-address
tIP
M
-a
oddress
AC binding inspection
binding stored in
inspection stored in the
the
DHCP snooping database
DHCPsnooping before forwarding
databasebefore forwarding the
the packet
packet to its destination
.destination.
• If any
any invalid
invalid IP
IP address
address binds
binds a MAC ,address, the
MACaddress the DAI
DAI will discard
discard the
the ARP .packet. This
ARPpacket This eliminates
eliminates the
the
risk of
risk of MITM .attacks.
MITM attacks
34
34
How to Defend Against ARP Poisoning C EH
Inas
.*
binding table then
DHCPSnoopingEnabled discard the packet
DynamicARPInspectionEnabled
ARP 10.10.10.1
..**.......................
Saying 10.10.10.2
is MAC C
Check the MAC and IP fields to see if the ARP from the
interface is inthe binding
; if not
, traffic is blocked
Figure 8.36
: DefendingagainstARPpoisoning
35
35
ARP Spoofing Detection Tools C EH
Imam Mim
warp+ureegistered
version
Fie WArp
Professional
Help
ArpON
sourceforge.net
://
https
StatusARP attacksdetected
! Securitylevelsetto
: basic
ARPStraw
MAC Host Vendor Intertace Online Cache Firstseen
github.com
://
https
10.10 10.1 -035
RDOW ,VmwareInc
. Do8
- InteltRo
8 -
unkno 11
/2 2
019 10
16
:5
10.10.10.2 00
-3 10.10.102 ,
Vmware.
Inc D8 - Intel
/o &. .
unkno 11
/2 2
019 /1038
18
X 30.70.10.19
10.10.10,13
10.10.10.19 -
-
00
-
50
00
Windows10
PARROT
,
,
Vrmare
,
Vmwire
www.goodshov.Ummtre
.,
Inc
.
Ine
.
Int
DoRInter00&
Cad- Intel o B
.
0.8-Intel) & únino
.
.
unkno
unkno
..
yes
10 11
/2
11
/2
2
019
/ 019
11
2 2
2
019
:58
16.10
:18
16
5 0
/1058
16
10.70.10.254 004 10.10.10.254 ,
Vimmate .
Inc •B • Intel
D )
/F .
B -
unknie yes 11
/2 2
019 16
16
:0 1
shARP
github.com
://
https
KArp122- 5mappings
- 2interfaces
- 5alerts
www.xorp.net
://
http
Copyright
ObyED
-GonniL AllRights
.
Risend :
Reprocuctions
Strictly
Probiotert
36
36
MAC Spoofing
/Duplicating CEH
I a
This attackallowsanattacker to gain accessto the network andtake oversomeone'sidentity on the network
•..................
Attacker
Internet
Figure 8.38
: MAC spoofing
/duplicating attack
.
Copyright
O byEt
- LIL All Rights ReservedReproduction is Stnctly Prototer
37
37
MAC Spoofing Technique
: Windows CEH
HAhel
Type""/a
ipconfig
ll or 'net configrdr
" in thecommandprompt toverifythe
changes
If the changes
arevisiblethen reboot the system
, otherwisetry method2
(change MACaddressin the registry
)
OK Cancel -&
Expurignt
by.ib
-ConnelAll.foghtReserved
, Reproductions
Strictly
Profitut
38
38
MAC Spoofing Technique
: Windows )(Cont'd CEH
Ines Quie
Method 2
: Stepsto change
the MACaddressintheRegistry
he Earnies hosp
PressWin +R toopen Run
, type regedt32tostartthe (40007be
e
T
-b
0 676471
sad
ic1
ice 10018
A Dosa
registry editor 14606
4
H
-b 72
325
let
ee ;00000be10218
a stranuntie WARAT
NOCO
)'
-S
USPChechaumOfoaSe ,St
ma
:
Note Donot type Regedittostart theregistryeditor NUT
grumPCheckwumCHlowdD_410,52
Thiage
Go to Ndh
Azaptivers
L Eunise 82G AT
"HYSTEM
S
\C KEY_LOCAL_MACHINE
urrentControlSet
on PROTethd
810
, DiVoR axoconcoo4
)(1.12
\C8002be10318
trol
e
4d36e972
\(
1
b
}-0 325
1ce
fc1
lass and 0059 rende BEGSZ ,PONVEN
SOBADEN101
0084 natanceltt REDAZ POWeRReG DEv_1dD
/pOISADa
IsUesTsd
double click on it to expand thetree DowerDute 80 SE 1013
-2 0
*0005
2008 ,ENARY
RED DoDe2 caa022al d
4igit subkeysrepresentingnetwork adapterswill be
-d
SEe REDSE realityE13
.4LLigahd
:
Newer
Connection
NI
E
B
displayed(starting with 0000
, ,
0001 ,
0002 .)
etc RED S2 :12506
12
H4slypaPre
Searchforthe proper"DriverDesc keyto findthedesired el Indudedi
14t Shing
interface Untierene
eljindSaction
Him
okAtomis New MAC
-click
Right on the appropriate subkeyandadd
, new string 4 ntaler Address 2 00110142
-00
Continatatior Value582
value""NetworkAddress (data type"$
"R| EG_
2 to contain Properties 00 de95 % 51
-16
the new MAC address -405
14055077
(dtice
-e
S
*#
Right clickon the "NetworkAddress stringvalue on the instancald ESANSAAC
NANS
HIS-A CF
-MOZZESHERS
4( 036377
:4325 -810818
80026
right side and select Modify
... t-
-•
14064773
/ hathudindex
4
# REGDWORD Seb0008000
- 0 68
/2 )
dosedie REDS2 5
Inthe "Edit String
" dialogue
,box "Value data
" fieldenter .
IntertacontadTr REAL
OWORD 001058 18140dc4641
)(132331081378233084
:0l25
14
.-e 6487d 080020e1031
E ahara REDS2 Microsoft
the new MAC address and click "ON REG S2
caNing or lete
:
Disable and then re
-enable the network interfacethat was
Does72
e40e
-1 325 -00002
ef5 /03187.0001
be
changed or reboot the system
Copyright
E by.it-ChawouAllRights
.
Reserved
Sticky
=-
Reprocuction Prohibut
39
39
Registry
Editor
File Edit View Favorites Help
(4800Zbe10318
e
1
-b
0 d36e971
325
1ce
fc1 Name Type Deta
(4800Zbe10318
9
€
e
1
b
-0 d36
72
325
1ce
fc1 ) "TransmitBuffers
alt 512
REG_SZ
at !P.*U. DPCHecksumOffload REG_SZ 3
0001
)ahi ... *UDPChecksumOffloadIP REGSZ 3
Linkage
) AdaptivelFS
at REGSZ 0
Ndi
all RucType RFG 57 5
PROSeNdi
0002
Pd Characteristics REGDWORD 0X00000084
)(132
0003 all Componentid REG SZ DEV_10D3
&
PCIWVEN_8086
0004 ah DeviceinstancelD REG_SZ \V070015AD
PCI
.D
S
_
$
& EN_80868
UBSY
EV_10D3
0005 DriverDate REGSZ 3015
-2 0
90 DriverDateData REG BINARY 00 0012cea062 d001
006 Al DriverDesc REG SZ )
(R
Intel 82574LGigabit NetworkConnection
0008 ) DriverVersion
alt REG SZ 12.12.50.6
0009 1 IrTypePre
0010 4h includedi
EditString
0011 ab InfPath
0012
Vale :
name New MAC
ali Infection
|NetworkAddress Address
0013 ** InstallTim 120011 0047 03
Configuration At ITR Vale data
:
e
1
b
-0
Properties
(48002be10318
d36973
325
1ce
fc1
| Loglinks
at :95 Sd
000s 68.76
MasterSia
(48002be10318
9
€
e
1
-b
0 436
74
325
1ce
fc1
|Matching
(49002be10318
e
1
b
-0 436c975
325
1ce
fc1
|ah NetC
/qinstanceld REGSZ (F022E64EB555
4
-9
0 A96
131
3CF
363544C
(48002be10318
1
323
-€
b
-0 4362377
1ce
fe1
(48002be10318
9
€
e
1
b
-0 d36
78
325
1ce
fc1
1 NetLuidindex REG_DWORD 0x00008000 )(32768
abl NetworkAddress REG SZ
(48002be10318
9
€
e
1
b
-0 d36
79
325
1ce
fc1
(48002be
9
€
e
1
b
-0 d36
7b
325
1ce
fc1 10318 14 NetworkinterfaceinstallT
... REGQWORD 0x1d51191a8dc4641
)(132031081378235969
(48002be10318
9
€
e
1
b
-0 d36
7d
325
1ce
fc1 do ProviderName REGSZ Microsoft
(48002be
9
€
e
1
b
-0 436
7e
325
1ce
fc1 10318
- AliWaitAutoNegComplete
REGSZ 2
\HKEY_LOCAL_MACHINESYSTEM
Computer CurrentControl5et
ControlClass
(48002be
9
€
e
1
b
-0 d36
72
325
1ce
fc1 /NOI
10318
40
40
MAC Spoofing Tools C EH
Technitium TechnitiumMACAddressChanger)(TMAC
SMAC
MAC Address allows you to change)(spoof theMedia
www.kicconsulting.net
://
http
Access Control )(MAC Addressof your
Changer
Network Interface Card()NIC instantly
H Technitium
MACAddress
Changer
v6-by Shreyas
Zare X
File Action Options Help MAC AddressChanger
Network Connections Changed MACAddress Link Status Speed www.oovirusthanks.org
://
https
M LocalArea Connection
* 1 No 00
-0 0 ,
Down Non Operational O bps
V Ethernet No -
50 , Operational
Up gbps
M LocalAreaConnection
* 2 No -
16 , NonOperational
Up 0 bps
M LocalAreaConnection
* 4 No -
26 ,
Up NonOperational 0 bps
Change MAC Address
Information IPAddressPresets Wizardsystems.com
://
https
•ConnectionDetails
ChangeMACAddress
58 93 - 96 - 38 - 38 - 16 "Random
MACAddress
(56
]-9 8
3 RuckusWireless:(Address 880WestMaudeAve
. Mow
Spoof
-N e
v Automatically
restart
network
connection
toapplychanges sourceforge.net
://
https
V MakenewMACaddress persistent
Received130.91MB(137268355bytes
)
Use'02asfirstoctetofMACaddressWhy
? -Speed 11.09KB
/s (11354bytes
]
Sent 202 61MB(212449471bytes
)
ChangeNow
! ReADIETic
-Speed 11,93KB
/s (12217 bytes
) Copyright
ObyEB
.-hwaniL AllNgot.Rotarved
s
&
Repracuiction
stnally
Prob
.anted
41
41
IRDP Spoofing CEH
16
Router
Internet
user
A NAI
Attacker Router
Attacker
Routing Table
.
Ecoyright
ObyEl
-GonaniLAllRights
.
Risarved
:
Repronuctions
Stnctly
.
Frotbiter
42
42
VLAN Hopping CEH
4640 Ster
Figure 8.43
: Illustration of switch spoofing
.
Copyright
Obyif-Gonnail allRants
Reserved
Refrocittion
s
& Strictly
Probtun
/o
43
43
Inner
Double Tagging Switch 2
Switch 1
Attackersadd and modify tags in the Ethernet frame
, thereby Trunk
• the outer
outertagtag is the native VLANofVLAN of the attacker
.attacker.
• Whentheswitch
When the switch receives receivesthe Ethernet
Ethernet,fframe,
rame it strips off
offthe outertag
the outer , as
tag, as
Attacker
itit is
is the
the same
same as the tag
as the tag for
for the
the native
native VLAN
,VLAN, and
and forwards the frame
forwards the frame with
with Server1 Server2
VLAN 1
an inner
an inner tag
tag on all its
on all its trunk
trunk interfaces.
.
interfaces
• This allows
allowsan attacker to bypassthe
anattacker bypass the network mechanism by jumping
networkmechanismby jumpingfromfrom Figure8.44
: Illustrationof double tagging
his native VLAN to the victim’s VLAN(s), and also allows him/her to send
his native VLAN to the victim's )
s
(
VLAN
, and also allows h
/
him
er to send
the traffic
the traffic to
to other
other VLANs.
.
VLANs
• This attack is possible only if the switch switch ports
ports are configured
configured to use native
.VLANs.
VLANs
44
44
Tree Protocol
Spanning Tree Protocol((STP)
)STP
STP is used
• STPis used in LAN-switched
-switched
LAN networks with the primaryfunction
networkswith primary function of removing potential loops within the network.
removingpotentialloops .
network
STP Attack STP ensures
• STP that the
ensures that the traffic
traffic inside
inside the
the network
network follows
follows an
an optimized path to
optimized path to enhance
enhance network
network performance.
.
performance In
In
this process, a switch inside
this ,
process aswitch inside the network appointed
network is appointed as the root bridge.
.
bridge
After the selection
• Afterthe selection of the root bridge,
,
bridge other
other switches in the network
switchesinthe network connectto
connect to it by selecting a root
byselectinga .port.
rootport
Attackers
connecta rogueswitchinto thenetworktochangetheoperationsofthe STP
protocolandsniffallthe
network traffic
Attackersconfiguretherogueswitchsuchthat its priority is lessthan that ofanyother switchin the network
, which
makesit the root bridge
, thusallowingtheattackersto sniff allthe traffic flowingin the network
Traffic flow
nOW Switch 1
MiC
frater Server
Priority =32765
Root
Bridge
Rogue Switch
Priority =0
Traffic flow Switch 2 Traffic flow
Attacker -oter
Proc
45
45
How to Defend Against MAC Spoofing CEH
.
DHCPSnoopingEnabled If IP and MACentry in the bindingtable
Dynamic ARPInspection Enabled does not match
, then discardthe packet
IP Source Guard Enabled
,
Check the MAC and IP fields to see if the traffic from the
interfaceisin the bindingtable
; if not
, then traffic isblocked
Figure 8.46
: Defending against MACspoofing
46
46
Youcanalsoimplement
You can also implement thefollowing techniques
the following techniques to defend
to against MAC
defendagainst MAC address spoofing attacks
addressspoofing : :
• IP
• IP Source
Source Guard:
:
Guard IP Source
IP Guard is
Source Guard is aa security feature in
security feature switches that
in switches that restricts the IP
restricts the IP traffic on untrusted
traffic on untrusted
layer 2 ports
layer2 by filtering traffic
portsby traffic based onthe
on the DHCP snooping binding database
DHCPsnooping .database. It prevents spoofing attacks
spoofingattacks
when the
when the attacker
attacker tries
tries to spoof or
to spoof or use the IP
use the IP address of another
address of another host.
.
host
• :Encryption
Encryption: Encrypt
Encrypt tthe
he communication
communication betweenthe
between theaccesspointand computerto
access point and computer topreventMACspoofing
.
prevent MAC spoofing.
Retrieval of
• Retrieval MAC :Address: Youshould
ofMACAddress You should always
always retrieve the MAC address from the NICdirectly
MACaddress NIC directly instead of
of
retrieving it
retrieving from the
it from the OS
.OS.
47
47
How to Defend Against VLAN Hopping CEH
Thee Sate
switchport
switchport
Switch
trunk
Switch
:
-i(cfonfig
)#
-i(cfonfig
nonegotiate
)#
:
mode access
mode nonegotiate
switchport
switchport
mode
mode
Il
H
Ensure that each accessport is assigned with
VLANexceptthedefault VLAN[VLAN 1
trunk native
native
):
switchport
:
van
.
Copyright
Oby.El
-GomunilAllRights
.
Reserwd
Reprocuctiones
Strictly
Probioter
48
48
How to Defend Against STPAttacks C EH
To prevent an ST attack
, the following security features must be implemented
:
.
Copyright
ObyE
-GonnaiL AllRights
Reserwd
Reprac
Jction
&Strictly
Prat.cited
49
49
DNS Poisoning Techniques CEH
Imi M
Internet DNS
DNS Cache
Spoofing (Remote Poisoning
)
network
Proxy Server
DNS Server DNS Poisoning .,
DNSAttackScripts
Copyright
Oby8.-GaunciLAllRights
. .
Reserved
Reproc
ittionisSincly
.
Fratinder
50
50
Intranet DNSSpoofing CEH
- 1
In thistechnique
, the attacker'ssystemmust be connectedto the local areanetwork()LAN andbe ableto sniff
packets
It workswell againstswitcheswith ARPPoisonRouting
What is the
IP address of Router
?
www.xsecurity.com Real Website
IP 10.0.0.254
www.xsecurity.com
DNS Request : 200.0.0.45
IP
. r con
wse
Bro
s to
nect
10.0
.0.5
John
Attacker poisons the
:(IP 10.0.0.3
) Attacker sniffs the
router and redirects DNS
credential and
requeststo his machine
redirects therequest
to real website
www.xsecurity.com
is located at
10.0.0.5
ker
Attac
sets
.comup
fake
ecurity
ww.xs site
Web
(I0.5
:10.0.
)P
DNS Response Attacker runs
/dnsspoof
arpspoof Fake Website
ter
Figure 8.47
: Intranet DNSspoofing
51
51
Internet DNSSpoofing C EH
Shas
Internet DNSSpoofing
, the attackerinfects John'smachinewith aTrojanand changeshis DNSIP address
to that of the attacker's
What is the
IP address of
?
www.xsecurity.com
John's Browser
connects to 65.0.0.2
O
.............................. 20 .........................
Attacker sniffs thecredential
and redirects therequest to
John
:(IP 10.0.0.5
)
.
.. om
rity.c
secu
.-
www
dat
ate
loc
. .2
0.0
65.
DNS
.........
nse
Respo Fake Website
: 65.0.0.2
IP
eal website
Real Website
www.xsecurity.com
:
IP 200.0.0.45
DNS Request
to 200.0.0.2
Figure 8.48
: Internet DNS Spoofing
52
52
Proxy Server DNS Poisoning CEH
This Anim
Usetheproxyserver
esceptfor addresses
thatstartwitht/
Figure 8.49
: Proxy server DNS poisoning
53
53
DNS Cache Poisoning CEH
Shad Anim
DNScachepoisoningrefers to altering or addingforged DNS recordsinto the DNSresolver cacheso that a DNS
queryis redirected
to amalicioussite
If the DNSresolver cannot validate that the DNSresponses have been receivedfrom an authoritative source
, it
will cachetheincorrect entries locally
, and serve them to userswho makea similar request
Send DNSresponse
with IP of a fake
website
Attacker's fake website sniffs the
credential and redirects the
request to thereal website
111
Figure 8.50
: DNScachepoisoning
54
54
DNS Poisoning Tools CEH
This Suie
)
(1 -poison
DNS
•- github.com
://
https
DarpUaRE
Codedby Adrian Fernandez)(G
Armatu
adrtanfaS P Ettercap
-project.org
www.ertercop
://
http
-
TIT Options to use
:
ion
« - SpoofTheOS querypacketsof a cortain IP address
calls - Spoof the ONSquery packets of all hosts
It :
Examples
ay thon3 DerpASpoof
-py .
192 160.1.28Byfile.tat 14 Evilgrade
mython3Derml5poof.pyall nyfilo.tat
5! github.com
://
https
|
(L Spoofing DNSresponses
.
SpoofedresponseSent to
. |:
[192.160.1.174 Redirecting |TexampLedomain1
.com to
T Spoofedresponse sent to ]:
# [192.168.1.174 Redirecting .(exampledomain1com
]
Spuofed response sent to ];
[192.168.1.174 Redirecting ](exampledomainl.com
Spoofed response sent to 1192.168.1.174
|! Redirecting . xampledomaln1 com
[e ] TORNADO
LATSpooled responsu sent 1192.168.1.17413 Redirecting .(exampledomadn1 com
]
[# Spnofedresponse
sent to .[192 168.1.174
|: Redtrecting.(exampledomainl
] to
com github.com
://
https
github.com
://
https
.
Copyright
ObyEN
-ConuniLAllRants
.
Resend
Reproduction
&StallyProbititer
55
55
How to Defend Against DNS Spoofing CEH
UseDNS Non
-Existent Domain()NXDOMAIN Rate
Usea SecureSocketLayer )(SSL for securingthe traffic
Limiting
Implement anintrusion detection system()IDS and Do not allow outgoing traffic to useUDPport 53 asa
deploy it correctly default source port
56
56
Module Flow C EH
16 is
CopyrightOtryEN
.-GoalsiL AllrantsRasarved
nepranuctido
=-suviclly
.
Frobister
57
57
Sniffing Tool
: Wireshark CEH
Inter Setim
)"Etherett 0 X
It lets you capture and Frie .
Analyse SoninticsTilephony WirelessTools Help
interactively browse the FIS
= GARD
traffic running on a .
Expression
Deatnatoo ProtocolLangt
computer network 6.744690 fd151460515a2o1Ped
. fre21riiffc812222 ICMPV5 B6 Neighbor Soliettation for fe881125056ff rec0
:2222 from 00154
/5
:0008
5
/1 60515026 freziErffc012221 DCPPV6 96Netglibor Solicitation for fed811250156tf fec812222 from 00l1f12
72217
, 194,32 TOR SE TRACT- 4
Wiresharkuses
. Winpcapto 0.146791 muse 5d161
:63 mare :4
84
166 ARO mo 10,20,18.10ds mt PaiR
: 2975d061
160
capture packets on its own .
EA 51701 10,10.90.1 279.295.205
-2 50 550P 236 N
-STARCH• NITTP
-
/1
supported networks 6000
13
:5
-/1 045
476 ff00 :7
ffcl
1
:: 227 $
TOP a nimighporSolicitati ::
m :50ff
250 :7222
Ffmco fr :1612
.20
200.244.255,250 55OP 230 M
-SEARCH - HTTP
.
/1 1
5800
640
-:1 49420 :ffed
ffaaces
-2 227 to pvo
. m liwighterSalseitationfa ::
180 fec0
250,30ff
:2 422 from00
:f2
captures live network id :0
27
816 Broadcast ARO 47 kho hen10.10.10.21 Tell 10.18.18.10 (duplicate unsof 10.10.10
.
5a
FE
- 88
26 :38
22
can be used
.
wreshar Ethe G190872124240N0408DE :
Packetsa 1Dopiaren
: 94(100.0741
•Dropper
: 010.0740
))Profie
: Defae
www.wireshorkc.org
://
https
.
Copyright
ObytN
-GununiL
AllRights
.
Reserved
:
Reproduction
Stnicty
Probated
58
58
Display Filters in Wireshark C EH
Gamed the tute
Display filters are used to changethe view of packets inthe captured files
Display
Filtering by :
Example Typethe protocol inthe filter box
; ,
arp ,
http ,
top ,
udp ,
dns or ip
Protocol
Monitoring .
top 23
==
port
the Specific ip.addr
192.168.1.100
-= machine
Ports .
ip -192.168.1.100
addr 66 top.port
-23
Filtering by 10.0.0.4 or
ip.addr
Multiple IP
ip
. addr -= 10.0.0.5
Addresses
Copyright
ObyiB
.-Coumen
AllFoetits
,
Resurved
Reproduction
-StretyProhatur
e
59
59
Sniffing Tools C EH
Shi Mis
0.55418 /Smin
Come Antyr atProjectI Can Cape113
We GalOs
fria
-I J o threatie
airs her T
-@- 40 Slew l
G Ended Ore Teeal a tRie
at line Ly fat k trie PenelloiceE
*MiNE Easi
EA
SH
D %fate tica
I SLEE rabel
it
ed lisage to fat l
a lato
the lem
:
TE 00 US We WOODIA
www.nverbed.com
://
https www.colasoft.com
://
https
Copyright
ObyEh
.-GhanniLAllRights
.
Reserved
Reproduction
isStrictly
Prohibited
60
60
Sniffing Tools )(Cont'd CEH
toast Master
Omspotl
OmniPeek Observer Analyzer
A Eden Ht Action www.wavisolutions.com
://
https
OmniPeek sniffer Butter stag
apt all packaita
StopGagione
displays aGoogle
Map in the a tr
PRTG Network Monitor
AUDITION Packet Source Intravon Phon
ID Hags SueKeatveTime
holacelAccicabon
OmniPeek capture or luig incal 1 10.107A
. Ge E 0 100 www.poessier.com
://
https
1.197.44 SenereDitoel N 4,11800 MITES AP
window showing 18.17,49 ¿ Secesteta
, locas 44 0,244705 4110 400
.
Server2612LocaL | 15,107.4.90 84 0,714821 4717 ATTE
the locations of all /cI
C
1.10.20.1 5301 119 24.007779 .350 5536
.10.10.1
an 55001 119 15.007252 SSOP 253P
the public IP
Abra
Lucit 18.10.30.5 550 110 26.8000NISSOPROOP SolarWinds DeepPacket
.6.8
R.R # 27
G -400176 UNL
addresses of
Get
Con
Seim
4,8.3.8 /bRt
Serve
%, 10043 156 27.381508 Ins
Inspection and Analysis
alicatona ,.
server2919 dotal : 20
. 108
. -200
72 78 27.188787 H4115 www.solonwinds.com
://
https
captured packets Mel
S
Tuart Inta
PrO
Apress FLagsi 4a00000000
Voice&deu Stasiese -0000
4
co Packet Loretas 84 Xplico
Ancia -:
äestam 56.305359120
13
:0 9 /131
11 www.xplico.org
://
https
noaak Attacaet .
TIRe 2
FeetMap Destinationr
Seattes 00 19
/ More le
Stacktice Protocol Typet 6a0000Interest
, Protospe
APART IP MEsio Lit tec
= interset dentocal Pataccal
Nado Version 4 la a bil
Protescali Hester Length mol TAL
Diet Services
: ON80 000C2 -TrOuSee Colasoft Packet Builder
www.colasoft.com
://
https
Captiong Tramwe Partetu
, 12061 .
Databan Br1720
www.nveaction.com
://
https
.
Copyright
ObyED
.-Caunall AllRoghts
.
Reserved
Reproduction
: Strictly
e Prohitad
61
61
Packet Sniffing Tools for Mobile Phones CEH
.
Nass Ante
:
Copyright
ObyEN
-GonanilAllRights
.
Reserved
Reproduction
isStrictly
Prob.bted
62
62
Module Flow CEH
Dar te
I% falm
Copyright
ObyEN
-BonaiL AlRights
.
Riserved
.&
Reproductioe
Strictly
Protoboat
63
63
HowtoDefend
AgainstSniffing C EH
as
%
m peter
Restrict physical access to the network media to ensure that apacket sniffer cannot be installed
02 Use -e
tond
end encryption to protect confidentialinformation
05
Turnoff network identification broadcasts
, and if possible
, restrict the network to authorizedusers
to protect the network from being discoveredwith sniffing tools
64
64
How to Defend Against Sniffing )(Cont'd CEH
-
Ina nute
Use HTTPSinstead of HTTPto protect usernames Always encrypt wirelesstraffic with a strong
and passwords encryption protocol suchas WPAand WPA2
Use a switch instead of a hub as a switch delivers Retrieve the MAC directlyfrom the NIC insteadof
09
data to the intended recipient only the OS
; this prevents MAC addressspoofing
UseSecureFileTransferProtocol(),
SFTP instead Use tools to determine if any NICsare running in
of FTP for the secure transfer of files the promiscuous mode
UsePGPandS ,/MIME ,
VPN,
IPSec /TLS
,SSL Secure Usetheconceptof Access
Control List)(ACL to
allow access to only a fixed range of trusted IP
Shell ),
(SSH and One
-time passwords)(OTPs addresses in a network
Copyright
ObyEb
.-Colmed AllRight
. .
Resurved
&
Reprueaction
StualyProhiotun
65
65
Module Flow CEH
1
.
Copyright
ObyEn
-Boweril AllRights
.
Ratered
RepracucioS
Stnchy
-oten
Prot
66
66
How to DetectSniffing CEH
Ia
You need to check which Run IDS and see if the MAC Run network tools such as
machines arerunning in the addressof anyof the machines Capsa Portable Network
promiscuous mode has changed(:Example router's Analyzer to monitor the
Promiscuous mode allows a
MAC address
) network for detecting strange
packets
network device to intercept
and read each network IDS can alert the administrator Enables you to collect
,
packet that arrives in its about suspicious activities ,
consolidate ,
centralize and
entirety analyze traffic data across
different network resources and
technologies
.
•C
-
0
COPyrIght
Oby.L
-SomatilAllRights
.
Rosaived
Reproductab
&Sticky
.
Probioned
67
67
Sniffer Detection Techniques
: Ping Method and DNS Method CEH
*
JS
#::: IP ID
: 194.54.67.10 IP ID
: 192.168.168.2
:
MAC 16
00
0
2
-4 4
0
1
3
No Response :
MAC 14
00
6
4
:e b
8
2 DNS Server
Admin Suspect Machine
,
10.0.0.4 ,
10.0.0.1
25
36
3
4
S
-KE
G6
2 26
11
3
4
5
-6 2
3
4
5 Ping )(192.168.0.3
Figure8.62
: -promiscuous
Non mode
IP ID
: 192.168.168.3
Copyright
Obyth
,-baall allRights
.
Reserved
Reproduction
&Sinicity
Probinitert
68
68
Sniffer Detection Techniques
: ARP Method CEH
Figure 8.64
: Detectingsniffing viathe ARPmethod
Copyriant
ObyEB
-G . All Raghts
EL .ReservedReproductionis StrictlyProhad
69
69
Promiscuous Detection Tools CEH
Inte
n
Sca Tools Profie Help
demo- NetScan
Tools
&Pro
Demo
Version
Build
2019 based
-3
7 onversion
11.86.3
:
Target 9
10.10.10.1 :
Profile Cancel File Edit Accessibility
View (P46 Help
:
Command map-script sniffer
-detect 10.10.10.19 o
Welcome ClickheretoBuyNowl Manual Promiscuous
ModeScanner
Hosts Services map OutputPorts
/ HostsTopologyHostDetailsScans Automated Tools
Lisethistool to find * Broadcast
31bit 2 Multicast
Address
0 E7Group
BitAddress AddNote
05 Host nap --
script sniffer
-detect 10.10.10.19 Details Manual Tools tall
) networkadapters
istening
in promiscuousmode
. Broadcast
15bit | multicast
52 Address
1 Automated
INO
m
www.goodshapping.co
)(10.10.10.19 Starting Nmap7.80 https
nmap.org
:// at -2
12
2019
1 :58
16 Broadcast
abit 52Multicast
Address
3 1P40
Standard Time
Nap scan report for www.goodshopping.com
)(10.10.10.19 PingScanner Scanning
andAnalysts
Complete
Add toFavorites
Hostis up (8.00s latency
). Network
Interface
Do Scan
Not shown
: 978 closed ports
PORT STATE SERVICE hereto
,(13 10.10,10
) -tr ‹)82574
, Gigabit
Network
Connection
Port Scanner stop
/tcp
21 open ftp
/tco
80 open http
Start IP Address 1PAddrenaMAC
Addreas1
/F Hanut
.., HostnameB31B16 B5 GRPMOMI H3 Analyata
/tcp
111 open rpchind 10.10.10.10 00
- ,
VMware.
Inc WINDOW310 X y Maybe
/tep
135 open marpe Promiscuous
Mode 10.10.10.13 00
- ,Vivere Inc
. PARROT
/tcp
139 open netbios
-ssn End IP Address
10.10.10.19 00
- ,
Wwware .
Inc www.go X
... X % X Xx ProM SCUDDEMode
/tcp
443 open nttps
/tcp
445 open microsoft
-ds Real
Time
Blackiet
,
Check
/tcp
636 open ldapss1
/tcp
990 open ftps p Resolve
IPs
to
- Hostnames
/tcp
3389 open -sms
werver
bt
RFC
Reference
Library
/tcp
5061 open sip
-tis Packet
Delay
)(ms
/tcp
8080 open http
-proxy FavoriteTools
10
MACAddress
: 07
00
2
8
3
:EC
9
02 )(VMware
Active Discovery
Tonis
Host script :
results
PassiveDiscovery
Tools
-detect
:_sniffer Likely in promiscuous mode(:tests "11111111
")
DNS Tools
Nap done
: IP address(1 host up
) scannedin 4.28 seconds PacketLevel
Tools
FilterHosts
70
70
Module Summary C EH
Hid luie
D O In thismodule
, wehavediscussedthefollowing
:
Sniffing concepts alongwith protocols vulnerableto sniffingand varioushardware
protocol analyzers
Varioussniffingtechniquessuch asMACattacks
, DHCPattacks
, ARPpoisoning
,
spoofingattacks
, DNSpoisoning
, . alongwith their countermeasures
etc
Various sniffing tools
Copyright
ObyEB
.-ConcO All:Right
,
Reserved
Reprodactionas
Stricky
Prohiannd
71
71