Presentation on theme: "CSE390 – Advanced Computer Networks"— Presentation transcript:
1CSE390 – Advanced Computer Networks Christo Wilson8/22/2012CSE390 – Advanced Computer NetworksLecture 20: Routing Security(Hijacking the Internet for fun and profit!)Based on slides from J. Princeton U. Revised Fall 2014 by P. GillDefense
2BGP: The Internet’s Routing Protocol (1) A simple model of AS-level business relationships.$$ISP 1ISP 1(peer)Level 3(peer)Level 3$stubStub(customer)VerizonWirelessISP 2(provider)ISP 2$$In this work we look at issues relating to security of routing on the internet, but first lets see what we mean when we talk about routing.In this work we focus on routing between autonomous systems on the internet. So you can think of autonomous systems as the network run by an organization. So for example, AT&T’s network might be one autonomous system and the university of toronto’s network is another autonomous system.Say the prefix is a block of ip addressesDefine ASThis topology corresponds to:Large ISP 1 = ATTLarge ISP 2 = NTTVerizon wireless is really “ ”We have routeviews announcements for ATT and NTT below======================= ATT = “Large ISP 1” FIXES THINGS ==============updates lines: | TIME: 04/08/10 12:02:49 | TYPE: BGP4MP/MESSAGE/Update | FROM: AS7018 | TO: AS6447 | ORIGIN: IGP | ASPATH: | NEXT_HOP: | COMMUNITY: 7018:5000 | ANNOUNCE | /19 | /19 | /24 | /24 | /20 | /24 | /24 | /20 | /24 | /24 | /20 | /24 | /19 | /24 | /19 | /20 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /18 | /19 | /24 | /24 | /24 | /24 | /24 | /20 | /19 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24 | /24And================== NTT = “Large ISP 2” fixes thingsupdates lines: | TIME: 04/08/10 11:58:59 | TYPE: BGP4MP/MESSAGE/Update | FROM: AS2914 | TO: AS6447 | ORIGIN: IGP | ASPATH: | NEXT_HOP: | MULTI_EXIT_DISC: 5 | COMMUNITY: 2914: : : :3356 | ANNOUNCE | /24 | /2422394(also VZW)
3BGP: The Internet’s Routing Protocol (2) A stub is an AS with no customers that never transits traffic.(Transit = carry traffic from one neighbor to another)$ISP 1ISPLevel 3ISPstubXLoses $VerizonWirelessISP 2$In this study we distinguish between two different types of autonomous systems. The first are stubs that do not transit traffic. So forexample the stub in the slide here would not transit traffic between its two provider Ases because it would lose money in doing so. For stubs you can think of Internet as a cost, like electricity rather than a source of income. The second type of ASes are ISPs that transit traffic for other autonomous systems. For these Ases transiting traffic is a source of revenue and profit.2239485% of ASes are stubs!We call the rest (15%) ISPs.
4IP Address Ownership and Hijacking IP address block assignmentRegional Internet Registries (ARIN, RIPE, APNIC)Internet Service ProvidersProper origination of a prefix into BGPBy the AS who owns the prefix… or, by its upstream provider(s) in its behalfHowever, what’s to stop someone else?Prefix hijacking: another AS originates the prefixBGP does not verify that the AS is authorizedRegistries of prefix ownership are inaccurate
5Getting access to the router How to Hijack a PrefixThe hijacking AS hasRouter with eBGP session(s)Configured to originate the prefixGetting access to the routerNetwork operator makes configuration mistakeDisgruntled operator launches an attackOutsider breaks in to the router and reconfiguresGetting other ASes to believe bogus routeNeighbor ASes not filtering the routes… e.g., by allowing only expected prefixesBut, specifying filters on peering links is hard
6Pakistan Telecom: Sub-prefix hijack February 2008 : Pakistan Telecom hijacks YouTubeYouTubePakistanTelecom“The Internet”TelnorAga KhanUniversityMultinetI’m YouTube:IP / 22-level of autonomous systems-e.g., YouTube, AT&T, pakistan telecom-routing is done on IP addresses, so when someone wants to go to YouTube they get YouTube’s IP address and YouTube announces to the world that they have the ip address and traffic is forwarded towards them. So here multinet would route to it’s provider pakistan telecom that then forwards the traffic on to youtube.-these networks chosen for a specific reason which is that there was an incident in february 2008 pakistan telecom actually high jacked traffic going to youtube (misconfiguration).-they announced to the world that they’re youtube and traffic destined to youtube was routed to them-youtube was unavailable for a couple of hours as operators phone each other to figure out what was going on.
7Pakistan Telecom: Sub-prefix hijack Here’s what should have happened….YouTubePakistanTelecom“The Internet”TelnorAga KhanUniversityMultinetHijack + drop packets going to YouTubeXI’m YouTube:IP / 22Block your own customers.
8Pakistan Telecom: Sub-prefix hijack But here’s what Pakistan ended up doing…YouTubePakistanTelecom“The Internet”TelnorAga KhanUniversityMultinetNo, I’m YouTube!IP / 24PakistanTelecomI’m YouTube:IP / 22Our works focuses on attacks of this flavor..
9China Telecom: Interception Level3, VZW, /24ISP 1VZW, /24Level 3ChinaTelecomVerizonWireless/24B4 we start with attacks lets lookat how bgp worksWe have this prefix22.. Ann, verizon routes traffic to it, reannounces it“ (level 3)Some of you may remember a recent “interesting incident” that actually made it into the nytimesCtel ann prefix; this wrong, b\c it’s not suppose to originateLots of isps fell for this, we look at the data and there we a number of large isp, including thisone that remains nameless,that fell for this.In fact we found that this happened for 50K prefix, including the DoD.Also, even worse, renesys found that theres an interceptionC tel is so big…There have been many well publicized misconfigurations that illustrate the insecurity of BGP. For example consider the prefix on the last slide. In april 2010 China telecom announced a direct path to this prefix (as well as 50k other ones). So now ISP 1 has two paths to the prefix and needs to pick 1. Since the china telecom path is shorter ISP 1 will choose to route through it. And what’s interesting here, is that since China Telecom is so large they actually had a router in their network that still new the correct path to the prefix so the traffic went back out to level 3 and on to verizon.22394Paths chosen based on cost and length./24
10China Telecom: Interception April 2010 : China Telecom intercepts trafficChinaTel path is shorter?ChinaTel /24Level3, VZW, /24ISP 1Level 3ChinaTelecomVerizonWirelessB4 we start with attacks lets lookat how bgp worksWe have this prefix22.. Ann, verizon routes traffic to it, reannounces it“ (level 3)Some of you may remember a recent “interesting incident” that actually made it into the nytimesCtel ann prefix; this wrong, b\c it’s not suppose to originateLots of isps fell for this, we look at the data and there we a number of large isp, including thisone that remains nameless,that fell for this.In fact we found that this happened for 50K prefix, including the DoD.Also, even worse, renesys found that theres an interceptionC tel is so big…There have been many well publicized misconfigurations that illustrate the insecurity of BGP. For example consider the prefix on the last slide. In april 2010 China telecom announced a direct path to this prefix (as well as 50k other ones). So now ISP 1 has two paths to the prefix and needs to pick 1. Since the china telecom path is shorter ISP 1 will choose to route through it. And what’s interesting here, is that since China Telecom is so large they actually had a router in their network that still new the correct path to the prefix so the traffic went back out to level 3 and on to verizon.22394This prefix and 50K others were announced by China TelecomTraffic for some prefixes was possibly intercepted/24
11Canadian Bitcoin hijack (2/3/2014) Bitcoin BackgroundMiners solve cryptographic puzzles using their computing powerOnce the puzzle is solved new bitcoins are created and the miner gets some rewardMining is generic: mining pool dictates currencyE.g., dogecoin, bitcoin etc.Miners communicate with pool server using a protocol called ‘stratum’Mining server can redirect user to a different server (e.g., for load balancing)
12Canadian Bitcoin hijack (2/3/2014) Hijacked users got directed to a mining server IP that was under the control of the hijacker and redirects them to a malicious mining pool.Miners continue to receive tasks and solve puzzles but don’t get compensated.
16Canadian Bitcoin hijack (2/3/2014) Estimated loss of $83,000
17Bogus AS Paths to Hide Hijacking Adds AS hop(s) at the end of the pathE.g., turns “701 88” into “ ”MotivationsEvade detection for a bogus routeE.g., by adding the legitimate AS to the endHard to tell that the AS path is bogus…Even if other ASes filter based on prefix ownership7013/888/8
18Path-Shortening Attacks Remove ASes from the AS pathE.g., turn “ ” into “701 88”MotivationsMake the AS path look shorter than it isAttract sources that normally try to avoid AS 3715Help AS 88 look like it is closer to the Internet’s coreWho can tell that this AS path is a lie?Maybe AS 88 *does* connect to AS 701 directly701371588?
19Attacks that Add a Bogus AS Hop Add ASes to the pathE.g., turn “701 88” into “ ”MotivationsTrigger loop detection in AS 3715Denial-of-service attack on AS 3715Or, blocking unwanted traffic coming from AS 3715!Make your AS look like is has richer connectivityWho can tell the AS path is a lie?AS 3715 could, if it could see the routeAS 88 could, but would it really care as long as it received data traffic meant for it?70188
20Violating “Consistent Export” to Peers Peers require consistent exportPrefix advertised at all peering pointsPrefix advertised with same AS path lengthReasons for violating the policyTrick neighbor into “cold potato”Configuration mistakeMain defenseAnalyzing BGP updates… or data traffic… for signs of inconsistencydestBad ASBGPdatasrc
21Hijacking is Hard to Debug Real origin AS doesn’t see the problemPicks its own routeMight not even learn the bogus routeMay not cause loss of connectivityE.g., if the bogus AS snoops and redirects… may only cause performance degradationOr, loss of connectivity is isolatedE.g., only for sources in parts of the InternetDiagnosing prefix hijackingAnalyzing updates from many vantage pointsLaunching traceroute from many vantage points
22Other Attacks Attacks on BGP sessions Resource exhaustion attacks Confidentiality of BGP messagesDenial-of-service on BGP sessionInserting, deleting, modifying, or replaying messagesResource exhaustion attacksToo many IP prefixes (e.g., BGP “512K Day”)Too many BGP update messagesData-plane attacksAnnounce one BGP routes, but use another
23Outline Control plane attacks on routing Attacks on the BGP Session Solutions to prevent prefix hijacksSolutions to detect prefix hijacksData plane attacksWrap up
24TCP Connection Underlying BGP Session BGP session runs over TCPTCP connection between neighboring routersBGP messages sent over TCP connectionMakes BGP vulnerable to attacks on TCPMain kinds of attacksAgainst confidentiality: eavesdroppingAgainst integrity: tamperingAgainst performance: denial-of-serviceMain defensesMessage authentication or encryptionLimiting access to physical path between routersDefensive filtering to block unexpected packets
25Attacks Against Confidentiality EavesdroppingMonitoring the messages on the BGP session… by tapping the link(s) between the neighborsReveals sensitive informationInference of business relationshipsAnalysis of network stabilityReasons why it may be hardChallenging to tap the linkOften, eBGP session traverses just one link… and may be hard to get access to tap itEncryption may obscure message contentsBGP neighbors may run BGP over IPSecBGP sessionphysical link
26Attacking Message Integrity TamperingMan-in-the-middle tampers with the messagesInsert, delete, modify, or replay messagesLeads to incorrect BGP behaviorDelete: neighbor doesn’t learn the new routeInsert/modify: neighbor learns bogus routeReasons why it may be hardGetting in-between the two routers is hardUse of authentication (signatures) or encryptionSpoofing TCP packets the right way is hardGetting past source-address packet filtersGenerating the right TCP sequence number
27Denial-of-Service Attacks, Part 1 Overload the link between the routersTo cause packet loss and delay… disrupting the performance of the BGP sessionRelatively easy to doCan send traffic between end hostsAs long as the packets traverse the link(which you can figure out from traceroute)Easy to defendGive higher priority to BGP packetsE.g., by putting packets in separate queueBGP sessionphysical link
28Denial-of-Service Attacks, Part 2 Third party sends bogus TCP packetsFIN/RST to close the sessionSYN flooding to overload the routerLeads to disruptions in BGPSession reset, causing transient routing changesRoute-flapping, which may trigger flap dampingReasons why it may be hardSpoofing TCP packets the right way is hardDifficult to send FIN/RST with the right TCP headerPacket filters may block the SYN floodingFilter packets to BGP port from unexpected source… or destined to router from unexpected source
29Exploiting the IP TTL Field BGP speakers are usually one hop apartTo thwart an attacker, can check that the packets carrying the BGP message have not traveled farIP Time-to-Live (TTL) fieldDecremented once per hopAvoids packets staying in network foreverGeneralized TTL Security Mechanism (RFC 3682)Send BGP packets with initial TTL of 255Receiving BGP speaker checks that TTL is 254… and flags and/or discards the packet othersHard for third-party to inject packets remotely
30Outline Control plane attacks on routing Attacks on the BGP Session Solutions to prevent prefix hijacksSolutions to detect prefix hijacksData plane attacksWrap up
31Securing the Internet: RPKI Resource Public Key Infrastructure (RPKI): Certified mapping from ASes to public keys and IP prefixes.XRPKI: Invalid!?ChinaTel /24Level3, VZW, /24ISP 1Level 3ChinaTelecomVerizonWirelessOne way we might solve this is using the cryOne way to solve this is to do origin authentication using RPKI which is a certified mapping between IP prefixes and the Ases that own them. So now ISP 1 can check the RPKI and see that china telecom is not a valid orignator of this prefix and choose the correct path to the prefix.22394RPKI shows China Telecom is not a valid origin for this prefix./24
32But RPKI alone is not enough! Resource Public Key Infrastructure (RPKI): Certified mapping from ASes to public keys and IP prefixes.?ChinaTel, /24Level3, VZW, /24ISP 1Level 3ChinaTelecomVerizonWirelessHowever, if instead of just being misconfigured, china telecom decided to behave maliciously, RPKI would not be enough. So for example china telecom could pretend they have a direct connection to the AS that owns the prefix by announcing China telecom22394Malicious router can pretend to connect to the valid origin./24
33We need path validating protocols soBGP: Secure origin BGPOrigin authentication +…Trusted database that guarantees that a path existsASes jointly sign + put their connectivity in the DBStops ASes from announcing paths with edges that do not existWhat challenges might soBGP face for deployment?S-BGP: Secure BGPEach AS on the path cryptographically signs its announcementGuarantees that each AS on the path made the announcement in the path.
34S-BGP : RPKI + Cannot announce a path that was not announced to you. VZW: (22394, Prefix)Level3: (VZW, 22394, Prefix)ISP 1: (Level3, VZW, 22394, Prefix)ISP 1Level 3ChinaTelecomVerizonWirelessVZW: (22394, Prefix)Level3: (VZW, 22394, Prefix)22394VZW: (22394, Prefix)Public Key Signature: Anyone with 22394’s public key can validate that the message was sent by
35S-BGP : RPKI + Cannot announce a path that was not announced to you. VZW: (22394, Prefix)Level3: (VZW, 22394, Prefix)ISP 1: (Level3, VZW, 22394, Prefix)ISP 1Level 3ChinaTelecomVerizonWireless22394Malicious router can’t announce a direct path to 22394, since never saidChinaTel: (22394, Prefix)
36S-BGP Secure Version of BGP Address attestationsClaim the right to originate a prefixSigned and distributed out-of-bandChecked through delegation chain from ICANNRoute attestationsDistributed as an attribute in BGP update messageSigned by each AS as route traverses the networkSignature signs previously attached signaturesS-BGP can validateAS path indicates the order ASes were traversedNo intermediate ASes were added or removed
37S-BGP Deployment Challenges Complete, accurate registriesE.g., of prefix ownershipPublic Key InfrastructureTo know the public key for any given ASCryptographic operationsE.g., digital signatures on BGP messagesNeed to perform operations quicklyTo avoid delaying response to routing changesDifficulty of incremental deploymentHard to have a “flag day” to deploy S-BGP
38S-BGP Deployment Challenges Need ISPs to agree on and deploy a new protocol!These are competing organizations!Economic incentives?Doesn’t improve performanceHard to convince customers to pay more for securityNo benefit to unilateral deploymentNeed entire path to deploy SBGP/soBGP before you get any benefit!Like IPv6…. But worse
39Outline Control plane attacks on routing Attacks on the BGP Session Solutions to prevent prefix hijacksSolutions to detect prefix hijacksData plane attacksWrap up
40Incrementally Deployable Schemes Monitoring BGP update messagesUse past history as an implicit registryE.g., AS that announces each address blockE.g., AS-level edges and pathsOut-of-band detection mechanismGenerate reports and alertsInternet Alert Registry:Prefix Hijack Alert System:Soft response to suspicious routesPrefer routes that agree with the pastDelay adoption of unfamiliar routes when possibleSome (e.g., misconfiguration) will disappear on their own
41Control Plane Vs. Data Plane BGP is a routing protocolBGP security concerns validity of routing messagesI.e., did the BGP message follow the sequence of ASes listed in the AS-path attributeData planeRouters forward data packetsSupposedly along the path chosen in the control planeBut what ensures that this is true?
42Control plane anomaly types Multiple origin AS (MOAS)AS that doesn’t normally announce a prefix begins to announce itCan be legitimate (anycast IPs, IP transfers)
43Control plane anomaly types Increase in prefixes originated by each ASE.g., China telecom incident, AS rapidly went from announcing few prefixes to announcing 50k prefixesValley-free violationsPaths where an AS appears to transit traffic at a revenue loss.
44Control plane anomaly types New edges in the AS graphsMay be because of false routing announcements (or new relationships)Edge V-A in below figure doesn’t actually exist!
45Control plane anomaly types Inconsistent prepending announcementsAdversary may strip prepending to make their path look more appealing.
46Correlating anomalies with the data plane When a control plane anomaly is seen, correlate with data plane measurements to see the impact.Paper: Argus (IMC 2012)
47Outline Control plane attacks on routing Attacks on the BGP Session Solutions to prevent prefix hijacksSolutions to detect prefix hijacksData plane attacksWrap up
48Data-Plane Attacks, Part 1 Drop packets in the data planeWhile still sending the routing announcementsEasier to evade detectionEspecially if you only drop some packetsLike, oh, say, BitTorrent or Skype trafficEven easier if you just slow down some trafficHow different are normal congestion and an attack?Especially if you let ping/traceroute packets through?
49Data-Plane Attacks, Part 2 Send packets in a different directionDisagreeing with the routing announcementsDirect packets to a different destinationE.g., one the adversary controlsWhat to do at that bogus destination?Impersonate the legitimate destination (e.g., to perform identity theft, or promulgate false information)Snoop on the traffic and forward along to real destinationHow to detect?Traceroute? Longer than usual delays?End-to-end checks, like site certificate or encryption?
50Fortunately, Data-Plane Attacks are Harder Adversary must control a router along the pathSo that the traffic flows through himHow to get control a routerBuy access to a compromised router onlineGuess the passwordExploit known router vulnerabilitiesInsider attack (disgruntled network operator)Malice vs. greedMalice: gain control of someone else’s routerGreed: Verizon DSL blocks Skype to gently encourage me to pick up my landline phone to use Verizon long distance $ervice
51Outline Control plane attacks on routing Attacks on the BGP Session Solutions to prevent prefix hijacksSolutions to detect prefix hijacksData plane attacksWrap up
52BGP is So Vulnerable Several high-profile outages Many smaller examplesBlackholing a single destination prefixHijacking unallocated addresses to send spamWhy isn’t it an even bigger deal?Really, most big outages are configuration errorsMost bad guys want the Internet to stay up… so they can send unwanted traffic (e.g., spam, identity theft, denial-of-service attacks, port scans, …)
53BGP is So Hard to Fix Complex system Large, with around 30,000 ASesDecentralized control among competitive ASesCore infrastructure that forms the InternetHard to reach agreement on the right solutionS-BGP with public key infrastructure, registries, crypto?Who should be in charge of running PKI and registries?Worry about data-plane attacks or just control plane?Hard to deploy the solution once you pick itHard enough to get ASes to apply route filtersNow you want them to upgrade to a new protocol… all at the exact same moment?
54Conclusions Internet protocols designed based on trust The insiders are good guysAll bad guys are outside the networkBorder Gateway Protocol is very vulnerableGlue that holds the Internet togetherHard for an AS to locally identify bogus routesAttacks can have very serious global consequencesProposed solutions/approachesSecure variants of the Border Gateway ProtocolAnomaly detection schemes, with automated responseBroader focus on data-plane availability