Defcon 16, Pilosov Kapela, "Stealing The Internet"
Defcon 16, Pilosov Kapela, "Stealing The Internet"
Agenda
BGP & Internet 101 Old Hijackings The main monkey business
MITM method, explained Graphs, etc Live Demo
BGP 101
How is the Internet glued together?
No central core Individual networks (identified by ASN) interconnect and announce IP space to each other Announcement contains IP prefix, AS-PATH, communities, other attributes AS-PATH is a list of who has passed the announcement along; used to avoid loops (important for our method) Fundamental tenet in IP routing: More-specific prefixes will win e.g. 10.0.0.0/24 wins over 10.0.0.0/8
On Prefixes
Internet routing is inherently trust-based
No chain of trust in IP assignments
ICANN assigns space to Regional Internet Registries (RIRs - ARIN/RIPE/AFRINIC) RIRs assign to ISPs or LIRs (in RIPE region) No association between ASN and IP for most assignments (except RIPE)
Customer:
Often unfiltered BGP: max-prefix and sometimes ASPATH Smaller carriers and smaller customers static prefix-list, emails or phone calls to update
Verification by whois
Peer:
Typically none beyond max-prefix and scripts to complain when announcing something they shouldnt (rare) Many dont even filter their own internal network routes coming from external peers
An IRR Update
Which Should Have Been Questioned
From: [email protected] To: [email protected] ReplyTo: [email protected] Subject: Forwarded mail.... (fwd) Sent: Aug 7, 2008 9:48 PM Your transaction has been processed by the IRRd routing registry system. Diagnostic output: ----------------------------------------------------------The submission contained the following mail headers: From: [email protected] Subject: Forwarded mail.... (fwd) Date: Thu, 7 Aug 2008 21:48:53 -0400 (EDT) Msg-Id: <[email protected]>
ADD OK: [route] 24.120.56.0/24 AS26627 ---------------------------------------If you have any questions about ALTDB, please send mail to [email protected].
Criminality
If nobody is using it, is it really illegal? IP prefix is just a number No prosecutions for non-malicious announcements that we are aware of Worst case scenario for non-malicious hijack: ARIN/RIPE pull PTR records and transits shut you off (eventually)
How-To Hijack
Full hijacking, apparent authority to announce
This was cool in 2001 Find IP Network (using whois) with contact email address in @hotmail.com or at domain that has expired Register domain/email Change contact
Historical Hijackings
AS7007 97, accidental bgp->rip->bgp redistribution broke Internet (tens of thousands of new announcements filled router memory, etc) 146.20/16 Erie Forge and Steel (how apropos) 166.188/16 Carabineros De Chile (Chile Police) hijacked twice, by registered Carabineros De Chile LLC, Nevada Corporation More details available on completewhois.com Accidental hijackings happen frequently low chance of getting caught
Pakistans government decides to block YouTube Pakistan Telecom internally nails up a more specific route (208.65.153.0/24) out of YouTubes /22 to null0 (the routers discard interface) Somehow redists from static bgp, then to PCCW Upstream provider sends routes to everyone else Most of the net now goes to Pakistan for YouTube, gets nothing! YouTube responds by announcing both the /24 and two more specific /25s, with partial success PCCW turns off Pakistan Telecom peering two hours later 3 to 5 minutes afterward, global bgp table is clean again
Of Interest
IP Hijacking BoF
Un-official event at NANOG conference We test security of Internet routing infrastructure Recent exercises:
Hijacked 1.0.0.0/8: 90% success Hijacked 146.20.0.0/16: 95% success Attempted to announce networks longer than / 24: from /25 down to /32 with cooperation of large CDNs. 40% successful overall
Endpoint enumeration - direct discovery of who and what your network talks to Can be accomplished globally, any-to-any How would you know if this isnt happening right now to your traffic at DEFCON?
Then it clicked use the Internet itself as reply path, but how?
AS30
AS50
AS30
AS50
AS30
AS50
2 3 4 5 6 7 8 9 10 11 12 13
12.87.94.9 [AS 7018] 8 msec 8 msec 4 msec tbr1.cgcil.ip.att.net (12.122.99.38) [AS 7018] 4 msec 8 msec 8 msec ggr2.cgcil.ip.att.net (12.123.6.29) [AS 7018] 4 msec 8 msec 4 msec 192.205.35.42 [AS 7018] 8 msec 4 msec 8 msec cr2-loopback.chd.savvis.net (208.172.2.71) [AS 3561] 16 msec 12 msec * cr2-pos-0-0-5-0.NewYork.savvis.net (204.70.192.110) [AS 3561] 28 msec 32 msec 32 msec 204.70.196.70 [AS 3561] 28 msec 32 msec 32 msec 208.175.194.10 [AS 3561] 32 msec 32 msec 32 msec gig5-1.esw03.las.switchcommgroup.com (66.209.64.186) [AS 23005] 88 msec 88 msec 84 msec 66.209.64.85 [AS 23005] 88 msec 88 msec 88 msec gig0-2.esw07.las.switchcommgroup.com (66.209.64.178) [AS 23005] 84 msec 84 msec 88 msec acs-wireless.demarc.switchcommgroup.com (66.209.64.70) [AS 23005] 88 msec 88 msec 88 msec
Hijacked:
2 3 4 5 6 7 8 9 10 11 12 13 12.87.94.9 [AS 7018] 8 msec 8 msec 4 msec tbr1.cgcil.ip.att.net (12.122.99.38) [AS 7018] 4 msec 8 msec 8 msec ggr2.cgcil.ip.att.net (12.123.6.29) [AS 7018] 4 msec 8 msec 4 msec 192.205.35.42 [AS 7018] 8 msec 4 msec 8 msec cr2-loopback.chd.savvis.net (208.172.2.71) [AS 3561] 16 msec 12 msec * cr2-pos-0-0-5-0.NewYork.savvis.net (204.70.192.110) [AS 3561] 28 msec 32 msec 32 msec 204.70.196.70 [AS 3561] 28 msec 32 msec 32 msec 208.175.194.10 [AS 3561] 32 msec 32 msec 32 msec gig5-1.esw03.las.switchcommgroup.com (66.209.64.186) [AS 23005] 88 msec 88 msec 84 msec 66.209.64.85 [AS 23005] 88 msec 88 msec 88 msec gig0-2.esw07.las.switchcommgroup.com (66.209.64.178) [AS 23005] 84 msec 84 msec 88 msec acs-wireless.demarc.switchcommgroup.com (66.209.64.70) [AS 23005] 88 msec 88 msec 88 msec
In conclusion
We learned that any arbitrary prefix can be hijacked, without breaking end-to-end We saw it can happen nearly invisibly We noted the BGP as-path does reveal the attacker Shields up; filter your customers.