79
Background TCP Idle Scan in IPv6 Implementation Conclusion TCP Idle Scans in IPv6 Mathias Morbitzer [email protected] Radboud University Nijmegen Fox-IT October 23rd, 2013 Mathias Morbitzer TCP Idle Scans in IPv6 1/34

TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer [email protected] Radboud University Nijmegen

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scans in IPv6

Mathias Morbitzer

[email protected]

Radboud University Nijmegen

Fox-IT

October 23rd, 2013

Mathias Morbitzer TCP Idle Scans in IPv6 1/34

Page 2: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

IPv4 Header

Mathias Morbitzer TCP Idle Scans in IPv6 2/34

Page 3: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

IPv4 Header

Mathias Morbitzer TCP Idle Scans in IPv6 2/34

Page 4: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP three way handshake

(a) Successful (b) Unsuccessful (c) Unexpected

Mathias Morbitzer TCP Idle Scans in IPv6 3/34

Page 5: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

Port scanning

Mathias Morbitzer TCP Idle Scans in IPv6 4/34

Page 6: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

Port scanning

Mathias Morbitzer TCP Idle Scans in IPv6 4/34

Page 7: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

Port scanning

Mathias Morbitzer TCP Idle Scans in IPv6 4/34

Page 8: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

Port scanning

Mathias Morbitzer TCP Idle Scans in IPv6 4/34

Page 9: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

Port scanning

Mathias Morbitzer TCP Idle Scans in IPv6 4/34

Page 10: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP Idle Scan

Mathias Morbitzer TCP Idle Scans in IPv6 5/34

Page 11: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP Idle Scan

Mathias Morbitzer TCP Idle Scans in IPv6 5/34

Page 12: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP Idle Scan

Mathias Morbitzer TCP Idle Scans in IPv6 5/34

Page 13: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP Idle Scan

Mathias Morbitzer TCP Idle Scans in IPv6 5/34

Page 14: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP Idle Scan

Mathias Morbitzer TCP Idle Scans in IPv6 5/34

Page 15: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

TCP Idle Scan

Mathias Morbitzer TCP Idle Scans in IPv6 5/34

Page 16: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

IPv4TCP three way handshakeTCP Idle Scan

Requirements for Idle host in IPv4

1 Predictable, global assignment of Identification value

2 Remain idle

Mathias Morbitzer TCP Idle Scans in IPv6 6/34

Page 17: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Map of the Internet - The IPv4 space, 2006

Mathias Morbitzer TCP Idle Scans in IPv6 7/34

Page 18: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

IPv6

128bit addresses instead of 32bit

Mathias Morbitzer TCP Idle Scans in IPv6 8/34

Page 19: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

IPv6

128bit addresses instead of 32bit

→ 340 undecillion, 282 decillion, 366 nonillion, 920 octillion, 938septillion, 463 sextillion, 463 quintillion, 374 quadrillion, 607 trillion,431 billion, 768 million, 211 thousand and 456 addresses

Mathias Morbitzer TCP Idle Scans in IPv6 8/34

Page 20: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

IPv4 vs IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 9/34

Page 21: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Fragmentation in IPv4

Mathias Morbitzer TCP Idle Scans in IPv6 10/34

Page 22: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Fragmentation in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 11/34

Page 23: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Fragmentation in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 11/34

Page 24: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Fragmentation in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 11/34

Page 25: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Fragmentation in IPv6

Extension header used when needed

Located between IPv6 and TCP header

Extension header for fragmentation / Fragmentation header:

Mathias Morbitzer TCP Idle Scans in IPv6 12/34

Page 26: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Extension header in all steps?

Mathias Morbitzer TCP Idle Scans in IPv6 13/34

Page 27: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Not in all...

Mathias Morbitzer TCP Idle Scans in IPv6 13/34

Page 28: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in steps 2 and 7

Directly participating in the conversation

Something where we send a lot, and get a lot back

Mathias Morbitzer TCP Idle Scans in IPv6 14/34

Page 29: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in steps 2 and 7

Directly participating in the conversation

Something where we send a lot, and get a lot back→ How about pings?

The data received in the ICMPv6 Echo Request messageMUST be returned entirely and unmodified in the ICMPv6Echo Reply message. (RFC 4443, ICMPv6)

If the Request is fragmented, the Reply will be fragmented too

Mathias Morbitzer TCP Idle Scans in IPv6 14/34

Page 30: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in steps 2 and 7

Mathias Morbitzer TCP Idle Scans in IPv6 15/34

Page 31: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in step 5

Mathias Morbitzer TCP Idle Scans in IPv6 16/34

Page 32: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in step 5

So we can manipulate another host’s Path MTU!

minimum IPv6 MTU: 1280 bytes

IPv6 + TCP header max 60 bytes

Let’s have a look at RFC 1981

Mathias Morbitzer TCP Idle Scans in IPv6 17/34

Page 33: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in step 5

When a node receives a Packet Too Big message, it MUSTreduce its estimate of the PMTU for the relevant path, based onthe value of the MTU field in the message

A node MUST NOT reduce its estimate of the Path MTU belowthe IPv6 minimum link MTU. Note: A node may receive aPacket Too Big message reporting a next-hop MTU that is lessthan the IPv6 minimum link MTU. In that case, the node is notrequired to reduce the size of subsequent packets sent on thepath to less than the IPv6 minimum link MTU, but rather mustinclude a Fragment header in those packets

(RFC 1981, Path MTU Discovery for IP version 6)

Mathias Morbitzer TCP Idle Scans in IPv6 18/34

Page 34: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in step 5

Mathias Morbitzer TCP Idle Scans in IPv6 19/34

Page 35: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Forcing fragmentation in step 5

Mathias Morbitzer TCP Idle Scans in IPv6 19/34

Page 36: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 37: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 38: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 39: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 40: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 41: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 42: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 43: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

The TCP Idle Scan in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 20/34

Page 44: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Requirements for Idle host in IPv4

1 Predictable, global assignment of Identification value

2 Remain idle

Mathias Morbitzer TCP Idle Scans in IPv6 21/34

Page 45: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Requirements for Idle host in IPv6

1 Predictable, global assignment of Identification value X

Mathias Morbitzer TCP Idle Scans in IPv6 22/34

Page 46: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Requirements for Idle host in IPv6

1 Predictable, global assignment of Identification value X

2 Remain idleDo not send fragmented packets

Mathias Morbitzer TCP Idle Scans in IPv6 22/34

Page 47: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Requirements for Idle host in IPv6Picture: http://2.bp.blogspot.com/_OIq8TLRb-Tk/THE2E1s_wkI/AAAAAAAAABQ/KCx-BkbezPs/s1600/huge+wave.jpg

Mathias Morbitzer TCP Idle Scans in IPv6 22/34

Page 48: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Behavior of different systems

# System Assignment of Identification

1 Android 4.1 (Linux 3.0.15) Per host, incremental (1)2 FreeBSD 7.4 Random3 FreeBSD 9.1 Random4 iOS 6.1.2 Random5 Linux 2.6.32 Per host, incremental (2)6 Linux 3.2 Per host, incremental (1)7 Linux 3.8 Per host, incremental8 OpenBSD 4.6 Random9 OpenBSD 5.2 Random10 OS X 10.6.7 Global, incremental (3)11 OS X 10.8.3 Random12 Solaris 11 Per host, incremental

(1) Hosts calculates wrong TCP checksum for routes with PMTU <1280(2) PMTU <1280 results in DoS(3) Does not accept PMTU <1280

Mathias Morbitzer TCP Idle Scans in IPv6 23/34

Page 49: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Behavior of different systems

# System Assignment of Identification

1 Android 4.1 (Linux 3.0.15) Per host, incremental (1)2 FreeBSD 7.4 Random3 FreeBSD 9.1 Random4 iOS 6.1.2 Random5 Linux 2.6.32 Per host, incremental (2)6 Linux 3.2 Per host, incremental (1)7 Linux 3.8 Per host, incremental8 OpenBSD 4.6 Random9 OpenBSD 5.2 Random10 OS X 10.6.7 Global, incremental (3)11 OS X 10.8.3 Random12 Solaris 11 Per host, incremental13 Windows Server 2003 R2 Standard 64bit, SP2 Global, incremental14 Windows Server 2008 Standard 32bit, SP1 Global, incremental15 Windows Server 2008 R2 Standard 64bit, SP1 Global, incremental by 216 Windows Server 2012 Standard 64bit Global, incremental by 217 Windows XP Professional 32bit, SP3 Global, incremental18 Windows Vista Business 64bit, SP1 Global, incremental19 Windows 7 Home Premium 32bit, SP1 Global, incremental by 220 Windows 7 Ultimate 32bit, SP1 Global, incremental by 2

(1) Hosts calculates wrong TCP checksum for routes with PMTU <1280(2) PMTU <1280 results in DoS(3) Does not accept PMTU <1280

Mathias Morbitzer TCP Idle Scans in IPv6 24/34

Page 50: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Identification value of Windows 8

Also predictable in Windows 8?

Mathias Morbitzer TCP Idle Scans in IPv6 24/34

Page 51: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Behavior of different systems# System Assignment of Identification

1 Android 4.1 (Linux 3.0.15) Per host, incremental (1)2 FreeBSD 7.4 Random3 FreeBSD 9.1 Random4 iOS 6.1.2 Random5 Linux 2.6.32 Per host, incremental (2)6 Linux 3.2 Per host, incremental (1)7 Linux 3.8 Per host, incremental8 OpenBSD 4.6 Random9 OpenBSD 5.2 Random10 OS X 10.6.7 Global, incremental (3)11 OS X 10.8.3 Random12 Solaris 11 Per host, incremental13 Windows Server 2003 R2 Standard 64bit, SP2 Global, incremental14 Windows Server 2008 Standard 32bit, SP1 Global, incremental15 Windows Server 2008 R2 Standard 64bit, SP1 Global, incremental by 216 Windows Server 2012 Standard 64bit Global, incremental by 217 Windows XP Professional 32bit, SP3 Global, incremental18 Windows Vista Business 64bit, SP1 Global, incremental19 Windows 7 Home Premium 32bit, SP1 Global, incremental by 220 Windows 7 Ultimate 32bit, SP1 Global, incremental by 221 Windows 8 Enterprise 32 bit Global, incremental by 2

(1) Hosts calculates wrong TCP checksum for routes with PMTU <1280(2) PMTU <1280 results in DoS(3) Does not accept PMTU <1280

Mathias Morbitzer TCP Idle Scans in IPv6 25/34

Page 52: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Defense Mechanisms

Prevent IP-Spoofing(Reverse Path Forwarding, Network Ingress Filtering, ...)

Stateful firewalls

Random assignment of Identification value

Mathias Morbitzer TCP Idle Scans in IPv6 26/34

Page 53: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

FragmentationForcing fragmentationTCP Idle Scan in IPv6RequirementsBehavior of different systems

Defense Mechanisms

Mathias Morbitzer TCP Idle Scans in IPv6 27/34

Page 54: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

How Nmap does itTCP Idle Scan in IPv6 with Nmap

Implementation

Nmap implementation of TCP Idle Scan in IPv6

8.13s to scan 1000 ports in IPv6

Mathias Morbitzer TCP Idle Scans in IPv6 28/34

Page 55: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

How Nmap does itTCP Idle Scan in IPv6 with Nmap

Implementations

Nmap implementation of TCP Idle Scan in IPv6

8.13s to scan 1000 ports in IPv68.06s to scan 1000 ports in IPv4

Mathias Morbitzer TCP Idle Scans in IPv6 28/34

Page 56: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

How Nmap does itTCP Idle Scan in IPv6 with Nmap

Implementations

Nmap implementation of TCP Idle Scan in IPv6

8.13s to scan 1000 ports in IPv68.06s to scan 1000 ports in IPv4→ loss of less than 1% performance while having less requirements

Mathias Morbitzer TCP Idle Scans in IPv6 28/34

Page 57: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

How Nmap does itTCP Idle Scan in IPv6 with Nmap

Implementations

Nmap implementation of TCP Idle Scan in IPv6

8.13s to scan 1000 ports in IPv68.06s to scan 1000 ports in IPv4→ loss of less than 1% performance while having less requirements

Soon to be in the official release

Mathias Morbitzer TCP Idle Scans in IPv6 28/34

Page 58: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Conclusion

Lessons learned: None?

Danger of predictable IDs shown in 1985 (TCP)

Mathias Morbitzer TCP Idle Scans in IPv6 29/34

Page 59: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Conclusion

Lessons learned: None?

Danger of predictable IDs shown in 1985 (TCP)

Proven with the TCP Idle Scan in 1998 (IPv4)

Mathias Morbitzer TCP Idle Scans in IPv6 29/34

Page 60: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Conclusion

Lessons learned: None?

Danger of predictable IDs shown in 1985 (TCP)

Proven with the TCP Idle Scan in 1998 (IPv4)

Feasible again in IPv6 in 2013!

Mathias Morbitzer TCP Idle Scans in IPv6 29/34

Page 61: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Conclusion

DO NOT USE PREDICTABLE IDs,

GODDAMNIT!

Mathias Morbitzer TCP Idle Scans in IPv6 30/34

Page 62: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

QuestionsPicture: http://www.hdallwallpapers.com/wp-content/uploads/2013/08/despicable_me_2_minion-1600x1200.jpg

Mathias Morbitzer TCP Idle Scans in IPv6 31/34

Page 63: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scan in IPv6 with Nmap

Mathias Morbitzer TCP Idle Scans in IPv6 32/34

Page 64: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scan in IPv6 with Nmap

Mathias Morbitzer TCP Idle Scans in IPv6 32/34

Page 65: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scan in IPv6 with Nmap

Mathias Morbitzer TCP Idle Scans in IPv6 32/34

Page 66: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scan in IPv6 with Nmap

Mathias Morbitzer TCP Idle Scans in IPv6 32/34

Page 67: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scan in IPv6 with Nmap

Mathias Morbitzer TCP Idle Scans in IPv6 32/34

Page 68: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

TCP Idle Scan in IPv6 with Nmap

Mathias Morbitzer TCP Idle Scans in IPv6 32/34

Page 69: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 33/34

Page 70: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 33/34

Page 71: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 33/34

Page 72: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 33/34

Page 73: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 33/34

Page 74: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 33/34

Page 75: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 34/34

Page 76: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 34/34

Page 77: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 34/34

Page 78: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 34/34

Page 79: TCP Idle Scans in IPv6 - Hack.luarchive.hack.lu/2013/tcp_idle_scans_ipv6.pdf · 2013-10-28 · TCP Idle Scans in IPv6 Mathias Morbitzer m.morbitzer@runbox.com Radboud University Nijmegen

BackgroundTCP Idle Scan in IPv6

ImplementationConclusion

Find the open port

Mathias Morbitzer TCP Idle Scans in IPv6 34/34