Transcription

1 Multipath TCP Breaking today's networks with tomorrow's protocol

2 Speakers - Who are we? Catherine (Kate) Pearce Security Consultant / Pentester Loves her wine the way she likes her RFCs (Dry) New Zealand transplant Patrick Thomas Senior Security Consultant / Pentester Application Security focus 2

3 MPTCP changes fundamental assumptions about how TCP works* Use it to break things today Adapt to it for tomorrow 3

4 *Well kinda Not Layer 4? Totally the same. Layer 4? Buckle Up. 4

5 2 Simple Examples: #1 5

6 2 Simple Examples: #1 6

7 2 Simple Examples: #1 Wait, What!?!! 7

8 2 Simple Examples: #1 Wait, What!?!! 8

9 2 Simple Examples: #2 9

10 2 Simple Examples: #2 Err? 10

11 11 Sense This makes none

12 Why did we see that? Let s talk about MPTCP but first, why change TCP? 12

13 Current TCP is rather limited Doesn t support use cases for: High Availability Link Aggregation Multihoming Mesh networking 13

14 Multipath TCP Multipath TCP is an extension to TCP that adds the above functionality AND: it works over existing infrastructure (it IS TCP just more so) BUT: nothing much else understands it including security tools 14

15 MPTCP Basic Use Cases Client Server Network A Network B For seamless roaming For high availability 15

16 TO BE CLEAR: MPTCP is more culture shock than security vulnerability We like MPTCP We want MPTCP to succeed Network security isn t ready 16

17 Background Technical Introduction Key Security Effects Perimeter Security Network Management MPTCP Future 17

18 What got me thinking about this? I saw this 18

19 What got me thinking about this? Which led to this 19

20 What got me thinking about this? Which contained this 20

21 What got me thinking about this? Then other media outlets started covering it 21

22 What got me thinking about this? Then other media outlets started covering it not always positively 22

23 What got me thinking about this? And then SILENCE BUT, the rate of progress was unprecedented for a major change to TCP 23

24 Was anyone thinking about security? The security of MPTCP itself What changes like this could mean for network security not so much 24

25 That s what this session is about What does multipath TCP mean for security today? What could it (or similar tech) mean to network security a decade from now? With a couple of attacks and tools 25

26 Background Technical Introduction Key Security Effects Perimeter Security Network Management MPTCP Future 26

27 Motivations and Advantages TCP implements connections between IP:PORT & IP:PORT NOT between endpoint A and endpoint B In the past this was a distinction without a difference, but not any more 27

28 MPTCP Characteristics Backwards compatibility Performance >= now Security >= now 28

29 Riding on top of TCP An MPTCP Connection is defined by a connection ID It is comprised of multiple streams, where each stream is a regular TCP connection (with an option strapped on) 29

30 MPTCP Simple Case Client Server Network A MPTCP connection looks like TCP so far 30

31 MPTCP Simple Case Client Server Network A Network B N different TCP connections, contributing to ONE logical data flow 31

32 MPTCP Simple Case Client Server DATA[0] Network A DATA[1] DATA[2] Network B N different TCP connections, contributing to ONE logical data flow data flows through any/all 32

33 MPTCP Simple Case Client Server DATA[0] Network A DATA[1] DATA[2] Network B Sender of a packet can choose to use any flow (this will be important) 33

34 MPTCP Simple Case Client Server Network A DATA[3] Network B Any subset of connections can drop, overall flow continues. 34

35 MPTCP Simple Case Client Server Network A Network B Connections can be re-added at any time 35

36 MPTCP Simple Case Client Server Network A DATA[4] DATA[4] Network B DATA[4] ACK Un-ACK d data can be quickly resent over a different flow first ACK is good enough! 36

37 How is MPTCP implemented? TCP Option 37

38 What does it look like? Packet Breakdown - WireShark [WireShark / TCPdump Capture screenshot] Option 30 (0x1E) TCP Options field 38

39 How is MPTCP implemented? MPTCP Subtypes 8 currently defined (ones relevant in bold) MP_CAPABLE - Signals MPTCP support ADD_ADDR - This address is also a way to reach me MP_JOIN - Add incoming subflow to the connection REMOVE_ADDR - Please stop using [address] to reach me DSS - How to map this stream s data against the overall data flow MP_PRIO MP_FAIL MP_FASTCLOSE 39

40 Path Management - Linux The Linux Path Manager has two primary path managers at present Fullmesh n:n (all to all) Ndiffports 1-1 interfaces, n-1 ports This is in the TCP stack application layers get MPTCP for free (mostly) 40

41 Path Management - ndiffports Client Server N = 1 N = 2 N = 3 N different source ports, 1 destination port 41

42 Path Management - fullmesh Client Server All possible paths used 42

43 Deeper technical details TCP Handshake with additional details Data sequence numbering Truncation of SHA1 of host key Authentication MP_JOIN - Challenge-response HMAC of other host s key, Nonce, AddressID MP_FASTCLOSE Other party s key in plaintext Routing More on this later Packet sender decides which data goes down which path 43

44 Release Item #1 - Cheatsheet 44

45 So who s using it? Nearly no one is using it large scale (yet), with a few exceptions Apple (Siri) Some other experimental stuff? Given that, there s a surprising number of implementations Implementations available for several OS s (including Linux, BSD, Android), and baked in some way into commercial kit ( ) NOT Windows 45

46 Availability Getting it working Linux Linux reference implementation via apt-get (multipath-tcp.org) -- best way right now Can work in Kali, but challenges Nicolas Maître made a ridiculously useful, near complete, SCAPY implementation We re based some tools on this code, and fixed some bugs along the way 46

47 Background Technical Introduction Key Security Effects Perimeter Security Network Management MPTCP Future 47

48 MPTCP s Key Security Effects Cross-path traffic fragmentation That s the whole point! Moving target Ability to change source and destination addresses in the middle of a connection Connection Resilience Has additional checksums that require capture of the initial packet to reliably fake Until every subflow is dead the overall connection keeps going Reverse connections 48

49 Because of these Cross-path Moving target Connection Resilience Reverse connections if your approach to security requires any of these See all app layer data in a TCP stream Differentiate clients from servers based on connection direction Tamper with or close "bad" connections mid-stream Associate logical sessions to IP addresses then something is probably going to break 49

50 How practical are these attacks? Today? Extremely. But only if both endpoints speak MPTCP Of which there aren t many. Yet. In an MPTCP world, a bit less But we have to change the way we do things in network security 50

51 MPTCP s Key Security Effects All of those things can be partially mitigated with MPTCP aware infrastructure and security tools. But overall, there remain some interesting shifts in how network flows work especially if we go in with well meaning intent 51

52 MPTCP s Key Security Effects A few slides back The packet sender decides which data goes down which path. Normal/benign clients won t choose pathological fragmentation schemes But there s nothing stopping us 52

53 Release Item #2: PoC tool for MPTCP IDS Evasion Demo! 53

54 Background Technical Introduction Key Security Effects Perimeter Security Network Management MPTCP Future 54

55 MPTCP and Firewalls MPTCP changes things for perimeters How d you like an outbound incoming connection? 55

56 Client MPTCP and Firewalls Firewall 1. SYN (MP_CAPABLE) Server MPTCP connection looks like TCP so far 56

57 Client MPTCP and Firewalls Firewall Server 2. SYN, ACK (MP_CAPABLE) Still seems pretty standard, albeit with extra TCP OPTIONS 57

58 Client MPTCP and Firewalls Firewall Server 3. ACK OK, so it s a TCP connection with an additional options so what? 58

59 Client MPTCP and Firewalls Firewall Server Pre-established MPTCP Connection 4. ADD_ADDR (IP#2) Well, what if the client tells the server about a new address? 59

60 Client MPTCP and Firewalls Firewall Server 4. ADD_ADDR (IP#2) Pre-established MPTCP Connection Now, the Internal host may set up a connection to the advertised address 60

61 Client MPTCP and Firewalls Firewall Server Pre-established MPTCP Connection 5. SYN (MP_JOIN) Is this new connection incoming or outgoing? 61

62 Client MPTCP and Firewalls Firewall Server Pre-established MPTCP Connection 5. SYN (MP_JOIN) Is this new connection incoming or outgoing? 62

63 Client MPTCP and Firewalls Firewall Server Pre-established MPTCP Connection 5. SYN (MP_JOIN) Is this new connection incoming or outgoing? 63

64 Background Technical Introduction Key Security Effects Perimeter Security Network Management MPTCP Future 64

65 MPTCP and Network monitoring If tool doesn t understand MPTCP, flows look like unrelated TCP streams 65

66 What does it look like? On the network: If you don t understand Each yellow blob is actually part of an address label 66

67 What does it look like? On the network: If you don t understand it, but you cluster IPs 67

68 What does it look like? On the network: If you do understand But you can only do this when you can see & correlate all related flows 68

69 MPTCP Defense - Awareness People Technology Check support Look for use Architecture Terminate it where you terminate SSL 69

70 Release Item #3 - MPTCP Scanner 70

71 Release Item #3 - Scanner Accomplishes three things Test device for apparent support Test for actual support (as opposed to repeating the option blindly) Test network path allows it to get there 71

72 Scanning Host MPTCP Scanner Target Host 1. SYN (MP_CAPABLE) Send an MP_CAPABLE syn 72

73 Scanning Host MPTCP Scanner Target Host 2. SYN, ACK (MP_CAPABLE) We got an MP_CAPABLE response.. But is it genuine? 73

74 Scanning Host MPTCP Scanner Target Host 3. SYN (MP_JOIN[Random]) Send a join to an invalid connection ID 74

75 MPTCP Scanner Scanning Host Target Host 4. Either (RST) or (SYN,ACK) An MPTCP host will RST an invalid join, An ACK reply indicates TCP only 75

76 MPTCP Stripping Transparent proxy on primary path Either no MPTCP support, or only on the one interface Firewall rules: strip-options 30 - iptables, tcp-options clear - Cisco IOS 76

77 MPTCP and Active Network Security To track & modify MPTCP, you must 1. Capture the initial handshake 2. Perform non-trivial calculations to determine Connection membership Correct checksum or modified traffic 77

78 Background Technical Introduction Key Security Effects Perimeter Security Network Management MPTCP Future 78

79 MPTCP and Privacy MPTCP shifts power towards endpoints, and away from infrastructure & ISP s I don t trust my ISP or Cellular company But they probably don t trust each other either! 79

80 The MPTCP Future How do we gain these advantages securely when most things support MPTCP? Some changes still need to be made Some things will never be the same 80

81 Future Collaborative/Probabilistic IDS Client Server AC SEND ABCD BD IDS RECV ABCD How can the IDS make sense of traffic if it can only ever see fragments? 81

82 The MPTCP Future What will change in a multipath future that simply cannot work with most existing security models? Split trust crypto Multipath agility Some research into privacy effects already underway 82

83 Other Ideas Making proxy tools to undertake these attacks Stream hopping (ala FHSS) Mixing it with TOR Building distributed networks on MPTCP-like packets Hijack connections on fastclose 83

84 Conclusions Multipath communications are awesome, and they re coming Multipath communication confounds business & security models relying on inspection Now is the time for network security to prepare 84

85 Participation/Competition PCAP #BHMPTCP Also see our workshop at DEFCON s Wall of Sheep (Sunday) 85

86 Catherine Questions? Patrick Downloads on Github: More stuff will be 86

87 References 1 Implementations & vendors Linux (UCLouvain, multipath-tcp.org) ( ) MPTCP Scapy - BSD - Android - Apple /bsd/netinet/mptcp* Cisco - MPTCP Security IETF MPTCP workinggroup - Threat Analysis for TCP Extensions for Multipath Operation with Multiple Addresses - Ford, A. (2010), 'Multipath TCP Security Issues : Current Solution Space Why we need security'. Zhuang, R Investigating the Application of Moving Target Defenses to Network Security. ISRCS, th International Symposium on. Available at 87

88 References 2 Theroretical backgrounds Stability issues - Kelly, F. & Voice, T., Stability of end-to-end algorithms for joint routing and rate control. ACM SIGCOMM Computer Communication Review, 35(2), pp Routing and congestion control - Key, P., Massoulié, L. & Towsley, D., Combining multipath routing and congestion control for robustness. In Information Sciences and Systems, th Annual Conference on. IEEE, pp Honda, M., Nishida, Y. & Raiciu, C., Is it still possible to extend TCP? Proc., p.181. Available at: MPTCP Background & development: Raiciu, C. et al., How hard can it be? designing and implementing a deployable multipath TCP. NSDI, (1). Available at: ACM Queue - Multipath TCP, Decoupled from IP, TCP is at last able to support multihomed hosts - Christoph Paasch and Olivier Bonaventure, UCL - IETF Working group - IANA TCP Options

89 Other References 3 Multi Network Manager - Evensen, K.R. MULTI Network Manager (MNM), See the Whitepaper for MANY more references 89