Top Banner
Wo|man in‐the Middle
67

Internet Pirates: blackholing, hijacking and other dirty tricks

Jul 16, 2015

Download

Technology

Carlos Fragoso
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Internet Pirates: blackholing, hijacking and other dirty tricks

Wo|man in‐the Middle 

Page 2: Internet Pirates: blackholing, hijacking and other dirty tricks

Ngp_rcq md rfc Glrcplcr Blackholing, hijacking and other dirty tricks

Carlos Fragoso Mariscal

London 2008

Page 3: Internet Pirates: blackholing, hijacking and other dirty tricks

Ufm _k G = •  Informa(on Security Professional •  Opera(ons and Security Manager for Supercompu(ng Center of Catalonia – Anella Cien(fica RREN,  CATNIX IXP … 

•  Technical Director of one eSecurity •  Involved in several IR communi(es – ABUSES, TF‐CSIRT, NSP‐SEC … 

•  SANS Volunteer since 2002  •  Cisco Systems and GIAC Cer(fied – CCNA, CCNP*, GSEC, GCFW, GCIH 

Page 4: Internet Pirates: blackholing, hijacking and other dirty tricks

Ngp_rcq md rfc Glrcplcr 

Internet 101  A5acks  Countermeasures 

Page 5: Internet Pirates: blackholing, hijacking and other dirty tricks

Ngp_rcq md rfc Glrcplcr 

Internet 101 How it works 

Threats 

ASacks  Countermeasures 

Page 6: Internet Pirates: blackholing, hijacking and other dirty tricks

How 

work? 

does the Internet 

Page 7: Internet Pirates: blackholing, hijacking and other dirty tricks

Unallocated

Page 8: Internet Pirates: blackholing, hijacking and other dirty tricks

Autonomous System 

AS Number (ASN) 

Network allocaDons 

Page 9: Internet Pirates: blackholing, hijacking and other dirty tricks

Carrier

ISP Telco

Enterprise Cable/DSL Provider

Service Provider

Page 10: Internet Pirates: blackholing, hijacking and other dirty tricks

IXP’s

BGPv4 RFC1771

Enterprise Cable/DSL Provider

Service Provider

ISP Telco

Carrier

Page 11: Internet Pirates: blackholing, hijacking and other dirty tricks

BGP  OSPF 

Fmu pmsrgle r_`jcq umpi =

Global 

ISIS  RIP  StaDc Connected 

Each rou(ng protocol builds its own table based on its metrics 

1

Prefixes are elected based on prefix mask and administraDve distance 

2

Prefixes are installed  3

More specific prefixes  take precedence 

Page 12: Internet Pirates: blackholing, hijacking and other dirty tricks

@EN Qcjcargml ?jempgrfk 1.  Highest Local Preference 2.  Locally originated, aggregated, redistribu(on… 3.  Shortest AS‐PATH 4.  Lowest origin type 5.  Lowest Mul( Exit Discriminator (MED) 6.  eBGP over iBGP paths 7.  Lowest IGP metric to next‐hop 8.  Received first …etc… 

Any prefix received with the local AS in its AS‐Path a5ribute is dropped 

Page 13: Internet Pirates: blackholing, hijacking and other dirty tricks

BGP table version is NNNNNNNN, local router ID is A.B.C.D Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,  r RIB‐failure, S Stale Origin codes: i ‐ IGP, e ‐ EGP, ? ‐ incomplete 

   Network          Next Hop         Metric Path *  A.B.0.0          10.10.10.1         0    300 200 100 10 i *                   10.10.20.1         0    300 100 80 i 

Routing entry for A.B.0.0/16   Known via "bgp 1", distance 20, metric 0   Tag 7018, type external   Last update from 10.10.20.1 1d00h ago   Routing Descriptor Blocks:   * 10.10.20.1, from 10.10.20.1, 1d00h ago       Route metric is 0, traffic share count is 1       AS Hops 3       Route tag 7018 

BGP table

Global table

Page 14: Internet Pirates: blackholing, hijacking and other dirty tricks

Internet Rou(ng Registry (IRR) 

•  Route registra(on database •  Rou(ng Policy descrip(on language (RFC 2622) •  Common objects – route / route‐set – aut‐num / AS‐Set – Peering‐set 

•  Most well‐known – RADB – RIPE 

Page 15: Internet Pirates: blackholing, hijacking and other dirty tricks

route:     A.B.0.0/19 descr:     Monkey Business origin:    AS100 mnt‐by:    MONKEY‐ISP‐MNT source:    RIPE # Filtered 

as‐set:          AS‐MONKEY‐CUSTOMERS descr:           MONKEY CUSTOMERS members:         AS100 members:         AS200 members:         AS300 tech‐c:          MONK1‐RIPE admin‐c:         MONK2‐RIPE mnt‐by:          MONKEY‐ISP‐MNT source:          RIPE # Filtered 

Source: RIPE Whois Database – h6p://www.ripe.net/db/whois.html 

route:     C.D.0.0/24 descr:     Monkey Shop origin:    AS200 mnt‐by:    MONKEY‐ISP‐MNT source:    RIPE # Filtered 

Page 16: Internet Pirates: blackholing, hijacking and other dirty tricks

Source: “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

Page 17: Internet Pirates: blackholing, hijacking and other dirty tricks

So it is ... 

BGP …vulnerable? 

Page 18: Internet Pirates: blackholing, hijacking and other dirty tricks

Rfpc_rq •  Internet is a chain of trust – “A chain is only as strong as its weakest link” 

• Weak peer filtering policies 

•  Unauthorized route IRR registra(on •  Rou(ng infrastructure compromise 

•  Future BGP peering vulnerabili(es 

Page 19: Internet Pirates: blackholing, hijacking and other dirty tricks

Ngp_rcq md rfc Glrcplcr 

Internet 101  A5acks Blackholing 

MitM Hijacking 

Ghost Hijacking 

Countermeasures 

Page 20: Internet Pirates: blackholing, hijacking and other dirty tricks
Page 21: Internet Pirates: blackholing, hijacking and other dirty tricks

@j_aifmjgle •  Poisoning a more specific route – Ex: /24 overlapping main /19 

•  Traffic is dropped at des(na(on – Route to Null0 

•  Not very effec(ve for small prefixes (</24) – Depends on transit providers policies 

Page 22: Internet Pirates: blackholing, hijacking and other dirty tricks

WmsRs`c `cdmpc @F glagbclr

Source: RIPE‐NCC – h6p://www.ripe.net/news/study‐youtube‐hijacking.html 

Page 23: Internet Pirates: blackholing, hijacking and other dirty tricks

WmsRs`c bspgle @F glagbclr

Source: RIPE‐NCC – h6p://www.ripe.net/news/study‐youtube‐hijacking.html 

Page 24: Internet Pirates: blackholing, hijacking and other dirty tricks
Page 25: Internet Pirates: blackholing, hijacking and other dirty tricks

A.Pilosov

T.Kapela

July 31st – August 2nd 2008 in Las Vegas

Page 26: Internet Pirates: blackholing, hijacking and other dirty tricks

KgrK Fgh_aigle •  Vic(m reconaissance •  ASack Engineering •  Rou(ng Infrastructure compromise 

•  Prefix poisoning •  Traffic intercep(on and abuse 

•  Traffic forwarding 

•  Obfusca(on (op(onal) 

Page 27: Internet Pirates: blackholing, hijacking and other dirty tricks

Scream? Don’t you … 

Page 28: Internet Pirates: blackholing, hijacking and other dirty tricks

AS 10

AS 40

AS 20

AS 30

AS 100

AS 60

AS 50 AS 200

Based on “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

Page 29: Internet Pirates: blackholing, hijacking and other dirty tricks

KgrK Fgh_aigle •  Vic(m reconaissance 

–  RR Database objects –  Internet topology around it – NOC social engineering 

•  ASack Engineering –  Plan reply path (take note of ASN’s) –  Possible points of injec(on 

•  Rou(ng Infrastructure compromise •  Prefix poisoning •  Traffic intercep(on and abuse •  Traffic forwarding •  Obfusca(on (op(onal) 

Page 30: Internet Pirates: blackholing, hijacking and other dirty tricks

AS 100 AS 100 AS 10

AS 40

AS 20

AS 30

AS 60

AS 50 AS 200

Based on “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

1.0.0.0/16

Pirate compromises rou(ng infrastructure on AS100 

3

Pirate performs  

reconaisance on AS200 

1

Page 31: Internet Pirates: blackholing, hijacking and other dirty tricks

KgrK Fgh_aigle •  Vic(m reconaissance •  ASack Engineering •  Rou(ng Infrastructure compromise •  Prefix poisoning – Specific BGP prefix injec(on – AS‐PATH prepend reply path ASN’s – Policy rou(ng to nail next‐hop on 

•  Traffic intercep(on and abuse •  Traffic forwarding •  Obfusca(on (op(onal) 

Page 32: Internet Pirates: blackholing, hijacking and other dirty tricks

Nmgqml Pmsrc Glhcargml ip prefix‐list NET A.B.C.0/24 route‐map hijacked permit 10   

match ip address prefix‐list NET   set as‐path prepend 10 20 200 

route‐map hijacked permit 20   

router bgp 100   neighbor <AS10_PEER> route‐map hijack out   

Page 33: Internet Pirates: blackholing, hijacking and other dirty tricks

AS 10

AS 40

AS 20

AS 30

AS 100

AS 60

AS 50 AS 200

Traffic is received by vic(m without no(cing abusive ac(vity. 

6

Based on “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

Traffic is abused (i.e.sniff) and sent back using AS10 (policy rou(ng) 

5

Page 34: Internet Pirates: blackholing, hijacking and other dirty tricks

Nmjgaw pmsrgle interface Tunnel10   description MONKEY‐PIRATE   ip address 10.10.10.1 255.255.255.252   ip policy route‐map BACK   tunnel source interface Loopback0   tunnel destination <PIRATE IP> ! interface FastEthernet0   description Link to AS10 PROVIDER   ip address 172.16.1.1 255.255.255.252 !  ip route A.B.C.0 0.0.0.255 10.10.10.2 ip access‐list standard NET A.B.C.0 0.0.0.255 route‐map BACK permit 10   

match ip address NET   set ip next‐hop 172.16.1.2 

route‐map BACK permit 20 

Page 35: Internet Pirates: blackholing, hijacking and other dirty tricks

Déjà vu? Isn’t it a… 

Page 36: Internet Pirates: blackholing, hijacking and other dirty tricks

?PN nmgqmlgle _rr_ai 

192.168.0.1 FEEA:FEEA:FEEA

192.168.0.200 0001:0236:8624

192.168.0.20 000E:3858:AEDE

1. IP forwarding and sniffing activation

2. Send spoofed ARP reply (poison)

0:1:2:36:86:24 0:e:38:58:ae:de

arp reply 192.168.0.1 is-at 0:1:2:36:86:24

4. Traffic sent to default gateway

00-01-02-36-86-24 5. Traffic capture and forwarding

3. ARP update (poisoned) 192.168.0.1

00-01-02-36-86-24

Page 37: Internet Pirates: blackholing, hijacking and other dirty tricks

KgrK Fgh_aigle •  Vic(m reconaissance •  ASack Engineering •  Rou(ng Infrastructure compromise 

•  Prefix poisoning •  Traffic intercep(on and abuse 

•  Traffic forwarding 

•  Obfusca(on (op(onal) 

Page 38: Internet Pirates: blackholing, hijacking and other dirty tricks

Rp_acpmsrc `cdmpc Fgh_aigle 

Source: “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

Page 39: Internet Pirates: blackholing, hijacking and other dirty tricks

Rp_acpmsrc bspgle Fgh_aigle

Source: “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

Page 40: Internet Pirates: blackholing, hijacking and other dirty tricks

+ 10 

Rp_acpmsrc bspgle Fgh_aigle ugrf RRJ _bbgrgtc rcaflgosc 

Source: “Stealing the Internet” Defcon Talk – h6p://www.defcon.org 

Page 41: Internet Pirates: blackholing, hijacking and other dirty tricks

RRJ _bbgrgtc ml Jglsv 

iptables ‐t mangle  ‐I PREROUTING ‐i eth1 ‐j TTL ‐‐ttl‐inc N 

iptables ‐t mangle  ‐I POSTROUTING ‐o eth1 ‐j TTL ‐‐ttl‐inc N 

sysctl ‐w net.ipv4.ip_forward=1 

Page 42: Internet Pirates: blackholing, hijacking and other dirty tricks
Page 43: Internet Pirates: blackholing, hijacking and other dirty tricks
Page 44: Internet Pirates: blackholing, hijacking and other dirty tricks

F_lbq-ml J_` •  GNS3 graphical network simulator •  Dynamips Cisco IOS emulator 

•  Dynagen network configura(on generator •  VMWare Fusion VM’s for end nodes 

Page 45: Internet Pirates: blackholing, hijacking and other dirty tricks
Page 46: Internet Pirates: blackholing, hijacking and other dirty tricks

a Ghost? Have you seen … 

Page 47: Internet Pirates: blackholing, hijacking and other dirty tricks

Efmqr Fgh_aigle 

•  Unallocated space hijacking •  Used temporarily by aSackers to hide their ac(vity and avoid abuse no(fica(ons 

•  Nowadays mostly used for spam but could be used for other dirty issues (terrorism) 

•  Legal issues  who is responsible for something that doesn’t belong to anyone? 

Page 48: Internet Pirates: blackholing, hijacking and other dirty tricks

Ngp_rcq md rfc Glrcplcr 

Internet 101  ASacks  Countermeasures Protec(on 

Detec(on 

Reac(on 

Page 49: Internet Pirates: blackholing, hijacking and other dirty tricks

ready? Got … 

Page 50: Internet Pirates: blackholing, hijacking and other dirty tricks

Npmrcargml •  Review and harden your peerings •  Register and protect your objects on IRR DB •  Take Rou(ng Registry RIPE‐NCC training course – hSp://www.ripe.net/training/rr/index.html 

•  Hide your infrastructure:  et up an(spoofing (ACL’s or RPF) and infrastructure (ACL’s) filtering 

•  Have beers with other NOC or SOC teams – Why not on a SANS conference?  – Join mailing lists instead  

Page 51: Internet Pirates: blackholing, hijacking and other dirty tricks

Nccp pmsrc dgjrcpgle •  Where ? – Customer side –  Internet Exchange Points (IXP) / Private peerings – Transit providers 

•  What ? – Maximum number  – AS‐Path – Prefixes (sta(c or dynamic) 

o Tips’n’tricks –  IRRToolset tool (RIPE‐NCC, ISC) – Bogon Route Servers (Cymru) – Secure BGP configura(on guides (Cymru, NIST, SANS RR papers) 

Page 52: Internet Pirates: blackholing, hijacking and other dirty tricks

vigilant? enough… 

Page 53: Internet Pirates: blackholing, hijacking and other dirty tricks

Bcrcargml •  Aler(ng Systems – Prefix‐based NIDS 

•  Tools – RIPE Rou(ng Informa(on Service MyASN 

•  hSp://www.ris.ripe.net/myasn.html 

– Prefix Hijack Alert System (PHAS) •  hSp://phas.netsec.colostate.edu/ 

– BGPMon Project •  hSp://bgpmon.net/ 

– University of Roma iBGPPlay •  hSp://ibgplay.caspur.it 

Page 54: Internet Pirates: blackholing, hijacking and other dirty tricks

Source: RIPE RIS– hSp://www.ris.ripe.net 

Page 55: Internet Pirates: blackholing, hijacking and other dirty tricks

Source: Colorado State University – hSp://netsec.cs.colostate.edu/phas/ 

Page 56: Internet Pirates: blackholing, hijacking and other dirty tricks

Source: BGPmon project – hSp://bgpmon.net/ 

Page 57: Internet Pirates: blackholing, hijacking and other dirty tricks

@ENkml k_gj q_knjc Possible Prefix Hijack (Code: 11) 1 number of peer(s) detected this updates for your prefix A.B.C.0/19:  

Update details: 2008‐11‐11 02:01 (UTC) A.B.C.0/24  Announced by: AS16735 (Companhia de Telecomunicacoes do Brasil Central) 

Transit AS: 27664 (CTBC Multimedia) ASpath: 27664 16735  

Page 58: Internet Pirates: blackholing, hijacking and other dirty tricks

React!!! Then ... 

Page 59: Internet Pirates: blackholing, hijacking and other dirty tricks

Pc_argml •  Crying and screaming is allowed •  Contact upstreams providers and related mates – If you did, remember them you paid their beers – iNOC Dial‐By‐Asn (iNOC‐DBA) SIP phone 

•  Pray for a prompt response – From hours to days  – Depends on how important you are 

•  No(fy Law Enforcement Organiza(ons (LEO’s) if necessary 

Page 60: Internet Pirates: blackholing, hijacking and other dirty tricks

Internet 101  A5acks  Countermeasures 

Page 61: Internet Pirates: blackholing, hijacking and other dirty tricks

But what about… …tomorrow? 

Page 62: Internet Pirates: blackholing, hijacking and other dirty tricks

Qcaspc((mpgegl) @EN •  Drao on IETF RPSEC Working Group •  PKI authen(ca(on for IP address blocks mapping ASN assignments 

•  Digital signature carried over BGP transi(ve path aSribute 

•  Verifica(on on external device •  “Chicken and Egg” problem … wai(ng for RFC and ISP deployment 

Page 63: Internet Pirates: blackholing, hijacking and other dirty tricks

Déjà vu? Isn’t it a… 

Page 64: Internet Pirates: blackholing, hijacking and other dirty tricks

References 1/2 

•  “Stealing the Internet” A.Pilisov, T.Kapela – Defcon 16 Conference hSp://www.defcon.org/html/links/defcon‐media‐archives.html#dc_16 

•   “BGP RouDng Security” D.Wendlandt – Carnegie Mellon University hSp://www.cs.cmu.edu/~dwendlan/rou(ng/ 

•   “BGP Security resources” hSp://www.bgp4.as/security 

Page 65: Internet Pirates: blackholing, hijacking and other dirty tricks

References 2/2 

•  “BGP Vulnerability TesDng”  S.Convery MaShew Franz hSp://www.blackhat.com/presenta(ons/bh‐usa‐03/bh‐us‐03‐convery‐franz‐v3.pdf 

•  “Hacking Cisco Networks Exposed”  A.Vladimirov, A.Mikhailovsky – McGraw Hill ISBN: 0‐07‐225917‐5 

Page 66: Internet Pirates: blackholing, hijacking and other dirty tricks

THANKS! 

[email protected] hSp://carlos.fragoso.eu 

Page 67: Internet Pirates: blackholing, hijacking and other dirty tricks

STAY TUNED!