Lecture 6: Network Attacks II. Course Admin



Similar documents
Chapter 8 Security Pt 2

Denial Of Service. Types of attacks

A Very Incomplete Diagram of Network Attacks

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

A S B

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

CSCE 465 Computer & Network Security

Denial of Service. Tom Chen SMU

Lecture 5: Network Attacks I. Course Admin

Security Technology White Paper

CS 356 Lecture 16 Denial of Service. Spring 2013

Attack Lab: Attacks on TCP/IP Protocols

Linux Network Security

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

Security vulnerabilities in the Internet and possible solutions

Session Hijacking Exploiting TCP, UDP and HTTP Sessions

Chapter 8 Phase3: Gaining Access Using Network Attacks

CS5008: Internet Computing

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

Announcements. No question session this week

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

What is a DoS attack?

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

Security: Attack and Defense

Overview of Network Security The need for network security Desirable security properties Common vulnerabilities Security policy designs

Network Security in Practice

Seminar Computer Security

CYBER ATTACKS EXPLAINED: PACKET CRAFTING

Gaurav Gupta CMSC 681

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

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Firewalls and Intrusion Detection

Brocade NetIron Denial of Service Prevention

Networks: IP and TCP. Internet Protocol

General Network Security

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

This Lecture. The Internet and Sockets. The Start If everyone just sends a small packet of data, they can all use the line at the same.

Packet Sniffers Submitted in partial fulfillment of the requirement for the award of degree Of MCA

Chapter 4 Network Layer

Programming Project #2. Network Security (TCP/IP and DNS) Overview. Overview. Man in the Middle. Proxy Server. Tadayoshi Kohno

Network Security (TCP/IP and DNS)

Guide to DDoS Attacks December 2014 Authored by: Lee Myers, SOC Analyst

Solution of Exercise Sheet 5

Content Distribution Networks (CDN)

Frequent Denial of Service Attacks

Chapter 8 Network Security

1. Firewall Configuration

How do I get to

Network Traffic Analysis

Post-Class Quiz: Telecommunication & Network Security Domain

co Characterizing and Tracing Packet Floods Using Cisco R

Security of IPv6 and DNSSEC for penetration testers

Presented By: Holes in the Fence. Agenda. IPCCTV Attack. DDos Attack. Why Network Security is Important

How To Classify A Dnet Attack

Denial of Service Attacks, What They are and How to Combat Them

Denial of Service Attacks

Chapter 28 Denial of Service (DoS) Attack Prevention

TCP/IP Security Problems. History that still teaches

Computer forensics

APNIC elearning: Network Security Fundamentals. 20 March :30 pm Brisbane Time (GMT+10)

Internet Control Protocols Reading: Chapter 3

Defending against Flooding-Based Distributed Denial-of-Service Attacks: A Tutorial

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

Strategies to Protect Against Distributed Denial of Service (DD

Network Security Fundamentals

A43. Modern Hacking Techniques and IP Security. By Shawn Mullen. Las Vegas, NV IBM TRAINING. IBM Corporation 2006

Network Security. Chapter 9. Attack prevention, detection and response. Attack Prevention. Part I: Attack Prevention

Surviving DNS DDoS Attacks. Introducing self-protecting servers

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

Denial of Service (DoS) attacks and countermeasures. Pier Luigi Rotondo IT Specialist IBM Rome Tivoli Laboratory

Own your LAN with Arp Poison Routing

CMPT 471 Networking II

Kick starting science...

Stop that Big Hack Attack Protecting Your Network from Hackers.

DDoS Vulnerability Analysis of Bittorrent Protocol

Network layer: Overview. Network layer functions IP Routing and forwarding

Packet Sniffing on Layer 2 Switched Local Area Networks

OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS

A Research Study on Packet Sniffing Tool TCPDUMP

Analysis on Some Defences against SYN-Flood Based Denial-of-Service Attacks

Safeguards Against Denial of Service Attacks for IP Phones

TECHNICAL NOTE 06/02 RESPONSE TO DISTRIBUTED DENIAL OF SERVICE (DDOS) ATTACKS

Client Server Registration Protocol

Network Security. Marcus Bendtsen Institutionen för Datavetenskap (IDA) Avdelningen för Databas- och Informationsteknik (ADIT)

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

IP addressing and forwarding Network layer

Unix System Administration

Distributed Denial of Service (DDoS)

Firewalls Netasq. Security Management by NETASQ

CYBER ATTACKS EXPLAINED: THE MAN IN THE MIDDLE

VLAN und MPLS, Firewall und NAT,

CS 640 Introduction to Computer Networks. Network security (continued) Key Distribution a first step. Lecture24

Network Concepts. IT 4823 Information Security Concepts and Administration. The Network Environment. Resilience. Network Topology. Transmission Media

SECURING APACHE : DOS & DDOS ATTACKS - I

Secure Software Programming and Vulnerability Analysis

Technical Support Information Belkin internal use only

DOMAIN NAME SECURITY EXTENSIONS

Port Scanning. Objectives. Introduction: Port Scanning. 1. Introduce the techniques of port scanning. 2. Use port scanning audit tools such as Nmap.

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

Firewalls. Test your Firewall knowledge. Test your Firewall knowledge (cont) (March 4, 2015)

Transcription:

Lecture 6: Network Attacks II CS 336/536: Computer Network Security Fall 2014 Nitesh Saxena Adopted from previous lectures by Keith Ross, and Gene Tsudik Course Admin HW/Lab 1 We are grading (should return by next class) Solution will be provided soon Lab sessions not active this Friday HW/Lab 2 will be posted early next week Covers Lecture 5 (network mapping) Questions? 2 1

Outline Various forms of Network Attacks Sniffing Spoofing and Hijacking DoS/DDoS DNS Attacks 3 Attacks & Hacker Tools Before talking about defenses, need to look at network from attacker s perspective Reconnaissance Network mapping Port scanning Sniffing IP address spoofing Session hijacking DoS DDoS 4 2

Review of interconnection devices Hubs Switches Routers 5 Hubs Hubs are essentially physical-layer repeaters: bits coming from one link go out all other links at the same rate no frame buffering no CSMA/CD at hub: adapters detect collisions provides net management functionality twisted pair hub 6 3

Sniffing Attacker is inside firewall Requirements Attacker s host connected to shared medium NIC should be in promiscuous mode processes all frames that come to NIC Sniffer has two components Capture Packet analysis Grab and file away: userids and passwords credit card numbers secret e-mail conversations Island hopping attack: Take over single machine (eg virus) Install sniffer, observe passwords, take over more machines, install sniffers 7 Passive sniffing Easy to sniff: 802.11 traffic Ethernet traffic passing through a hub Any packets sent to hub is broadcast to all interfaces Not true for a switch Popular sniffers Wireshark tcpdump (for unix) Snort (sniffing and intrusion detection) 8 4

Active Sniffing through a switch How does attacker sniff packets sent to/from the victim? attacker switch victim Have to get victim s packets to attacker! 9 Sniffing through a switch: flooding switch memory approach Host sends flood of frames with random source MAC addresses Switch s forwarding table gets filled with bogus MAC addresses When good packet arrives, dest MAC address not in switch memory Switch broadcasts real packets to all links Sniff all the broadcast packets 10 5

Sniffing through LAN: poison victim s ARP table approach Idea: have client s traffic diverted to attacker attacker (0) Sniff all frames that arrive. Configure so that IP packets arriving from victim are forwarded to default router (1) Send fake ARP response, mapping router IP address to attacker s MAC address victim switch (2) Victim sends traffic destined to outside world. Poisoned ARP table causes traffic to be sent to attacker (3) Packets are forwarded from attacker s host to default router default router for LAN outside world 11 Powerful sniffing tools Dsniff and ettercap Flooding switch memory ARP poisoning 12 6

Sniffing defenses Encrypt data: IPsec, SSL, PGP, SSH Get rid of hubs: complete migration to switched network Use encryption for wireless Configure switches with MAC addresses Turn off self learning (knowing mappings between ports and MAC addresses) Eliminates flooding problem Intrusion detection systems: Lookout for large numbers of ARP replies Honeypot Create fake account and send password over network Identify attacker when it uses the password 13 Attacks & Hacker Tools Before talking about defenses, need to look at network from attacker s perspective Reconnaissance Network mapping Port scanning Sniffing IP address spoofing Session hijacking DoS DDoS 14 7

IP address spoofing (1) SA: 36.220.9.59 DA: 212.68.212.7 145.13.145.67 212.68.212.7 Attacker doesn t want actions traced back Simply re-configure IP address in Windows or Unix. Or enter spoofed address in an application e.g., decoy packets with Nmap 15 IP address spoofing (2) 145.13.145.67 SA: 36.220.9.59 DA: 212.68.212.7 212.68.212.7 attacker 36.220.9.59 victim SA: 212.68.212.7 DA: 36.220.9.59 But attacker cannot interact with victim. Unless attacker is on path between victim and spoofed address. 16 8

IP spoofing with TCP? Can an attacker make a TCP connection to server with a spoofed IP address? Not easy: SYNACK and any subsequent packets sent to spoofed address. If attacker can guess initial sequence number, can attempt to send commands Send ACK with spoofed IP and correct seq #, say, one second after SYN But TCP uses random initial sequence numbers. 17 Defense: Ingress and egress filtering 127.32.1.1 x Egress filtering 127.32.1.1 x Ingress filtering privately administered 222.22/16 Internet 18 9

Ingress Filtering: Upstream ISP (1) 12.12/24 34.34/24 regional ISP BGP update: 12.12/24, 34.34/24 56.56/24 78.78/24 regional ISP BGP update: 56.56/24, 78.78/24 tier-1 ISP 19 Ingress Filtering: Upstream ISP (2) 12.12/24 34.34/24 BGP update: 12.12/24, 34.34/24 Filter all but 12.12/24 and 34.34/24 56.56/24 BGP update: 56.56/24, 78.78/24 Filter all but 56.56/24 and 78.78/24 78.78/24 20 10

Ingress Filtering: Upstream ISP (3) 12.12/24 regional ISP 56.56.1.1 x Filter all but 12.12/24 and 34.34/24 34.34/24 tier-1 ISP 56.56/24 Filter all but 56.56/24 and 78.78/24 regional ISP 78.78/24 21 Ingress Filtering: Upstream ISP (3) 12.12/24 34.34.1.1 regional ISP 34.34/24 Filter all but 12.12/24 and 34.34/24 spoofed packet gets through! tier-1 ISP 56.56/24 78.78/24 regional ISP Filter all but 56.56/24 and 78.78/24 22 11

Ingress filtering: summary Effectiveness depends on widespread deployment at ISPs Deployment in upstream ISPs helps, but does not eliminate IP spoofing Filtering can impact router forwarding performance Even if universally deployed at access, hacker can still spoof another address in its access network 12.12/24 See RFC 2827 Network Ingress Filtering: Defeating DDoS 23 Attacks & Hacker Tools Before talking about defenses, need to look at network from attacker s perspective Reconnaissance Network mapping Port scanning Sniffing IP address spoofing Session hijacking DoS DDoS 24 12

Session hijacking Take control of one side of a TCP connection Marriage of sniffing and spoofing Alice telnet Alice Bob Attacker 25 Session hijacking: The details Attacker is on segment where traffic passes from Alice to Bob Attacker sniffs packets Sees TCP packets between Bob and Alice and their sequence numbers Attacker jumps in, sending TCP packets to Bob; source IP address = Alice s IP address Bob now obeys commands sent by attacker, thinking they were sent by Alice Principal defense: encyrption + MAC Attacker does not have keys to encrypt/authenticate and insert meaningful traffic 26 13

Session hijacking: limitation 2. to resync, Alice sends segment with correct seq # Alice 1. weird ACK # for data never sent Bob Bob is getting segments from attacker and Alice. Source IP address same, but seq # s different. Bob likely drops connection. Attacker Attacker s solution: Send unsolicited ARP replies to Alice and Bob with non-existent MAC addresses Overwrite IP-to-MAC ARP tables Alice s segments will not reach Bob and vice-versa But attacker continues to hear Bob s segments, communicates with Bob 27 Session Hijacking Tools: Hunt http://ihackers.co/hunt-session-hijacking-tool/ Provides ARP poisoning Netcat General purpose widget Very popular 28 14

Denial-of-Service Prevent access by legitimate users or stop critical system processes Implementation Vulnerability attack: Send a few crafted messages to target app that has vulnerability Malicious messages called the exploit Remotely stopping or crashing services Connection flooding attack Overwhelming connection queue with SYN flood Bandwidth flooding attack: Overwhelming communications link with packets Strength in flooding attack lies in volume rather than content 29 DoS and DDoS DoS: source of attack small # of nodes source IP typically spoofed DDoS From thousands of nodes IP addresses often not spoofed Good book: Internet Denial of Service by J. Merkovic, D. Dittrich, P. Reiher, 2005 30 15

Interlude: IP datagram format header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to ver head. len 16-bit identifier time to live 32 bits type of service upper layer flgs length fragment offset Internet checksum 32 bit source IP address 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) total datagram length (bytes) for fragmentation/ reassembly 31 IP Fragmentation and Reassembly Example 4000 byte datagram MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 length =4000 ID =x length =1500 fragflag =0 ID =x ID =x offset =0 One large datagram becomes several smaller datagrams length =1500 length =1040 ID =x fragflag =1 fragflag =1 fragflag =0 offset =0 offset =185 offset =370 32 16

DoS: examples of vulnerability attacks see http://www.cert.org/advisories/ca-1997-28.html Land: sends spoofed packet with source and dest address/port the same Ping of death: sends oversized ping packet Jolt2: sends a stream of fragments, none of which have offset of 0. Rebuilding consumes all processor capacity. Teardrop, Newtear, Bonk, Syndrop: tools send overlapping segments, that is, fragment offsets incorrect. Patches fix the problem, but malformed packet attacks continue to be discovered. 33 LAND Local Area Network Denial Spoofed SYN packet with source and destination both being the victim On receipt, victim s machine keep on responding to itself in a loop Causes the victim to crash Many OSs are vulnerable, e.g., Windows 95, NT, XP SP2 Mac OS MacTCP 34 17

Ping of Death ICMP Echo Request (Ping) is 56 bytes If a ping message is more than 65536 bytes (max for IP packet), this can cause some machines to crash Older windows systems Solution: patch OS, filter out ICMP packets 35 Teardrop, Bonk and kins TCP/IP fragments contain Offset field Attacker sets Offset field to: overlapping values Bad/old implementation of TCP/IP stack crashes when attempting to re-assemble the fragments or to very large values Target system crashes Solution: use up-to-date TCP/IP implementation 36 18

Connection flooding: Overwhelming connection queue w/ SYN flood Recall client sends SYN packet with initial seq. number when initiating a connection. TCP on server machine allocates memory on its connection queue, to track the status of the new halfopen connection. For each half-open connection, server waits for ACK segment, using a timeout that is often > 1 minute Attack: Send many SYN packets, filling connection queue with half-open connections. Can spoof source IP address! When connection queue is exhausted, no new connections can be initiated by legit users. Need to know of open port on victim s machine: Port scanning. 37 SYN Flooding Attack S SYN C1 SYN C2 SYN C3 SYN C4 SYN C5 Listening Spawn a new thread, store connection data and more and more and more and more and more 38 19

SYN Flooding Explained Attacker sends many connection requests (SYNs) with spoofed source addresses Victim allocates resources for each request New thread, connection state maintained until timeout Fixed bound on half-open connections Once resources exhausted, requests from legitimate clients are denied This is a classic denial of service attack Common pattern: it costs nothing to TCP client to send a connection request, but TCP server must spawn a thread for each request - asymmetry! What s another example of this behavior? 39 SYN flood Issue amateur attack: attacker victim Connection queue freed up with RST segment Alice Expert attack: Use multiple source IP addresses, each from unresponsive addresses. 40 20

Preventing Denial of Service (SYN Flood) DoS is caused by asymmetric state allocation If server opens new state for each connection attempt, attacker can initiate many connections from bogus or forged IP addresses Cookies allow server to remain stateless until client produces: Server state (IP addresses and ports) stored in a cookie and originally sent to client When client responds, cookie is verified 41 SYN flood defense: SYN cookies (1) SYN with ISN A Host A SYN-ACK with ISN B = cookie Host B When SYN segment arrives, host B calculates function (hash) based on: Source and destination IP addresses and port numbers, and a secret number Host B uses resulting cookie for its initial seq # (ISN) in SYNACK Host B does not allocate anything to half-open connection: Does not remember A s ISN Does not remember cookie 42 21

SYN Cookies (2) C S [Bernstein and Schenk] Compatible with standard TCP; simply a weird sequence number scheme SYN C SYN S, ACK C sequence # = cookie Listening Does not store state F=Rijndael or crypto hash F(source addr, source port, dest addr, dest port, coarse time, server secret) Cookie must be unforgeable and tamper-proof (why?) Client should not be able to invert a cookie (why?) ACK S (cookie) Recompute cookie, compare with with the one received, only establish connection if they match More info: http://cr.yp.to/syncookies.html 43 SYN cookies (3) If SYN is legitimate Host A returns ACK Host B computes same function, verifies function = ACK # in ACK segment Host B creates socket for connection Legit connection established without the need for half-open connections If SYN-flood attack with spoofed IP address No ACK comes back to B for connection. No problem: B is not waiting for an ACK What if Host A sends only ACK (no SYN)? Will host B establish a connection? 44 22

Overwhelming link bandwidth with packets Attack traffic can be made similar to legitimate traffic, hindering detection. Flow of traffic must consume target s bandwidth resources. Attacker needs to engage more than one machine => DDoS May be easier to get target to fill-up its upstream bandwidth: async access Example: attacking BitTorrent seeds 45 Distributed DoS: DDos bot Attacker takes over many machines, called bots. Potential bots are machines with vulnerabilities. bot attacker Internet bot victim bot processes wait for command from attacker to flood a target bot 46 23

DDoS: Reflection attack DNS server request request DNS server reply reply attacker request DNS server request reply reply victim Source IP = victim s IP DNS server 47 Smurf Attack 1 ICMP Echo Req Src: victim s address Dest: broadcast address Looks like a legitimate Are you alive? ping request from the victim Stream of ping replies overwhelms victim Every host on the network generates a ping reply (ICMP Echo Reply) to victim router victim Solution: reject external packets to broadcast addresses 48 24

DDoS: Reflection attack Spoof source IP address = victim s IP Goal: generate lengthy or numerous replies for short requests: amplification Without amplification: would it make sense? January 2001 attack: requests for large DNS record generated 60-90 Mbps of traffic Reflection attack can be also be done with Web and other services 49 DDoS Defenses Don t let your systems become bots Keep systems patched up Employ egress antispoof filtering on external router. Filter dangerous packets Vulnerability attacks Intrusion prevention systems Signature and anomaly detection and filtering Rate limiting Limit # of packets sent from source to dest CAPTCHAs Could be useful against application level attacks (e.g., against web servers) 50 25

DNS attacks Reflector attack: already discussed Leverage DNS for attacks on arbitrary targets Denying DNS service Stop DNS root servers Stop top-level-domain servers (e.g..com domain) Stop local (default name servers) Use fake DNS replies to redirect user Poisoning DNS: Insert false resource records into various DNS caches False records contain IP addresses operated by attackers 51 DDos DNS Attack Oct 21, 2002 Ping packets sent from bots to the 13 DNS root servers. Goal: bandwidth flood servers Minimal impact: DNS caching rate limiting at upstream routers: filter ping when they arrive at an excessive rate During attack, some networks filtered pings; corresponding root servers remained up. Root server attack is easy to defend: download root server database to local (default) name servers Not much data in root server; changes infrequently TLD servers are more volatile Similar kind of attack in May 2004, Feb 2007 52 26

DNS attack: redirecting client hub or WiFi 1 2 network local DNS server attacker 1. Client sends DNS query to its local DNS server; sniffed by attacker 2. Attacker responds with bogus DNS reply Issues: Must spoof IP address: set to local DNS server (easy) Must match reply ID with request ID (easy) May need to stop reply from the local DNS server (harder) 53 Poisoning DNS Cache (1) Poisoning: Attempt to put bogus records into DNS name server caches Bogus records could point to attacker nodes Attacker nodes could phish But unsolicited replies are not accepted at a name server. Name servers use IDs in DNS messages to match replies to queries So can t just insert a record into a name server by sending a DNS reply message. But can send a reply to a request. 54 27

Poisoning local DNS server (2) authoritative DNS for uab.edu 2. iterative DNS queries 1. DNS query uab.edu=? Attacker in Australia: 17.32.8.9 3. DNS reply uab.edu= 17.32.8.9 Local DNS Server (eg, Berkeley) Goal: Put bogus IP address for uab.edu in local Berkeley DNS server 1) Attacker queries local DNS server 2) Local DNS makes iterative queries 3) Attacker waits for some time; sends a bogus reply, spoofing authoritative server for uab.edu. 55 Poisoning local DNS server (3) 1. DNS query uab.edu=? authoritative DNS for uab.edu Poisoned local DNS server (eg, Berkeley) 2. DNS query uab.edu=? Attacker in Australia 17.32.8.9 DNS response can provide IP address of malicious server! 56 28

DNS Poisoning (4) Issues: Attacker may need to stop upstream name server from responding So that server under attack doesn t get suspicious Ping of death, DoS, overflows, etc 57 DNS attacks: Summary DNS is a critical component of the Internet infrastructure But is surprisingly robust: DDoS attacks against root servers have been largely unsuccessful Poisoning and redirection attacks are difficult unless you can sniff DNS requests And even so, may need to stop DNS servers from replying DNS can be leveraged for reflection attacks against non-dns nodes 58 29