SlideShare uma empresa Scribd logo
1 de 58
Baixar para ler offline
Alberto Ornaghi <alor@blackhats.it>
                                   Marco Valleri <naga@blackhats.it>



Man in the middle
attacks
 What they are
 How to achieve them
 How to use them
 How to prevent them



                 Blackhats Italia 2003                          1
Table of contents
 Different attacks in different scenarios:
 LOCAL AREA NETWORK:
 - ARP poisoning - DNS spoofing              - STP mangling

 FROM LOCAL TO REMOTE (through a gateway):
 - ARP poisoning    - DNS spoofing    - DHCP
 spoofing
 - ICMP redirection - IRDP spoofing   - route mangling

 REMOTE:
 - DNS poisoning       - traffic tunneling   - route mangling


                    Blackhats Italia 2003     2
Once in the middle...




         Blackhats Italia 2003   3
Sniffing
   It is the easiest attack to launch since
    all the packets transit through the
    attacker.

   All the “plain text” protocols are
    compromised (the attacker can sniff
    user and password of many widely
    used protocol such as telnet, ftp, http)

               Blackhats Italia 2003   4
Hijacking
   Easy to launch

   It isn’t blind (the attacker knows
    exactly the sequence numbers of the
    TCP connection)



              Blackhats Italia 2003   5
Injecting
   Possibility to add packets to an already established
    connection (only possible in full-duplex mitm)

   The attacker can modify the sequence numbers
    and keep the connection synchronized while
    injecting packets.

   If the mitm attack is a “proxy attack” it is even easier
    to inject (there are two distinct connections)



                    Blackhats Italia 2003     6
Filtering
   The attacker can modify the payload of the
    packets by recalculating the checksum

   He/she can create filters on the fly

   The length of the payload can also be
    changed but only in full-duplex (in this case
    the seq has to be adjusted)

                 Blackhats Italia 2003   7
Attacks examples




      Blackhats Italia 2003   8
Attacks examples (1)
Command injection

   Useful in scenarios where a one time
    authentication is used (e.g. RSA token).
    In such scenarios sniffing the password is
    useless,    but   hijacking      an already
    authenticated session is critical

   Injection of commands to the server

   Emulation of fake replies to the client

                 Blackhats Italia 2003   9
Attacks examples (2)
Malicious code injection

   Insertion of malicious code into web
    pages or mail (javascript, trojans,
    virus, ecc)

   Modification on the fly of binary files
    during the download phase (virus,
    backdoor, ecc)

                Blackhats Italia 2003   10
Attacks examples (3)
Key exchanging

   Modification of the public key exchanged by
    server and client. (eg SSH1)

                                        start
      Server                                           Client
               KEY(rsa)                 KEY(rsa)
                             MITM
               Ekey[S-Key]              Ekey[S-Key]
      S-KEY                   S-KEY                    S-KEY

                             D(E(M))
               Eskey(M)
          M                                           D(E(M))

                     Blackhats Italia 2003            11
Attacks examples (4)
Parameters and banners substitution
   Parameters exchanged by server and client can be
    substituted in the beginning of a connection.
    (algorithms to be used later)

   Example: the attacker can force the client to
    initialize a SSH1 connection instead of SSH2.

    – The server replies in this way:
           SSH-1.99 -- the server supports ssh1 and ssh2
           SSH-1.51 -- the server supports ONLY ssh1
    – The attacker makes a filter to replace “1.99” with “1.51”

   Possibility to circumvent known_hosts
                       Blackhats Italia 2003          12
Attacks examples (5)
IPSEC Failure

   Block the keymaterial exchanged on the
    port 500 UDP

   End points think that the other cannot start
    an IPSEC connection

   If the client is configured in rollback mode,
    there is a good chance that the user will not
    notice that the connection is in clear text
                Blackhats Italia 2003   13
Attacks examples (6)
PPTP (1) - description

   Uses GRE as transport layer (no encryption,
    no authentication)

   Uses the same negotiation scheme as PPP
    (req, ack, nak, rej)

   Negotiation phases are not authenticated

   MS-CHAPv2 mutual authentication can’t
    prevent this kind of mitm
                Blackhats Italia 2003   14
Attacks examples (6)
PPTP (2) - attacks
   During negotiation phase
    –   Force PAP authentication (almost fails)
    –   Force MS-CHAPv1 from MS-CHAPv2 (easier to crack)
    –   Force no encryption

   Force re-negotiation (clear text terminate-ack)
    – Retrieve passwords from existing tunnels
    – Perform previous attacks

   Force “password change” to obtain password hashes
    – Hashes can be used directly by a modified SMB or PPTP
      client
    – MS-CHAPv2 hashes are not usefull (you can force v1)
                    Blackhats Italia 2003        15
Attacks examples (6)
PPTP (3) - attack example

Force PAP from CHAP
                                       start
  Server                                       Client
                                MITM
 req | auth | chap                             req | auth | fake
  nak | auth | pap                             nak| auth | chap
  req | auth | pap                             req | auth | pap
  ack | auth | pap                             ack | auth | pap


       We don’t have to mess with GRE sequences...
                     Blackhats Italia 2003         16
Attacks examples (6)
PPTP (4) - L2TP rollback

   L2TP can use IPSec ESP as transport layer (stronger
    than PPTP)

   By default L2TP is tried before PPTP

   Blocking ISAKMP packets results in an IPSec failure

   Client starts a request for a PPTP tunnel (rollback)

   Now you can perform PPTP previous attacks

                   Blackhats Italia 2003    17
Attacks examples (6)
PPTP (5) - tools

   Ettercap            (http://ettercap.sf.net)
    – Hydra plugins suite

   Anger (http://packetstormsecurity.org/sniffers/anger.tar.gz)




                     Blackhats Italia 2003        18
Attack techniques
LOCAL SCENARIO




       Blackhats Italia 2003   19
Local Attacks (1)
ARP poisoning
   ARP is stateless (we all knows how it works and what the
    problems are)

   Some operating systems do not update an entry if it is not
    already in the cache, others accept only the first received
    reply (e.g solaris)

   The attacker can forge a spoofed ICMP packets to force the
    host to make an ARP request. Immediately after the ICMP it
    sends the fake ARP replay

   Request attack against linux (IDS evasion)



                     Blackhats Italia 2003       20
Local Attacks (1)
ARP poisoning
   Useful to sniff on switched LANs

   The switch works at layer 2 and it is
    not aware of the poisoning in the
    hosts’ ARP cache (unless some ARP
    inspection)


               Blackhats Italia 2003   21
Local Attacks (1)
ARP poisoning - tools
   Ettercap      (http://ettercap.sf.net)
    –   Poisoning
    –   Sniffing
    –   Hijacking
    –   Filtering
    –   SSH sniffing (transparent attack)


   Dsniff (http://www.monkey.org/~dugsong/dsniff)
    –   Poisoning
    –   Sniffing
    –   SSH sniffing (proxy attack)

                      Blackhats Italia 2003    22
Local Attacks (1)
ARP poison - countermeasures
   YES - passive monitoring (arpwatch)
   YES - active monitoring (ettercap)
   YES - IDS (detect but not avoid)

   YES - Static ARP entries (avoid it)
   YES - Secure-ARP (public key auth)

   NO - Port security on the switch
   NO - anticap, antidote, middleware approach


                  Blackhats Italia 2003   23
Local Attacks (2)
DNS spoofing

 If the attacker is able to sniff the ID of the DNS request,
 he/she can reply before the real DNS server


                             MITM
   HOST              serverX.localdomain.it        DNS
              10.1.1.1

             10.1.1.50




                  Blackhats Italia 2003       24
Local Attacks (2)
DNS spoofing - tools
   Ettercap (http://ettercap.sf.net)
    – Phantom plugin

   Dsniff (http://www.monkey.org/~dugsong/dsniff)
    – Dnsspoof

   Zodiac (http://www.packetfactory.com/Projects/
    zodiac)

                  Blackhats Italia 2003   25
Local Attacks (2)
DNS spoofing - countermeasures
   YES - detect multiple replies (IDS)

   YES - use lmhost or host file for static
    resolution of critical hosts

   YES - DNSSEC


               Blackhats Italia 2003   26
Local Attacks (3)
STP mangling
   It is not a real MITM attack since the
    attacker is able to receive only
    “unmanaged” traffic

   The attacker can forge BPDU with
    high priority pretending to be the new
    root of the spanning tree

              Blackhats Italia 2003   27
Local Attacks (3)
STP mangling - tools
   Ettercap (http://ettercap.sf.net)
    – Lamia plugin




                  Blackhats Italia 2003   28
Local Attacks (3)
STP mangling - countermeasures
   YES - Disable STP on VLAN without
    loops

   YES - Root Guard, BPDU Guard.




             Blackhats Italia 2003   29
Attack techniques
FROM LOCAL TO
    REMOTE




       Blackhats Italia 2003   30
Local to remote attacks (1)
DHCP spoofing

   The DHCP request are made in broadcast.

   If the attacker replies before the real DHCP
    server it can manipulate:

    – IP address of the victim
    – GW address assigned to the victim
    – DNS address

                 Blackhats Italia 2003    31
Local to remote attacks (1)
DHCP spoofing - countermeasures

   YES - detection of multiple DHCP
    replies




             Blackhats Italia 2003   32
Local to remote attacks (2)
ICMP redirect

The attacker can forge ICMP redirect packet in order to
Redirect traffic to himself
                                      T




          G                               AT
          1     ICMP redirect to AT



                     H                         LAN

                 Blackhats Italia 2003           33
Local to remote attacks (2)
ICMP redirect - tools

   IRPAS icmp_redirect (Phenoelit)
    (http://www.phenoelit.de/irpas/)


   icmp_redir (Yuri Volobuev)




                   Blackhats Italia 2003   34
Local to remote attacks (2)
ICMP redirect - countermeasures

   YES - Disable the ICMP REDIRECT

   NO - Linux has the “secure redirect” options
    but it seems to be ineffective against this
    attack




                Blackhats Italia 2003   35
Local to remote attacks (3)
IRDP spoofing

   The attacker can forge some advertisement
    packet pretending to be the router for the
    LAN. He/she can set the “preference level”
    and the “lifetime” at high values to be sure
    the hosts will choose it as the preferred
    router.

   The attack can be improved by sending
    some spoofed ICMP Host Unreachable
    pretending to be the real router
                Blackhats Italia 2003   36
Local to remote attacks (3)
IRDP spoofing - tools

   IRPAS by Phenoelit
    (http://www.phenoelit.de/irpas/)




                   Blackhats Italia 2003   37
Local to remote attacks (3)
IRDP spoofing - countermeasures

   YES - Disable IRDP on hosts if the
    operating system permit it.




             Blackhats Italia 2003   38
Local to remote attacks (4)
ROUTE mangling



      INTERNET                  GW                       AT


                                             H

The attacker can forge packets for the gateway (GW)
pretending to be a router with a good metric for a specified host
on the internet

The netmask should be big enough to win against other routes

                     Blackhats Italia 2003        39
Local to remote attacks (4)
ROUTE mangling

   Now the problem for the attacker is to send packets
    to the real destination. He/she cannot send it
    through GW since it is convinced that the best route
    is AT.
                                   Tunnel
                    AT2


    D            INTERNET                 GW            AT

                                                    H
                  Blackhats Italia 2003        40
Local to remote attacks (4)
ROUTE mangling - tools

   IRPAS (Phenoelit)
    (http://www.phenoelit.de/irpas/)


   Nemesis
    (http://www.packetfactory.net/Projects/nemesis/)




                   Blackhats Italia 2003   41
Local to remote attacks (4)
ROUTE mangling - countermeasures

   YES - Disable dynamic routing
    protocols on this type of scenarios

   YES - Enable some ACL to block
    unexpected update

   YES - Enable authentications on the
    protocols that support them
              Blackhats Italia 2003   42
Attacks techniques
REMOTE SCENARIOS




        Blackhats Italia 2003   43
Remote attacks (1)
DNS poisoning
   Type 1 attack
    – The attacker sends a request to the victim DNS
      asking for one host


    – The attacker spoofs the reply which is expected
      to come from the real DNS


    – The spoofed reply must contain the correct ID
      (brute force or semi-blind guessing)

                 Blackhats Italia 2003   44
Remote attacks (1)
DNS poisoning
   Type 2 attack
    – The attacker can send a “dynamic
      update” to the victim DNS


    – If the DNS processes it, it is even worst
      because it will be authoritative for those
      entries


                Blackhats Italia 2003   45
Remote attacks (1)
DNS poisoning - tools
   ADMIdPack

   Zodiac
    (http://www.packetfactory.com/Projects/zodiac)




                  Blackhats Italia 2003   46
Remote attacks (1)
DNS poisoning - countermeasures
   YES - Use DNS with                     random
    transaction ID (Bind v9)

   YES - DNSSec (Bind v9) allows the
    digital signature of the replies.

   NO - restrict the dynamic update to a
    range of IP (they can be spoofed)
              Blackhats Italia 2003   47
Remote attacks (2)
Traffic Tunneling


 Server        Router 1


      Tunnel GRE
                          INTERNET          Client


Fake host
               Gateway
 Attacker

               Blackhats Italia 2003   48
Remote attacks (2)
Traffic Tunneling - tools

   Ettercap (http://ettercap.sf.net)
    – Zaratan plugin


   TunnelX (http://www.phrack.com)




                Blackhats Italia 2003   49
Remote attacks (2)
Traffic Tunneling -
countermeasure
   YES - Strong passwords and community on
    routers




               Blackhats Italia 2003   50
Remote attacks (3)
ROUTE mangling
   The attacker aims to hijack the traffic
    between the two victims A and B

   The attack will collect sensitive information
    through:
    – traceroute
    – portscanning
    – protoscanning

   Quite impossible against link state protocols
                 Blackhats Italia 2003   51
Remote attacks (3)
ROUTE mangling
   Scenario 1 a
    (IGRP inside the AS)
A       R1                                        B




        R2
             The attacker pretends to be the GW

                 Blackhats Italia 2003   52
Remote attacks (3)
ROUTE mangling
   Scenario 1 b
    (IGRP inside the AS)
A       R1    R3                           B




              R2
              Blackhats Italia 2003   53
Remote attacks (3)
ROUTE mangling
   Scenario 2 a
    (the traffic does not pass thru the AS)
           AS 1                           AS 2
                         BGP

           BG 1                           BG 2


                     BG 3

                                            RIP
                                  AS 3
                  Blackhats Italia 2003           54
Remote attacks (3)
ROUTE mangling
    IRPAS di Phenoelit
    (http://www.phenoelit.de/irpas/)

   Nemesis
    (http://www.packetfactory.net/Projects/nemesis/)



                   Blackhats Italia 2003   55
Remote attacks (3)
ROUTE mangling -
countermeasure
   YES - Use routing protocol authentications




                Blackhats Italia 2003   56
Conclusions
   The security of a connection relies on:
     – a proper configuration of the client (avoiding ICMP Redirect, ARP
       Poisoning etc.)
     – the other endpoint infrastructure (es. DNS dynamic update),
     – the strongness of a third party appliances on which we don’t have
       access (es. Tunnelling and Route Mangling).

   The best to protect a communication is the correct and
    conscious use of criptographic suites
     –   both client and server side
     –   at the network layer (ie. IPSec)
     –   at transport layer (ie. SSLv3)
     –   at application layer (ie. PGP).



                         Blackhats Italia 2003         57
– Marco Valleri        <naga@blackhats.it>
– Alberto Ornaghi      <alor@blackhats.it>




           Blackhats Italia 2003   58

Mais conteúdo relacionado

Mais procurados

3 scanning-ger paoctes-pub
3  scanning-ger paoctes-pub3  scanning-ger paoctes-pub
3 scanning-ger paoctes-pubCassio Ramos
 
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Leonardo Nve Egea - Playing in a Satellite Environment 1.2Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Leonardo Nve Egea - Playing in a Satellite Environment 1.2Jim Geovedi
 
BPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable DatapathBPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable DatapathThomas Graf
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPThomas Graf
 
From Kernel Space to User Heaven #NDH2k13
From Kernel Space to User Heaven #NDH2k13From Kernel Space to User Heaven #NDH2k13
From Kernel Space to User Heaven #NDH2k13Jaime Sánchez
 
Kernel Recipes 2013 - Deciphering Oopsies
Kernel Recipes 2013 - Deciphering OopsiesKernel Recipes 2013 - Deciphering Oopsies
Kernel Recipes 2013 - Deciphering OopsiesAnne Nicolas
 
Stupid iptables tricks
Stupid iptables tricksStupid iptables tricks
Stupid iptables tricksJim MacLeod
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack monad bobo
 
Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)micchie
 
Why my network does not work? Networking Quiz 2017
Why my network does not work? Networking Quiz 2017Why my network does not work? Networking Quiz 2017
Why my network does not work? Networking Quiz 2017Andriy Berestovskyy
 
Network Mapper (NMAP)
Network Mapper (NMAP)Network Mapper (NMAP)
Network Mapper (NMAP)KHNOG
 
Linux internet server security and configuration tutorial
Linux internet server security and configuration tutorialLinux internet server security and configuration tutorial
Linux internet server security and configuration tutorialannik147
 

Mais procurados (19)

Security Onion Advance
Security Onion AdvanceSecurity Onion Advance
Security Onion Advance
 
3 scanning-ger paoctes-pub
3  scanning-ger paoctes-pub3  scanning-ger paoctes-pub
3 scanning-ger paoctes-pub
 
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Leonardo Nve Egea - Playing in a Satellite Environment 1.2Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
 
Layer 2 Hackery
Layer 2 HackeryLayer 2 Hackery
Layer 2 Hackery
 
2 netcat enum-pub
2 netcat enum-pub2 netcat enum-pub
2 netcat enum-pub
 
BPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable DatapathBPF: Next Generation of Programmable Datapath
BPF: Next Generation of Programmable Datapath
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
 
From Kernel Space to User Heaven #NDH2k13
From Kernel Space to User Heaven #NDH2k13From Kernel Space to User Heaven #NDH2k13
From Kernel Space to User Heaven #NDH2k13
 
Kernel Recipes 2013 - Deciphering Oopsies
Kernel Recipes 2013 - Deciphering OopsiesKernel Recipes 2013 - Deciphering Oopsies
Kernel Recipes 2013 - Deciphering Oopsies
 
Stupid iptables tricks
Stupid iptables tricksStupid iptables tricks
Stupid iptables tricks
 
The Spectre of Meltdowns
The Spectre of MeltdownsThe Spectre of Meltdowns
The Spectre of Meltdowns
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 
Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)
 
netfilter programming
netfilter programmingnetfilter programming
netfilter programming
 
Why my network does not work? Networking Quiz 2017
Why my network does not work? Networking Quiz 2017Why my network does not work? Networking Quiz 2017
Why my network does not work? Networking Quiz 2017
 
Network Mapper (NMAP)
Network Mapper (NMAP)Network Mapper (NMAP)
Network Mapper (NMAP)
 
OVS-NFV Tutorial
OVS-NFV TutorialOVS-NFV Tutorial
OVS-NFV Tutorial
 
Linux internet server security and configuration tutorial
Linux internet server security and configuration tutorialLinux internet server security and configuration tutorial
Linux internet server security and configuration tutorial
 

Destaque

Top 3 MAC Spoofing Challenges You Cannot Afford to Ignore
Top 3 MAC Spoofing Challenges You Cannot Afford to IgnoreTop 3 MAC Spoofing Challenges You Cannot Afford to Ignore
Top 3 MAC Spoofing Challenges You Cannot Afford to IgnoreGreat Bay Software
 
Countermeasures to GPS Spoofing
Countermeasures to GPS SpoofingCountermeasures to GPS Spoofing
Countermeasures to GPS SpoofingRoger Johnston
 
Network Attacks and Countermeasures
Network Attacks and CountermeasuresNetwork Attacks and Countermeasures
Network Attacks and Countermeasureskaranwayne
 
RSA - WLAN Hacking
RSA - WLAN HackingRSA - WLAN Hacking
RSA - WLAN HackingJohn Rhoton
 
Seminariode Seguridad L2
Seminariode Seguridad L2Seminariode Seguridad L2
Seminariode Seguridad L2christian nieto
 
Network tunneling techniques
Network tunneling techniquesNetwork tunneling techniques
Network tunneling techniquesinbroker
 
Packet sniffing in switched LANs
Packet sniffing in switched LANsPacket sniffing in switched LANs
Packet sniffing in switched LANsIshraq Al Fataftah
 
Neighbor discovery in wireless networks with multipacket reception
Neighbor discovery in wireless networks with multipacket receptionNeighbor discovery in wireless networks with multipacket reception
Neighbor discovery in wireless networks with multipacket receptionLeMeniz Infotech
 
Network Attack Counter
Network Attack CounterNetwork Attack Counter
Network Attack CounterKHNOG
 

Destaque (11)

Top 3 MAC Spoofing Challenges You Cannot Afford to Ignore
Top 3 MAC Spoofing Challenges You Cannot Afford to IgnoreTop 3 MAC Spoofing Challenges You Cannot Afford to Ignore
Top 3 MAC Spoofing Challenges You Cannot Afford to Ignore
 
Mac spoof avoider
Mac spoof avoiderMac spoof avoider
Mac spoof avoider
 
Countermeasures to GPS Spoofing
Countermeasures to GPS SpoofingCountermeasures to GPS Spoofing
Countermeasures to GPS Spoofing
 
Network Attacks and Countermeasures
Network Attacks and CountermeasuresNetwork Attacks and Countermeasures
Network Attacks and Countermeasures
 
RSA - WLAN Hacking
RSA - WLAN HackingRSA - WLAN Hacking
RSA - WLAN Hacking
 
Seminariode Seguridad L2
Seminariode Seguridad L2Seminariode Seguridad L2
Seminariode Seguridad L2
 
Network tunneling techniques
Network tunneling techniquesNetwork tunneling techniques
Network tunneling techniques
 
Dynamic Port Scanning
Dynamic Port ScanningDynamic Port Scanning
Dynamic Port Scanning
 
Packet sniffing in switched LANs
Packet sniffing in switched LANsPacket sniffing in switched LANs
Packet sniffing in switched LANs
 
Neighbor discovery in wireless networks with multipacket reception
Neighbor discovery in wireless networks with multipacket receptionNeighbor discovery in wireless networks with multipacket reception
Neighbor discovery in wireless networks with multipacket reception
 
Network Attack Counter
Network Attack CounterNetwork Attack Counter
Network Attack Counter
 

Semelhante a 1unit2ndpart

Man in the middle attacks
Man in the middle attacksMan in the middle attacks
Man in the middle attacksBurtPepper
 
Bh us-03-ornaghi-valleri
Bh us-03-ornaghi-valleriBh us-03-ornaghi-valleri
Bh us-03-ornaghi-valleriHai Nguyen
 
Network Security - Layer 2
Network Security - Layer 2Network Security - Layer 2
Network Security - Layer 2samis
 
Expl sw chapter_02_switches_part_2
Expl sw chapter_02_switches_part_2Expl sw chapter_02_switches_part_2
Expl sw chapter_02_switches_part_2aghacrom
 
Introduction to layer 2 attacks & mitigation
Introduction to layer 2 attacks & mitigationIntroduction to layer 2 attacks & mitigation
Introduction to layer 2 attacks & mitigationRishabh Dangwal
 
Attacks and their mitigations
Attacks and their mitigationsAttacks and their mitigations
Attacks and their mitigationsMukesh Chaudhari
 
The Network Protocol Stack Revisited
The Network Protocol Stack RevisitedThe Network Protocol Stack Revisited
The Network Protocol Stack Revisitedinbroker
 
Enabling Worm and Malware Investigation Using Virtualization
Enabling Worm and Malware Investigation Using VirtualizationEnabling Worm and Malware Investigation Using Virtualization
Enabling Worm and Malware Investigation Using Virtualizationamiable_indian
 
Отчет Audit report RAPID7
 Отчет Audit report RAPID7 Отчет Audit report RAPID7
Отчет Audit report RAPID7Sergey Yrievich
 
bettercap.pdf
bettercap.pdfbettercap.pdf
bettercap.pdfshehbaz15
 
Certified Ethical Hacker quick test prep cheat sheet
Certified Ethical Hacker quick test prep cheat sheetCertified Ethical Hacker quick test prep cheat sheet
Certified Ethical Hacker quick test prep cheat sheetDavid Sweigert
 

Semelhante a 1unit2ndpart (20)

Man in the middle attacks
Man in the middle attacksMan in the middle attacks
Man in the middle attacks
 
Bh us-03-ornaghi-valleri
Bh us-03-ornaghi-valleriBh us-03-ornaghi-valleri
Bh us-03-ornaghi-valleri
 
Network Security - Layer 2
Network Security - Layer 2Network Security - Layer 2
Network Security - Layer 2
 
Expl sw chapter_02_switches_part_2
Expl sw chapter_02_switches_part_2Expl sw chapter_02_switches_part_2
Expl sw chapter_02_switches_part_2
 
Best!
Best!Best!
Best!
 
Introduction to layer 2 attacks & mitigation
Introduction to layer 2 attacks & mitigationIntroduction to layer 2 attacks & mitigation
Introduction to layer 2 attacks & mitigation
 
Attacks and their mitigations
Attacks and their mitigationsAttacks and their mitigations
Attacks and their mitigations
 
The Network Protocol Stack Revisited
The Network Protocol Stack RevisitedThe Network Protocol Stack Revisited
The Network Protocol Stack Revisited
 
Intrusion Techniques
Intrusion TechniquesIntrusion Techniques
Intrusion Techniques
 
Lec21 22
Lec21 22Lec21 22
Lec21 22
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
 
Enabling Worm and Malware Investigation Using Virtualization
Enabling Worm and Malware Investigation Using VirtualizationEnabling Worm and Malware Investigation Using Virtualization
Enabling Worm and Malware Investigation Using Virtualization
 
Hacking Cisco
Hacking CiscoHacking Cisco
Hacking Cisco
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
111
111111
111
 
111
111111
111
 
Report PAPID 7
Report PAPID 7Report PAPID 7
Report PAPID 7
 
Отчет Audit report RAPID7
 Отчет Audit report RAPID7 Отчет Audit report RAPID7
Отчет Audit report RAPID7
 
bettercap.pdf
bettercap.pdfbettercap.pdf
bettercap.pdf
 
Certified Ethical Hacker quick test prep cheat sheet
Certified Ethical Hacker quick test prep cheat sheetCertified Ethical Hacker quick test prep cheat sheet
Certified Ethical Hacker quick test prep cheat sheet
 

Último

PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEMISSRITIMABIOLOGYEXP
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroomSamsung Business USA
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfChristalin Nelson
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...Nguyen Thanh Tu Collection
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxryandux83rd
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipKarl Donert
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsArubSultan
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 

Último (20)

PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
 
6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom6 ways Samsung’s Interactive Display powered by Android changes the classroom
6 ways Samsung’s Interactive Display powered by Android changes the classroom
 
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
Mattingly "AI & Prompt Design" - Introduction to Machine Learning"
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdf
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN THEO CÂU CHO HỌC SINH LỚP 12 ĐỂ ĐẠT ĐIỂM 5+ THI TỐT NGHIỆP THPT ...
 
Employablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptxEmployablity presentation and Future Career Plan.pptx
Employablity presentation and Future Career Plan.pptx
 
The role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenshipThe role of Geography in climate education: science and active citizenship
The role of Geography in climate education: science and active citizenship
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
Introduction to Research ,Need for research, Need for design of Experiments, ...
Introduction to Research ,Need for research, Need for design of Experiments, ...Introduction to Research ,Need for research, Need for design of Experiments, ...
Introduction to Research ,Need for research, Need for design of Experiments, ...
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristics
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 

1unit2ndpart

  • 1. Alberto Ornaghi <alor@blackhats.it> Marco Valleri <naga@blackhats.it> Man in the middle attacks  What they are  How to achieve them  How to use them  How to prevent them Blackhats Italia 2003 1
  • 2. Table of contents Different attacks in different scenarios: LOCAL AREA NETWORK: - ARP poisoning - DNS spoofing - STP mangling FROM LOCAL TO REMOTE (through a gateway): - ARP poisoning - DNS spoofing - DHCP spoofing - ICMP redirection - IRDP spoofing - route mangling REMOTE: - DNS poisoning - traffic tunneling - route mangling Blackhats Italia 2003 2
  • 3. Once in the middle... Blackhats Italia 2003 3
  • 4. Sniffing  It is the easiest attack to launch since all the packets transit through the attacker.  All the “plain text” protocols are compromised (the attacker can sniff user and password of many widely used protocol such as telnet, ftp, http) Blackhats Italia 2003 4
  • 5. Hijacking  Easy to launch  It isn’t blind (the attacker knows exactly the sequence numbers of the TCP connection) Blackhats Italia 2003 5
  • 6. Injecting  Possibility to add packets to an already established connection (only possible in full-duplex mitm)  The attacker can modify the sequence numbers and keep the connection synchronized while injecting packets.  If the mitm attack is a “proxy attack” it is even easier to inject (there are two distinct connections) Blackhats Italia 2003 6
  • 7. Filtering  The attacker can modify the payload of the packets by recalculating the checksum  He/she can create filters on the fly  The length of the payload can also be changed but only in full-duplex (in this case the seq has to be adjusted) Blackhats Italia 2003 7
  • 8. Attacks examples Blackhats Italia 2003 8
  • 9. Attacks examples (1) Command injection  Useful in scenarios where a one time authentication is used (e.g. RSA token). In such scenarios sniffing the password is useless, but hijacking an already authenticated session is critical  Injection of commands to the server  Emulation of fake replies to the client Blackhats Italia 2003 9
  • 10. Attacks examples (2) Malicious code injection  Insertion of malicious code into web pages or mail (javascript, trojans, virus, ecc)  Modification on the fly of binary files during the download phase (virus, backdoor, ecc) Blackhats Italia 2003 10
  • 11. Attacks examples (3) Key exchanging  Modification of the public key exchanged by server and client. (eg SSH1) start Server Client KEY(rsa) KEY(rsa) MITM Ekey[S-Key] Ekey[S-Key] S-KEY S-KEY S-KEY D(E(M)) Eskey(M) M D(E(M)) Blackhats Italia 2003 11
  • 12. Attacks examples (4) Parameters and banners substitution  Parameters exchanged by server and client can be substituted in the beginning of a connection. (algorithms to be used later)  Example: the attacker can force the client to initialize a SSH1 connection instead of SSH2. – The server replies in this way:  SSH-1.99 -- the server supports ssh1 and ssh2  SSH-1.51 -- the server supports ONLY ssh1 – The attacker makes a filter to replace “1.99” with “1.51”  Possibility to circumvent known_hosts Blackhats Italia 2003 12
  • 13. Attacks examples (5) IPSEC Failure  Block the keymaterial exchanged on the port 500 UDP  End points think that the other cannot start an IPSEC connection  If the client is configured in rollback mode, there is a good chance that the user will not notice that the connection is in clear text Blackhats Italia 2003 13
  • 14. Attacks examples (6) PPTP (1) - description  Uses GRE as transport layer (no encryption, no authentication)  Uses the same negotiation scheme as PPP (req, ack, nak, rej)  Negotiation phases are not authenticated  MS-CHAPv2 mutual authentication can’t prevent this kind of mitm Blackhats Italia 2003 14
  • 15. Attacks examples (6) PPTP (2) - attacks  During negotiation phase – Force PAP authentication (almost fails) – Force MS-CHAPv1 from MS-CHAPv2 (easier to crack) – Force no encryption  Force re-negotiation (clear text terminate-ack) – Retrieve passwords from existing tunnels – Perform previous attacks  Force “password change” to obtain password hashes – Hashes can be used directly by a modified SMB or PPTP client – MS-CHAPv2 hashes are not usefull (you can force v1) Blackhats Italia 2003 15
  • 16. Attacks examples (6) PPTP (3) - attack example Force PAP from CHAP start Server Client MITM req | auth | chap req | auth | fake nak | auth | pap nak| auth | chap req | auth | pap req | auth | pap ack | auth | pap ack | auth | pap We don’t have to mess with GRE sequences... Blackhats Italia 2003 16
  • 17. Attacks examples (6) PPTP (4) - L2TP rollback  L2TP can use IPSec ESP as transport layer (stronger than PPTP)  By default L2TP is tried before PPTP  Blocking ISAKMP packets results in an IPSec failure  Client starts a request for a PPTP tunnel (rollback)  Now you can perform PPTP previous attacks Blackhats Italia 2003 17
  • 18. Attacks examples (6) PPTP (5) - tools  Ettercap (http://ettercap.sf.net) – Hydra plugins suite  Anger (http://packetstormsecurity.org/sniffers/anger.tar.gz) Blackhats Italia 2003 18
  • 19. Attack techniques LOCAL SCENARIO Blackhats Italia 2003 19
  • 20. Local Attacks (1) ARP poisoning  ARP is stateless (we all knows how it works and what the problems are)  Some operating systems do not update an entry if it is not already in the cache, others accept only the first received reply (e.g solaris)  The attacker can forge a spoofed ICMP packets to force the host to make an ARP request. Immediately after the ICMP it sends the fake ARP replay  Request attack against linux (IDS evasion) Blackhats Italia 2003 20
  • 21. Local Attacks (1) ARP poisoning  Useful to sniff on switched LANs  The switch works at layer 2 and it is not aware of the poisoning in the hosts’ ARP cache (unless some ARP inspection) Blackhats Italia 2003 21
  • 22. Local Attacks (1) ARP poisoning - tools  Ettercap (http://ettercap.sf.net) – Poisoning – Sniffing – Hijacking – Filtering – SSH sniffing (transparent attack)  Dsniff (http://www.monkey.org/~dugsong/dsniff) – Poisoning – Sniffing – SSH sniffing (proxy attack) Blackhats Italia 2003 22
  • 23. Local Attacks (1) ARP poison - countermeasures  YES - passive monitoring (arpwatch)  YES - active monitoring (ettercap)  YES - IDS (detect but not avoid)  YES - Static ARP entries (avoid it)  YES - Secure-ARP (public key auth)  NO - Port security on the switch  NO - anticap, antidote, middleware approach Blackhats Italia 2003 23
  • 24. Local Attacks (2) DNS spoofing If the attacker is able to sniff the ID of the DNS request, he/she can reply before the real DNS server MITM HOST serverX.localdomain.it DNS 10.1.1.1 10.1.1.50 Blackhats Italia 2003 24
  • 25. Local Attacks (2) DNS spoofing - tools  Ettercap (http://ettercap.sf.net) – Phantom plugin  Dsniff (http://www.monkey.org/~dugsong/dsniff) – Dnsspoof  Zodiac (http://www.packetfactory.com/Projects/ zodiac) Blackhats Italia 2003 25
  • 26. Local Attacks (2) DNS spoofing - countermeasures  YES - detect multiple replies (IDS)  YES - use lmhost or host file for static resolution of critical hosts  YES - DNSSEC Blackhats Italia 2003 26
  • 27. Local Attacks (3) STP mangling  It is not a real MITM attack since the attacker is able to receive only “unmanaged” traffic  The attacker can forge BPDU with high priority pretending to be the new root of the spanning tree Blackhats Italia 2003 27
  • 28. Local Attacks (3) STP mangling - tools  Ettercap (http://ettercap.sf.net) – Lamia plugin Blackhats Italia 2003 28
  • 29. Local Attacks (3) STP mangling - countermeasures  YES - Disable STP on VLAN without loops  YES - Root Guard, BPDU Guard. Blackhats Italia 2003 29
  • 30. Attack techniques FROM LOCAL TO REMOTE Blackhats Italia 2003 30
  • 31. Local to remote attacks (1) DHCP spoofing  The DHCP request are made in broadcast.  If the attacker replies before the real DHCP server it can manipulate: – IP address of the victim – GW address assigned to the victim – DNS address Blackhats Italia 2003 31
  • 32. Local to remote attacks (1) DHCP spoofing - countermeasures  YES - detection of multiple DHCP replies Blackhats Italia 2003 32
  • 33. Local to remote attacks (2) ICMP redirect The attacker can forge ICMP redirect packet in order to Redirect traffic to himself T G AT 1 ICMP redirect to AT H LAN Blackhats Italia 2003 33
  • 34. Local to remote attacks (2) ICMP redirect - tools  IRPAS icmp_redirect (Phenoelit) (http://www.phenoelit.de/irpas/)  icmp_redir (Yuri Volobuev) Blackhats Italia 2003 34
  • 35. Local to remote attacks (2) ICMP redirect - countermeasures  YES - Disable the ICMP REDIRECT  NO - Linux has the “secure redirect” options but it seems to be ineffective against this attack Blackhats Italia 2003 35
  • 36. Local to remote attacks (3) IRDP spoofing  The attacker can forge some advertisement packet pretending to be the router for the LAN. He/she can set the “preference level” and the “lifetime” at high values to be sure the hosts will choose it as the preferred router.  The attack can be improved by sending some spoofed ICMP Host Unreachable pretending to be the real router Blackhats Italia 2003 36
  • 37. Local to remote attacks (3) IRDP spoofing - tools  IRPAS by Phenoelit (http://www.phenoelit.de/irpas/) Blackhats Italia 2003 37
  • 38. Local to remote attacks (3) IRDP spoofing - countermeasures  YES - Disable IRDP on hosts if the operating system permit it. Blackhats Italia 2003 38
  • 39. Local to remote attacks (4) ROUTE mangling INTERNET GW AT H The attacker can forge packets for the gateway (GW) pretending to be a router with a good metric for a specified host on the internet The netmask should be big enough to win against other routes Blackhats Italia 2003 39
  • 40. Local to remote attacks (4) ROUTE mangling  Now the problem for the attacker is to send packets to the real destination. He/she cannot send it through GW since it is convinced that the best route is AT. Tunnel AT2 D INTERNET GW AT H Blackhats Italia 2003 40
  • 41. Local to remote attacks (4) ROUTE mangling - tools  IRPAS (Phenoelit) (http://www.phenoelit.de/irpas/)  Nemesis (http://www.packetfactory.net/Projects/nemesis/) Blackhats Italia 2003 41
  • 42. Local to remote attacks (4) ROUTE mangling - countermeasures  YES - Disable dynamic routing protocols on this type of scenarios  YES - Enable some ACL to block unexpected update  YES - Enable authentications on the protocols that support them Blackhats Italia 2003 42
  • 43. Attacks techniques REMOTE SCENARIOS Blackhats Italia 2003 43
  • 44. Remote attacks (1) DNS poisoning  Type 1 attack – The attacker sends a request to the victim DNS asking for one host – The attacker spoofs the reply which is expected to come from the real DNS – The spoofed reply must contain the correct ID (brute force or semi-blind guessing) Blackhats Italia 2003 44
  • 45. Remote attacks (1) DNS poisoning  Type 2 attack – The attacker can send a “dynamic update” to the victim DNS – If the DNS processes it, it is even worst because it will be authoritative for those entries Blackhats Italia 2003 45
  • 46. Remote attacks (1) DNS poisoning - tools  ADMIdPack  Zodiac (http://www.packetfactory.com/Projects/zodiac) Blackhats Italia 2003 46
  • 47. Remote attacks (1) DNS poisoning - countermeasures  YES - Use DNS with random transaction ID (Bind v9)  YES - DNSSec (Bind v9) allows the digital signature of the replies.  NO - restrict the dynamic update to a range of IP (they can be spoofed) Blackhats Italia 2003 47
  • 48. Remote attacks (2) Traffic Tunneling Server Router 1 Tunnel GRE INTERNET Client Fake host Gateway Attacker Blackhats Italia 2003 48
  • 49. Remote attacks (2) Traffic Tunneling - tools  Ettercap (http://ettercap.sf.net) – Zaratan plugin  TunnelX (http://www.phrack.com) Blackhats Italia 2003 49
  • 50. Remote attacks (2) Traffic Tunneling - countermeasure  YES - Strong passwords and community on routers Blackhats Italia 2003 50
  • 51. Remote attacks (3) ROUTE mangling  The attacker aims to hijack the traffic between the two victims A and B  The attack will collect sensitive information through: – traceroute – portscanning – protoscanning  Quite impossible against link state protocols Blackhats Italia 2003 51
  • 52. Remote attacks (3) ROUTE mangling  Scenario 1 a (IGRP inside the AS) A R1 B R2 The attacker pretends to be the GW Blackhats Italia 2003 52
  • 53. Remote attacks (3) ROUTE mangling  Scenario 1 b (IGRP inside the AS) A R1 R3 B R2 Blackhats Italia 2003 53
  • 54. Remote attacks (3) ROUTE mangling  Scenario 2 a (the traffic does not pass thru the AS) AS 1 AS 2 BGP BG 1 BG 2 BG 3 RIP AS 3 Blackhats Italia 2003 54
  • 55. Remote attacks (3) ROUTE mangling  IRPAS di Phenoelit (http://www.phenoelit.de/irpas/)  Nemesis (http://www.packetfactory.net/Projects/nemesis/) Blackhats Italia 2003 55
  • 56. Remote attacks (3) ROUTE mangling - countermeasure  YES - Use routing protocol authentications Blackhats Italia 2003 56
  • 57. Conclusions  The security of a connection relies on: – a proper configuration of the client (avoiding ICMP Redirect, ARP Poisoning etc.) – the other endpoint infrastructure (es. DNS dynamic update), – the strongness of a third party appliances on which we don’t have access (es. Tunnelling and Route Mangling).  The best to protect a communication is the correct and conscious use of criptographic suites – both client and server side – at the network layer (ie. IPSec) – at transport layer (ie. SSLv3) – at application layer (ie. PGP). Blackhats Italia 2003 57
  • 58. – Marco Valleri <naga@blackhats.it> – Alberto Ornaghi <alor@blackhats.it> Blackhats Italia 2003 58