Security Assessments of IPv6 Networks and Firewalls



Similar documents
Recent Advances in IPv6 Security. Fernando Gont

IPv6 Network Reconnaissance:

IPv6 Network Reconnaissance:

Practical Security Assessment of IPv6 Networks and Devices. Fernando Gont

Recent advances in IPv6 insecurities Marc van Hauser Heuse Deepsec 2010, Vienna Marc Heuse

OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS

Security Implications of the Internet Protocol version 6 (IPv6)

Vulnerabili3es and A7acks

IPv6 Security Analysis

IPv6 Security Best Practices. Eric Vyncke Distinguished System Engineer

IPv6 Hardening Guide for Windows Servers

IP(v6) security. Matěj Grégr. Brno University of Technology, Faculty of Information Technology. Slides adapted from Ing.

About the Technical Reviewers

INLICHTINGEN DIENSTEN INLICHTINGEN DIENSTEN

Introduction to IP v6

Security of IPv6 and DNSSEC for penetration testers

Getting started with IPv6 on Linux

Security Assessment of Neighbor Discovery for IPv6

IPv6 Infrastructure Security

IPv6 Security Assessment and Benchmarking Abstract Test Suite

IPv6 Security. Scott Hogg. Global Technology Resources, Inc. Director of Technology Solutions CCIE #5133, CISSP #4610

IPV6 流 量 分 析 探 讨 北 京 大 学 计 算 中 心 周 昌 令

IPv6 Security. Scott Hogg, CCIE No Eric Vyncke. Cisco Press. Cisco Press 800 East 96th Street Indianapolis, IN USA

The Truth about IPv6 Security

IPv6 Trace Analysis using Wireshark Nalini Elkins, CEO Inside Products, Inc.

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

IPv6.marceln.org.

IPv6 Fundamentals: A Straightforward Approach

IPv6 Security from point of view firewalls

Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik

Presentation_ID. 2001, Cisco Systems, Inc. All rights reserved.

Supporting Document Mandatory Technical Document. Evaluation Activities for Stateful Traffic Filter Firewalls cpp. February Version 1.

1. Firewall Configuration

ICSA Labs Network Protection Devices Test Specification Version 1.3

Security Technology White Paper

IPv6 Associated Protocols

Internet Firewall CSIS Internet Firewall. Spring 2012 CSIS net13 1. Firewalls. Stateless Packet Filtering

IPv6 Addressing and Subnetting

Strategies to Protect Against Distributed Denial of Service (DD

IPv6 Network Security.

Stateful Firewalls. Hank and Foo

IPv6 Infrastructure Security Jeffrey L Carrell Network Conversions Network Security Consultant, IPv6 SME/Trainer

Testing IPv6 Firewalls with ft6

Innominate mguard Version 6

Vanguard Applications Ware IP and LAN Feature Protocols. Firewall

FIREWALLS. Firewall: isolates organization s internal net from larger Internet, allowing some packets to pass, blocking others

Classic IOS Firewall using CBACs Cisco and/or its affiliates. All rights reserved. 1

DATA COMMUNICATIONS MANAGEMENT. Gilbert Held INSIDE

Brocade NetIron Denial of Service Prevention

Denial of Service Attacks

co Characterizing and Tracing Packet Floods Using Cisco R

Chapter 3 Configuring Basic IPv6 Connectivity

Security with IPv6 Explored. U.S. IPv6 Summit Renée e Esposito Booz Allen Hamilton Richard Graveman RFG Security

CloudEngine Series Switches. IPv6 Technical White Paper. Issue 01 Date HUAWEI TECHNOLOGIES CO., LTD.

Introduction of Intrusion Detection Systems

Some insights about the recent TCP DoS (Denial of Service) vulnerabilities

IPv6 Intrusion Detection Research Project

Joe Davies. Principal Writer Windows Server Information Experience. Presented at: Seattle Windows Networking User Group June 1, 2011

IPv6 Diagnostic and Troubleshooting

Security Impacts of Abusing IPv6 Extension Headers

Eric Vyncke, Distinguished Engineer, 2011 Cisco and/or its affiliates. All rights reserved. Cisco Public 1

Firewalls Netasq. Security Management by NETASQ

How To Connect Ipv4 To Ipv6 On A Ipv2 (Ipv4) On A Network With A Pnet 2.5 (Ipvin4) Or Ipv3 (Ip V6) On An Ipv5

IPv6 Security ::/0. Poland MUM Warsaw March, 2012 Eng. Wardner Maia Brazil

Host Configuration (Linux)

IPV6 FRAGMENTATION. The Case For Deprecation. Ron Bonica NANOG58

20-CS X Network Security Spring, An Introduction To. Network Security. Week 1. January 7

IPv4 and IPv6 Integration. Formation IPv6 Workshop Location, Date

IPv6 Security Nalini Elkins, CEO Inside Products, Inc.

Strategies to Protect Against Distributed Denial of Service (DDoS) Attacks

Internet Protocol Version 6 (IPv6)

Denial of Service Attacks. Notes derived from Michael R. Grimaila s originals

INTRODUCTION TO FIREWALL SECURITY

Internet Protocol: IP packet headers. vendredi 18 octobre 13

Types of IPv4 addresses in Internet

Network Security TCP/IP Refresher

Dos & DDoS Attack Signatures (note supplied by Steve Tonkovich of CAPTUS NETWORKS)

Moonv6 Test Suite. IPv6 Firewall Functionality and Interoperablility Test Suite. Technical Document. Revision 0.6

Chapter 8 Security Pt 2

Vicenza.linux.it\LinuxCafe 1

The ntop Project: Open Source Network Monitoring

IP Address Classes (Some are Obsolete) Computer Networking. Important Concepts. Subnetting Lecture 8 IP Addressing & Packets

Best Practices Guide: Vyatta Firewall. SOFTWARE-BASED NETWORKING & SECURITY FROM VYATTA February 2013

Matt Ryanczak Network Operations Manager

Federal Computer Incident Response Center (FedCIRC) Defense Tactics for Distributed Denial of Service Attacks

A S B

Introduction to Cisco IOS Flexible NetFlow

Telematics. 9th Tutorial - IP Model, IPv6, Routing

Firewalls. Pehr Söderman KTH-CSC

Abstract. Introduction. Section I. What is Denial of Service Attack?

Are You Ready to Teach IPv6?

The State of OpenFlow: Advice for Those Considering SDN. Steve Wallace Executive Director, InCNTRE SDN Lab Indiana University

Transcription:

Security Assessments of IPv6 Networks and Firewalls Fernando Gont Marc Heuse IPv6 Kongress 2013 Frankfurt, Germany. June 6-7, 2013

About Fernando Gont Security researcher and consultant at SI6 Networks Have worked on security assessment on communications protocols for: UK NISCC (National Infrastructure Security Co-ordination Centre) UK CPNI (Centre for the Protection of National Infrastructure) Active participant at the IETF (Internet Engineering Task Force) More information available at: http://www.gont.com.ar

About Marc Heuse Independent security researcher and consultant Worked at SuSE (Linux), KPMG, n.runs Founder of The Hacker s Choice (www.thc.org) Author of many public security tools like thc-ipv6, hydra, amap, THC- Scan, SuSEfirewall 1 + 2, etc. More information at: www.mh-sec.de

Agenda TCP Tests Implemtation Tests Fragmentation Tests Real Life Tests: Firewall Addressing Statistics Network Scanning Host Tracking Conclusions

THC-IPv6 Toolkit: Introduction First IPv6/ICMPv6 attack toolkit for many years Powerful attacks Only minimal IPv6 knowledge required Easy to use Only runs on Linux with Ethernet Rudimentary documentation Free software Available at: www.thc.org/thc-ipv6

SI6 Networks' IPv6 Toolkit: Introduction For ages, THC's IPv6 attack suite (http://www.thc.org) has been the only publicly-available IPv6 security toolkit We've produced SI6 Networks' IPv6 toolkit SI6 Networks' IPv6 Toolkit goals: Security analysis and trouble-shooting of IPv6 networks and implementations Clean, portable, and secure code Good documentation Free software Available at: http://www.si6etworks.com/tools/ipv6toolkit

SI6 Networks' IPv6 Toolkit: Tools ns6 na6 rs6 ra6 addr6 rd6 scan6 frag6 tcp6 icmp6 ni6 flow6 jumbo6

Assessing Implementations

IPv6 Fragmentation Assessing Implementations

IPv6 Fragmentation: Overview IPv6 fragmentation performed only by hosts (never by routers) Fragmentation support implemented in Fragmentation Header 8 bits 8 bits 13 bits 2b 1b Next Header Reserved Fragment Offset Res M Identification Where: Fragment Offset: Position of this fragment with respect to the start of the fragmentable part M: More Fragments, as in IPv4 Identification : Identifies the packet (with Src IP and Dst IP)

Predictable fragment Identification values Security implications known from the IPv4 world: idle-scanning DoS attacks (fragment ID collisions) Discussed in IETF I-D: draft-ietf-6man-predictable-fragment-id The frag6 tool can assess the Fragment ID generation policy: # frag6 -i eth0 -v --frag-id-policy -d fc00:1::1

What some popular IPv6 stacks do Operating System Algorithm FreeBSD 9.0 Randomized NetBSD 5.1 Randomized OpenBSD-current Randomized (based on SKIPJACK) Linux 3.0.0-15 Predictable (GC init. to 0, incr. by +1) Linux-current Unpredictable (PDC init. to random value) Solaris 10 Predictable (PDC, init. to 0) Windows 7 Home Prem. Predictable (GC, init. to 0, incr. by +2) GC: Global Counter PDC: Per-Destination Counter

IPv6 fragment reassembly Security implications of overlapping fragments well-known (think Ptacek & Newsham, etc,) Nonsensical for IPv6, but originally allowed in the specs Different implementations allow them, with different results RFC 5722 updated the specs, forbidding overlapping fragments Assess the fragment reassembly policy of a target with: # frag6 -i IFACE -v --frag-reass-policy -d TARGET (Results for some popular implementations available at: http://blog.si6networks.com)

TCP-based Attacks Porting TCP-based attacks to the IPv6 world

IPv6-based TCP SYN-floods tcp6 is a very flexible tool for sending IPv6-based TCP segments A TCP SYN-flood attack can be performed with: # tcp6 -i IFACE -s SRCPRF -d TARGET -a DSTPORT -X S \ -F 100 -l -z 1 -v

Real Life Test Results Die, firewalls, die!

Kids

Router Advertisement Flooding Flood FW with random Ras (prefix or route information) DOS: Cisco IOS+ASA (fixed) Juniper Netscreen

ICMPv6 Multicast Support Flooding Flood FW with random ICMPv6 MLD Router and MLD Reports. DOS: Juniper Netscreen

Zyxel: Fragmentation == Established TCP SYN, Port 22 TCP SYN, Port 22 RULE CHANGE! FRAG + TCP SYN, Port 22 Zyxel does not consider this a bug (unfixed)

Astaro: I need lots of memory FRAG ID A, Offset 0 FRAG ID A, Offset 20.000 FRAG ID A, Offset 60.000 FRAG ID B, Offset 0 FRAG ID B, Offset 20.000 FRAG ID B, Offset 60.000 FRAG ID C, Offset 0 FRAG ID C, Offset 20.000 FRAG ID C, Offset 60.000

Cisco ICMP ACL Bypass ACL ICMP6 Ping ICMP6 Ping with Router Alert ICMP6 Pong! Still unfixed but in the making

More! CVE SYSTEM PROBLEM CVE-2004-0592 Linux Denial of service via IPv6 + TCP header large option length CVE-2006-4572 Linux Bypass rules by using an extension header CVE-2007-1497 Linux Bypass rules due fragmentation states errors CVE-2008-3816 Cisco ASA Denial of service via unspecified IPv6 packet CVE-2009-0687 OpenBSD Denial of service when IPv4 + ICMPv6 packet CVE-2009-4913 Cisco ASA Bypass rules by unknown IPv6 based packets CVE-2011-0393 Cisco ASA Denial of service with IPv6 traffic if IPv6 is not configured CVE-2011-3296 CVE-2012-3058 Cisco FWSM Denial of service with IPv6 Syslog messages CVE-2012-1324 Cisco IOS Denial of service with IPv6 traffic into firewall zones with IPS CVE-2012-2744 Linux Denial of service with fragmented IPv6 packets CVE-2012-4444 Linux Bypass rules via overlapping fragments

?! Juniper SRX Fortinet Checkpoint Juniper Netscreen Linux Cisco Zyxel

Oh, rly?

The Candidates! X

USGv6

What should a firewall do for IPv6? Correct handling of IPv6, Extension Headers and ICMPv6 Check Extension Headers Filter Extension Headers Handle Fragmentation securely Handle ICMPv6 stateful Filter invalid source addresses Check Extension Header Options Filter Extension Header Options No rule bypass due Fragmentation No rule bypass due Extension Headers Check for harmful ICMPv6 content

Test Setup sniff here!

YES Please do this at home!

Filter bypass due EH and/or Fragmentation Test bypass techniques to open port: firewall6 eth0 2001:db8:2::2 80 Test bypass techniques to filtered port: firewall6 eth0 2001:db8:2::2 22

Test results All pass

ICMPv6 & Extension Header support implementation6 p eth0 2001:db8:2::2

Test results (Default settings) Cisco only Source Routing Option is dropped all extension header pass Fortinet all extension header pass Source Routing Option is not dropped Juniper only Source Routing Option is dropped all extension header pass all ICMPv6 packets get through (erroneous objects)

Fragmentation Resource Issues CPU/RAM exhaustion tests: for TEST in `seq 1 33`; do timeout s KILL 60 \ fragmentation6 p -f eth0 \ 2001:db8:2::2 $TEST done

Test results All are shaky, showing small/medium impact on packet forwarding

Testing anti-spoofing protection Network vendors call this the RPF check thcping6 eth0 2001:db8:2::a 2001:db8:2::2

Test results Fortinet does not filter the spoofed packets!

Stateful ICMPv6 TooBig messages not belonging to a connection: toobig6 -u eth0 2001:db8:1::3 \ 2001:db8:2::2 1280

Test results Juniper does not filter the spoofed packet! (same erroneous defaults)

Harmful ICMPv6 packet contents TooBig message with impossible small or large values: toobig6 eth0 2001:db8:1::2 \ 2001:db8:2::2 48 toobig6 eth0 2001:db8:1::2 \ 2001:db8:2::2 100000

Test results All let this pass

NDP Exhaustion Tests Perform NDP Exhaustion attacks with ICMPv6 TooBig and EchoRequest: ndpexhaust26 -c r eth0 2001:db8:2:: ndpexhaust26 -c r -p eth0 \ 2001:db8:2::

Test results Fortinet & Cisco get 100% CPU (also after doing vendor recommended settings)

SYN Flooding Tests Send SYN packets to port 80 and random ports, send SYN-ACK to random ports, send ACK packets to port 80: thcsyn6 eth0 2001:db8:2::2 80 thcsyn6 eth0 2001:db8:2::2 x thcsyn6 S eth0 2001:db8:2::2 x thcsyn6 A eth0 2001:db8:2::2 80

Test results All get 100% CPU (also after doing vendor recommended settings)

At some point in the test: lost all IPv6 filter rules, defaulted to open, not visible in GUI

In Conclusion

More tests: Remote for TEST in X s 80 0 1; do fuzz_ip6 -x -n 3 -DFHIR -$TEST eth0 2001:db8:2::2 done randicmp6 eth0 2001:db8:2::2

More tests: Local for TEST in X `seq 0 9`; do fuzz_ip6 -x -n 3 -DFHIR -$TEST eth0 fe80::1 (FW-LL) done dos-new-ip6 eth0 flood_router26 -R eth0 flood_router26 -P eth0 flood_router26 -s -R eth0 flood_router26 -s -P eth0 flood_advertise6 eth0 fe80::1 (FW-LL) flood_solicitate6 eth0 fe80::1 (FW-LL) flood_mld26 eth0 flood_mldrouter6 eth0

IPv6 Addressing Analyzing IPv6 Addresses

Analyzing IPv6 Address Types The addr6 tool can analyze IPv6 addresses Example: addr6 -a ADDRESS Format: type=subtype=scope=iid_type=iid_subtype

Filtering IPv6 addresses When assessing networks, lists of IPv6 are produced Not all addresses in the list might be useful It is may be useful to filter a group of IPv6 addresses: Remove duplicates from a list Remove addresses that do not belong to a specific prefix Obtain addresses of a specific scope etc.

Filtering IPv6 addresses (II) Remove duplicate addresses: cat LIST.TXT addr6 -i -q Accept (or block) specific prefixes: cat LIST.TXT addr6 --accept PREFIX Accept (or block) address types: cat LIST.TXT addr6 --accept-type TYPE Types: unicast, unspec, multicast

Filtering IPv6 addresses (III) Accept (or block) address scopes: cat LIST.TXT addr6 --accept-scope SCOPE Scopes: interface, link, admin, site, local, global... Accept (or block) unicast address types: cat LIST.TXT addr6 --accept-utype TYPE Types: loopback, ipv4-compat, ipv4-mapped, link-local, site-local, unique-local, 6to4, teredo, global Accept (or block) IID types: cat LIST.TXT addr6 --accept-iid TYPE Types: ieee, isatap, ipv4-32, ipv4-64, ipv4, embed-port, embedport-rev, embed-port-all, low-byte, byte-pattern, random

Producing statistics The addr6 tool can produce statistics based on a group of IPv6 addresses Example: cat LIST.TXT addr6 -i -s

IPv6 Addressing An assessment of the public IPv6 Internet

IPv6 address distribution for web servers

IPv6 address distribution for mail servers

IPv6 address distribution for DNS servers

IPv6 address distribution for clients (M. Ford)

IPv6 Addressing Address-scanning attacks

IPv6 host scanning attacks Thanks to the increased IPv6 address space, IPv6 host scanning attacks are unfeasible. Scanning a /64 would take 500.000.000 years Urban legend We know the search space for a /64 is not 2 64 addresses!

IPv6 addresses embedding IEEE IDs 24 bits 16 bits 24 bits IEEE OUI FF FE Lower 24 bits of MAC In practice, the search space is at most ~2 23 bits feasible! Examples: # scan6 -i eth0 -d fc00::/64 -K 'Dell Inc' -v Special cases: Known or guessable Known Unknown # scan6 -i eth0 -d fc00::/64 -V vbox # scan6 -i eth0 -d fc00::/64 -V vmware -Q 10.10.0.0/8

IPv6 addresses embedding IPv4 addr. They simply embed an IPv4 address in the IID Two variants found in the wild: 2000:db8::192.168.0.1 <- Embedded in 32 bits 2000:db8::192:168:0:1 <- Embedded in 64 bits Search space: same as the IPv4 search space feasible! Example: # scan6 -i eth0 -d fc00::/64 -B all -Q 10.10.0.0/8 # scan6 -i eth0 -d fc00::/64 -B 32 -Q 10.10.0.0/8

IPv6 addresses embedding service ports They simply embed the service port the IID Two variants found in the wild: 2001:db8::1:80 <- n:port 2001:db8::80:1 <- port:n Additionally, the service port can be encoded in hex vs. dec 2001:db8::80 vs. 2001:db8::50 Search space: smaller than 2 8 feasible! Example: # scan6 -i eth0 -d fc00::/64 -g

IPv6 low-byte addresses The IID is set to all-zeros, except for the last byte e.g.: 2000:db8::1 Other variants have been found in the wild: 2001:db8::n1:n2 <- where n1 is typically greater than n2 Search space: usually 2 8 or 2 16 feasible! Example: # scan6 -i eth0 -d fc00::/64 --tgt-low-byte

IPv6 Addressing Host tracking

Introdution Traditional IIDs are constant for each interface As the host moves, the prefix changes, but the IID doesn't the 64-bit IID results in a super-cookie! This introduces a problem not present in IPv4: host-tracking Example: In net #1, host configures address: 2001:db8:1::1111:22ff:fe33:4444 In net #2, host configures address: 2001:db8:2::1111:22ff:fe33:4444 The IID 1111:22ff:fe33:4444 leaks out host identity.

IPv6 host-tracking with scan6 Sample scenario: Node is known to have the IID 1:2:3:4 To check whether the node is at fc00:1::/64 or fc00:2::/64: ping fc00:1::1:2:3:4 and fc00:2::1:2:3:4 Examples: # scan6 -i eth0 -d fc00:1::/64 -d fc00:2::/64 W \ ::1:2:3:4 # scan6 -i eth0 -m prefs.txt -w iids.txt -l -z 60 -t -v

Scanning with DNS reverse mappings Technique: Given a zone X.ip6.arpa., try the labels [0-f].X.ip6.arpa. If an NXDOMAIN is received, that part of the tree should be ignored Otherwise, if NOERROR is received, walk that part of the tree Example (using dnsrevenum6 from THC-IPv6): $ dnsrevenum6 DNSSERVER IPV6PREFIX

IPv6 First Hop Security

IPv6 First Hop Security Fundamental problem: complexity of traffic to be processed at layer-2 Example:

Evading IPv6 First Hop Security Basic idea: Leverage IPv6 Extension Headers and fragmentation Sample RA-based attack (disable a router): # ra6 -i IFACE -s ROUTER -t 0 -d TARGET e -u 1400 -y 1280

Some conclusions

Some conclusions Many IPv4 vulnerabilities have been re-implemented in IPv6 We just didn't learn the lesson from IPv4, or, Different people working in IPv6 than working in IPv4, or, The specs could make implementation more straightforward, or, All of the above? Networks tend to overlook IPv6 security controls Quite a few times there is no parity in the security controls with IPv6 and IPv4 Still quite a bit of work to be done in IPv6 security

Current missing IPv6 firewall features Full Extension Header filtering support Deny any type Limit times any type may be present Support filtering of options in extension headers Rewrite hop count values ICMPv6 content checking (e.g. TooBig MTU) Efficient DOS protection (local attacks, NDP exhaustion, SYN flooding)

Hints on how to filter IPv6 on firewalls http://heise.de/-1851747

Questions?