bgp prefix hijack defense at nanog 46

31
Prefix Hijacking Mitigation Something is better than nothing NANOG 46 – June 2009 James Cowie, Renesys Tom Daly, Dynamic Network Services Anton Kapela, Voxel Todd Underwood, Google

Upload: dyn

Post on 26-May-2015

4.752 views

Category:

Education


2 download

DESCRIPTION

BGP Hijacking Mitigation: Something is Better Than Nothing Todd Underwood, Google; James Cowie, Renesys; Tom Daly, Dynamic Network Services; Anton Kapela, Voxel

TRANSCRIPT

Page 1: BGP Prefix Hijack Defense at NANOG 46

Prefix Hijacking Mitigation

Something is better than nothing

NANOG 46 – June 2009

Something is better than nothing

James Cowie, Renesys

Tom Daly, Dynamic Network Services

Anton Kapela, Voxel

Todd Underwood, Google

Page 2: BGP Prefix Hijack Defense at NANOG 46

Outline

• Introduction to prefix hijacking

• Mitigating against an event

• Experiment

• Questions

NANOG 46 – June 2009

• Questions

Page 3: BGP Prefix Hijack Defense at NANOG 46

Prefix Hijacking 101

• Announce someone else's prefix

• Announce a more specific of a someone else's

prefix

NANOG 46 – June 2009

• Synopsis: You are trying to “steal” someone

else’s traffic by getting it routed to you.

• Capture, sniff, redirect, manipulate traffic as

you wish.

Page 4: BGP Prefix Hijack Defense at NANOG 46

Same Prefix: Shorter AS Path Wins

AS 30

AS 10

Client

NANOG 46 – June 2009

AS 50

AS 40

AS 20

192.168.10/24192.168.10/24

Page 5: BGP Prefix Hijack Defense at NANOG 46

Same Path: More Specific Prefix Wins

AS 30

AS 10

Client

NANOG 46 – June 2009

AS 40

192.168.10/24 192.168.10/25

Page 6: BGP Prefix Hijack Defense at NANOG 46

Advanced Hijacking: Pilosov/

Kapela's MITM Attack

• http://eng.5ninesdata.com/~tkapela

• Create a new path for the hijacked traffic

• Copy/observe/record traffic

• Return it to the rightful originator

NANOG 46 – June 2009

• Return it to the rightful originator

• Hide your tracks

• Includes prepending ASes along the return

path and TTL modification for traceroute

hiding

Page 7: BGP Prefix Hijack Defense at NANOG 46

Impact

• IP space that is in-use: (obvious operational

impact)

• Disrupts traffic, denies service to the traffic

• IP space not in-use (delayed operational

impact)

NANOG 46 – June 2009

impact)

• Damage to reputation of the target

• Either way, you may or may not know it is

happening!

Page 8: BGP Prefix Hijack Defense at NANOG 46

Does It Actually Happen?

• Yes!

• Famously: Youtube:

http://nanog.org/meetings/nanog43/presentations/Brownyoutube_

• Also, Yahoo, Google, and many, many others

NANOG 46 – June 2009

• Also, Yahoo, Google, and many, many others

• Not as often as some people think• Certainly not a daily or weekly occurrence

• It may happen (and is worth preparing for it) but is not the biggest threat you face.

• MITM hijacking unlikely so far

Page 9: BGP Prefix Hijack Defense at NANOG 46

Why Doesn't Someone Fix This?

• We try! Sorta:

• Peers don't route-filter each other:

• http://www.nanog.org/mtg-0510/deleskie.html

• No trust anchors built into the

NANOG 46 – June 2009

allocation/routing system from the start:

• Randy Bush asked for one as an Eid present:

www.nanog.org/mtg-0602/pdf/bush.pdf

• Didn't happen 2006, 2007 or 2008

• No way to validate routes in flight:

• SBGP, soBGP never implemented

Page 10: BGP Prefix Hijack Defense at NANOG 46

Mitigation Overview

• Prepare (most important)

• Detect

• Investigate

• Mitigate (novel suggestion for how)

NANOG 46 – June 2009

•• Clean up

Page 11: BGP Prefix Hijack Defense at NANOG 46

Mitigation 0: Prepare

• Ensure prefixes are all provably yours:• Gather allocation/SWIP documentation

• Gather electronic versions of any LOAs from customers

• Register prefixes in IRRs

NANOG 46 – June 2009

• Ask providers to accept le /25 and test acceptance and propagation of the /25s in advance

• Ask provider about response procedures to hijackings, DOSes

Page 12: BGP Prefix Hijack Defense at NANOG 46

Mitigation 0: Prepare (cont.)

• Do not put important resources in the same prefixes:

• Youtube ran DNS in the same prefixes as web/video previously. Limits the scope of damage.

• Providers and peers should be selected on the basis of clue in dealing with this.

NANOG 46 – June 2009

basis of clue in dealing with this.

• Join security groups, if possible.

• Most importantly: build relationships with as many engineers/managers at major networks as possible. There are the people that are going to help you when this happens to you!

Page 13: BGP Prefix Hijack Defense at NANOG 46

Mitigation 1: Detect (quickly!)

• There are lots of tools that can do this for you.

Pick one (or two) and use them.

– RIPE RIS

– PHAS

NANOG 46 – June 2009

– PHAS

– BGPMon

– Renesys

– Something home grown

Page 14: BGP Prefix Hijack Defense at NANOG 46

Mitigation 1: Detection (How)

• Change in origin ASN

• Change in route propagation through

unauthorized / unknown peers

• Origination of a more specific prefix

NANOG 46 – June 2009

• Origination of a more specific prefix

• Traffic monitoring, etc.

Page 15: BGP Prefix Hijack Defense at NANOG 46

Mitigation 2: Investigate

• Make sure it's a hijacking

• Make sure you understand who is responsible

and what routes they are sending to whom

• Gather your evidence carefully

NANOG 46 – June 2009

• Gather your evidence carefully

Page 16: BGP Prefix Hijack Defense at NANOG 46

Mitigation 3: Mitigate

• Originate more specifics. Up to those /25s you

tested. This may help you get your traffic back.

• Contact the “nearest responsible large

provider” to the hijack, asking them to route

NANOG 46 – June 2009

provider” to the hijack, asking them to route

filter.

• Work upstream from yourself and the hijacker,

asking for filtering.

• Your RIR/IRR/LOA data may be critical here.

Page 17: BGP Prefix Hijack Defense at NANOG 46

Mitigation 4: Clean Up• Get attacker to stop announcing prefixes.

• Get attacker’s upstream to properly filter the

attacker.

• Stop originating more specifics from your own

network.

NANOG 46 – June 2009

network.

• Thank everyone who helped, profusely. Buy

them beverages. You'll need their help again

soon.

Page 18: BGP Prefix Hijack Defense at NANOG 46

Hypothesis

• Can the affects of route flap dampening be

used to mitigate a prefix hijacking?

NANOG 46 – June 2009

used to mitigate a prefix hijacking?

Page 19: BGP Prefix Hijack Defense at NANOG 46

Mitigation: The Flapping

• Novel concept: flap the hijacked more specific

• Assuming:

• P/23 is the covering prefix originated by ASNA

• P/24 is originated from hijacker ASNB

NANOG 46 – June 2009

• P/24 is originated from hijacker ASNB

• ASNA should originate and then flap P/24

• P/24 should be flap dampened (at least

somewhat) and the covering /23 will catch the

traffic

Page 20: BGP Prefix Hijack Defense at NANOG 46

Lower P/24 part of P/23 Upper P/24 part of P/23

Normal State: P/23 originated by ASN A

Lower P/24 originated by attacker

ASN BUpper P/24 part of P/23

Hijacked State: P/23 originated by ASN A

NANOG 46 – June 2009

Lower P/24 originated by attacker

ASN BUpper P/24 part of P/23

Flapped State: P/23 originated by ASN A

ASN BUpper P/24 part of P/23

Page 21: BGP Prefix Hijack Defense at NANOG 46

Flapping: An Experiment

• The Players:

– AS33517: Dynamic Network Services

• Has 216.146.34.0/23, originates 216.146.34.0/23 and

216.146.35.0/24

– AS16842: Five Nines Data

NANOG 46 – June 2009

– AS16842: Five Nines Data

• Hijacking 216.146.34.0/24

• AS16842 originates 216.146.34.0/24, stealing half of

AS33517’s /23.

• AS33517 responds by announcing the stolen /24.

• Observe the steady state.

Page 22: BGP Prefix Hijack Defense at NANOG 46

Flapping: An Experiment (2)

• The flapping:

– AS33517 begins flapping 216.146.34.0/24 in an

attempt to suppress the more specific (and get

traffic back)

NANOG 46 – June 2009

traffic back)

– Two different geographic sources and rates of

flapping were attempted in order to ensure

propagation and thresholding did not reduce the

effectiveness (NYC and ORD, Quagga and JUNOS)

Page 23: BGP Prefix Hijack Defense at NANOG 46

Flapping: Results/Analysis

• Used BGP update data from Renesys Routing

Intelligence and its global peerset.

• Summary: This technique doesn’t work.

NANOG 46 – June 2009

• Summary: This technique doesn’t work.

– The rightful owner just becomes a big prefix

flapping jerk!

Page 24: BGP Prefix Hijack Defense at NANOG 46

Preliminary Analysis

NYC Defense ORD Defense

NANOG 46 – June 2009

Percentage of peers selecting:hijacked prefix (AS16842-P/24) in blue“real” prefix (AS33517-P/24) in yellowno prefix – withdrawn – in orange

Page 25: BGP Prefix Hijack Defense at NANOG 46

Deeper Analysis• Horizontal lines are individual peers.

• Each circle is an update.

• First slide shows the whole peer tableau, with

the “contested zone” on top, and the “closer

to the attacker zone” down below (never in

NANOG 46 – June 2009

to the attacker zone” down below (never in

play; note the lack of

withdrawals/dampening).

• Subsequent slides zero in on the contested

zone, where the defender has a chance.

Page 26: BGP Prefix Hijack Defense at NANOG 46

Peer

Initial hijackDefender responds

Steady State 1

First Trial Second Trial

Steady State 2

NANOG 46 – June 2009Time

Peer

Page 27: BGP Prefix Hijack Defense at NANOG 46

Defender responds, basins of attraction identified; steady state

Flapping! First Trial

NANOG 46 – June 2009Time

Page 28: BGP Prefix Hijack Defense at NANOG 46

Second Trial

(Steady State)

Flapping! Green circles are (rare) withdrawals.

On balance, blue circles (defender) are being turned into red circles (attacker), not dampened.

Remember, this is the defender's turf to lose (note steady state).

NANOG 46 – June 2009

Page 29: BGP Prefix Hijack Defense at NANOG 46

Conclusion

• The steady-state originator always has the

advantage (older route in tables)

• In this case, the defender has all the ground to

lose.

NANOG 46 – June 2009

• Duplicate originations help get some traffic

back.

• Flapping severely hurts the defenders attempt

to get traffic back.

Page 30: BGP Prefix Hijack Defense at NANOG 46

Open Questions

• Does anyone still flap dampen?

• Does this work at all?

• How much do you have to flap to keep it

working?

NANOG 46 – June 2009

working?

• Could this strategy be effective?

• Are we all insane for even thinking it would

work?

Page 31: BGP Prefix Hijack Defense at NANOG 46

Thank You

NANOG 46 – June 2009

James Cowie, Renesys

Tom Daly, Dynamic Network Services

Anton Kapela, Voxel

Todd Underwood, Google