How To Understand A Firewall



Similar documents
Linux firewall. Need of firewall Single connection between network Allows restricted traffic between networks Denies un authorized users

CIT 480: Securing Computer Systems. Firewalls

Computer Firewalls. The term firewall was originally used with forest fires, as a means to describe the

Firewall. IPTables and its use in a realistic scenario. José Bateira ei10133 Pedro Cunha ei05064 Pedro Grilo ei09137 FEUP MIEIC SSIN

Chapter 7. Firewalls

CIT 480: Securing Computer Systems. Firewalls

ΕΠΛ 674: Εργαστήριο 5 Firewalls

Firewalls. Chien-Chung Shen

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

Security threats and network. Software firewall. Hardware firewall. Firewalls

CSC574 - Computer and Network Security Module: Firewalls

Protecting and controlling Virtual LANs by Linux router-firewall

CIS 433/533 - Computer and Network Security Firewalls

ΕΠΛ 475: Εργαστήριο 9 Firewalls Τοίχοι πυρασφάλειας. University of Cyprus Department of Computer Science

Linux Routers and Community Networks

Intro to Linux Kernel Firewall

CSE543 - Computer and Network Security Module: Firewalls

IMPLEMENTATION OF INTELLIGENT FIREWALL TO CHECK INTERNET HACKERS THREAT

Network Security Exercise 10 How to build a wall of fire

Firewalls N E T W O R K ( A N D D ATA ) S E C U R I T Y / P E D R O B R A N D Ã O M A N U E L E D U A R D O C O R R E I A

Network security Exercise 9 How to build a wall of fire Linux Netfilter

Firewalls (IPTABLES)

We will give some overview of firewalls. Figure 1 explains the position of a firewall. Figure 1: A Firewall

CS Computer and Network Security: Firewalls

Linux Firewall Wizardry. By Nemus

Main functions of Linux Netfilter

Module: Firewalls. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

Firewalls. CEN 448 Security and Internet Protocols Chapter 20 Firewalls

+ iptables. packet filtering && firewall

Optimisacion del ancho de banda (Introduccion al Firewall de Linux)

What is a Firewall? Computer Security. Firewalls. What is a Firewall? What is a Firewall?

CS Computer and Network Security: Firewalls

CSCI Firewalls and Packet Filtering

Firewalls. Ahmad Almulhem March 10, 2012

1:1 NAT in ZeroShell. Requirements. Overview. Network Setup

SFWR ENG 4C03 Class Project Firewall Design Principals Arash Kamyab March 04, 2004

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

Firewalls. ITS335: IT Security. Sirindhorn International Institute of Technology Thammasat University ITS335. Firewalls. Characteristics.

Firewalls. Contents. ITS335: IT Security. Firewall Characteristics. Types of Firewalls. Firewall Locations. Summary

Linux Firewalls (Ubuntu IPTables) II

CS 356 Lecture 19 and 20 Firewalls and Intrusion Prevention. Spring 2013

What is Firewall? A system designed to prevent unauthorized access to or from a private network.

Netfilter / IPtables

Firewalls, IDS and IPS

Proxy Server, Network Address Translator, Firewall. Proxy Server

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

A host-based firewall can be used in addition to a network-based firewall to provide multiple layers of protection.

Chapter 15. Firewalls, IDS and IPS

IPv6 Firewalls. ITU/APNIC/MICT IPv6 Security Workshop 23 rd 27 th May 2016 Bangkok. Last updated 17 th May 2016

Security Technology: Firewalls and VPNs

Linux: 20 Iptables Examples For New SysAdmins

Firewalls. Firewall types. Packet filter. Proxy server. linux, iptables-based Windows XP s built-in router device built-ins single TCP conversation

12. Firewalls Content

Linux Firewall. Linux workshop #2.

Firewalls, NAT and Intrusion Detection and Prevention Systems (IDS)

Packet filtering and other firewall functions

ipchains and iptables for Firewalling and Routing

How To Protect Your Firewall From Attack From A Malicious Computer Or Network Device

SOFTWARE ENGINEERING 4C03. Computer Networks & Computer Security. Network Firewall

Fig : Packet Filtering

Firewall Firewall August, 2003

FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. Chapter 5 Firewall Planning and Design

Assignment 3 Firewalls

Focus on Security. Keeping the bad guys out

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Firewall

Firewalls. Ola Flygt Växjö University, Sweden Firewall Design Principles

How to Turn a Unix Computer into a Router and Firewall Using IPTables

CSE 4482 Computer Security Management: Assessment and Forensics. Protection Mechanisms: Firewalls

Firewalls. Pehr Söderman KTH-CSC

Firewalls. Chapter 3

Firewall Design Principles Firewall Characteristics Types of Firewalls

Module 8. Network Security. Version 2 CSE IIT, Kharagpur

Topics NS HS12 2 CINS/F1-01

Matthew Rossmiller 11/25/03

Firewalls CSCI 454/554

7. Firewall - Concept

Solution of Exercise Sheet 5

Chapter 9 Firewalls and Intrusion Prevention Systems

Stateful Firewalls. Hank and Foo

IP Firewalls. an overview of the principles

Introduction to Firewalls

Firewalls and VPNs. Principles of Information Security, 5th Edition 1

Firewalls. October 23, 2015

CMPT 471 Networking II

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

TECHNICAL NOTES. Security Firewall IP Tables

Linux Network Security

Firewall Introduction Several Types of Firewall. Cisco PIX Firewall

Network Security Management

Firewalls. Securing Networks. Chapter 3 Part 1 of 4 CA M S Mehta, FCA

Lecture 23: Firewalls

Chapter 5. Figure 5-1: Border Firewall. Firewalls. Figure 5-1: Border Firewall. Figure 5-1: Border Firewall. Figure 5-1: Border Firewall

Linux Networking: IP Packet Filter Firewalling

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

Firewalls. Ingress Filtering. Ingress Filtering. Network Security. Firewalls. Access lists Ingress filtering. Egress filtering NAT

Transcription:

Module II. Internet Security Chapter 6 Firewall Web Security: Theory & Applications School of Software, Sun Yat-sen University

Outline 6.1 Introduction to Firewall What Is a Firewall Types of Firewall What Can a Firewall Do 6.2 Design Principles of Firewall Packet Filtering Firewall Packet Filtering Firewall Based on the state Application Proxy Firewall Bastion Host Web Security : Theory And Applications 2 / 63

Outline 6.3 Penetration of firewall Attack Packet Filtering Firewall Attack Stateful Inspection Firewall Attack Proxy 6.4 Firewall installation and Configuration Iptables Web Security : Theory And Applications 3 / 63

Outline 6.1 Introduction to Firewall What Is a Firewall Types of Firewall What Can a Firewall Do 6.2 Design Principles of Firewall 6.3 Penetration of firewall 6.4 Firewall installation and Configuration Web Security : Theory And Applications 4 / 63

6.1 Introduction to Firewall 6.1.1 What Is a Firewall Web Security : Theory And Applications 5 / 63

6.1 Introduction to Firewall 6.1.2 Types of Firewall 1 st gen: Packet Filters 2 nd gen: Stateful Filters 3 rd gen: Application Layer Web Security : Theory And Applications 6 / 63

6.1 Introduction to Firewall Packet Filters IP Packet Filter Firewall is a firewall deciding to forward or to drop a certain packet according to the information of the packet s head. Packet filters act by inspecting the "packets" which transfer between computers on the Internet. If a packet matches the packet filter's set of rules, the packet filter will drop (silently discard) the packet, or reject it (discard it, and send "error responses" to the source). This type of packet filtering pays no attention to whether a packet is part of an existing stream of traffic (i.e. it stores no information on connection "state"). Instead, it filters each packet based only on information contained in the packet itself. Web Security : Theory And Applications 7 / 63

6.1 Introduction to Firewall Packet filtering firewalls work mainly on the first three layers of the OSI reference model, which means most of the work is done between the network and physical layers, with a little bit of peeking into the transport layer to figure out source and destination port numbers. Web Security : Theory And Applications 8 / 63

6.1 Introduction to Firewall Stateful Filters Stateful filters introduce a technology of stateful inspection packet filtering. These firewalls perform the work of their first-generation predecessors but operate up to layer 4 (transport layer) of the OSI model. This is achieved by retaining packets until enough are available to make a judgement about its state. Known as stateful packet inspection, it records all connections passing through it and determines whether a packet is the start of a new connection, a part of an existing connection, or not part of any connection. Though static rules are still used, these rules can now contain connection state as one of their test criteria. Certain DoS attacks bombard the firewall with thousands of fake connection packets to overwhelm it by filling its connection state memory Web Security : Theory And Applications 9 / 63

6.1 Introduction to Firewall Application Layer Application layer filtering can "understand" certain applications and protocols (such as File Transfer Protocol (FTP), Domain Name System (DNS), or Hypertext Transfer Protocol (HTTP)). This is useful as it is able to detect if an unwanted protocol is attempting to bypass the firewall on an allowed port, or detect if a protocol is being abused in any harmful way. The existing deep packet inspection functionality of modern firewalls can be shared by Intrusion prevention systems (IPS). Web Security : Theory And Applications 10 / 63

6.1 Introduction to Firewall Packet Filtering Firewall Web Security : Theory And Applications 11 / 63

6.1 Introduction to Firewall Stateful Inspection Firewall Web Security : Theory And Applications 12 / 63

6.1 Introduction to Firewall Circuit-Level Gateway Web Security : Theory And Applications 13 / 63

6.1 Introduction to Firewall Application-Level Gateway Web Security : Theory And Applications 14 / 63

6.1 Introduction to Firewall 6.1.3 What Can a Firewall Do Manage and control network traffic Packet Inspection Connections and State Stateful Packet Inspection Act as an intermediary protect internal host from the risk of direct interaction Insulate the protected host from threats by ensuring that an external host can never directly communicate with the protected host Web Security : Theory And Applications 15 / 63

6.1 Introduction to Firewall Protect resources To protect resources from threat Protected resources should always be kept patched and up-to-date Record and report on events Record all communications especially access policy violations Through system log or proprietary logging format Alarm when a policy has been violated Web Security : Theory And Applications 16 / 63

Outline 6.1 Introduction to Firewall 6.2 Design Principles of Firewall Packet Filtering Firewall Packet Filtering Firewall Based on the State Application Proxy Firewall Bastion Host 6.3 Penetration of firewall 6.4 Firewall installation and Configuration Web Security : Theory And Applications 17 / 63

6.2 Design Principles of Firewall 6.2.1 Packet Filtering Firewall What is Packet Filtering Firewall How Packet Filtering Firewall Works What to Filter Advantages Disadvantages Web Security : Theory And Applications 18 / 63

6.2 Design Principles of Firewall What is Packet Filtering Firewall Packet Filtering Firewall allow the packet which match the established rule set to pass and deny the packet which violate the established rule set, at the same time, it will record log message, alarm the administrator when a policy has been violated. Web Security : Theory And Applications 19 / 63

6.2 Design Principles of Firewall How Packet Filtering Firewall Works A packet filter has a set of rules with accept or deny actions Based on the information contained in the packet itself Using different field in the head of the packet to filter, include the packet's source and destination address, its protocol, port number, and so on When the packet filter receives a packet of information, the filter compares the packet to your pre-configured rule set At the first match, the packet filter either accepts or denies the packet of information Web Security : Theory And Applications 20 / 63

6.2 Design Principles of Firewall How Packet Filtering Firewall Works Web Security : Theory And Applications 21 / 63

6.2 Design Principles of Firewall What to Filter IP address filtering TCP/UDP s port filtering ACK filtering UDP packet filtering Web Security : Theory And Applications 22 / 63

6.2 Design Principles of Firewall Advantages High speed Transparent for the users Web Security : Theory And Applications 23 / 63

6.2 Design Principles of Firewall Disadvantages Can not filter the packet according the containing of the packet Only offer brief log messages Every port that may be used must be open to the external network, which increase the risk of attack Very difficult to configure ACL (Access Control List ) Web Security : Theory And Applications 24 / 63

6.2 Design Principles of Firewall 6.2.2 Stateful Inspection Firewall What is Stateful Inspection Firewall How Stateful Inspection Firewall Works Advantages Disadvantages Web Security : Theory And Applications 25 / 63

6.2 Design Principles of Firewall What is Stateful Inspection Firewall A stateful inspection firewall is a firewall that monitors the state of the connection and compiles the information in a state table. Web Security : Theory And Applications 26 / 63

6.2 Design Principles of Firewall How Stateful Inspection Firewall Works Web Security : Theory And Applications 27 / 63

6.2 Design Principles of Firewall Advantages Safer than static packet filtering Better performance than static packet filtering Disadvantages Security is not high enough due to fewer checks on packet data More detections demand higher performance of the firewall Web Security : Theory And Applications 28 / 63

6.2 Design Principles of Firewall 6.2.3 Application Layer Gateway (ALG, or Proxy Server) What is Proxy Topological Graph of Proxy Function Offered By Proxy Advantages Disadvantage Web Security : Theory And Applications 29 / 63

6.2 Design Principles of Firewall What is Proxy Responsible for the communication between external network and internal network When the users intend to communicate, they do not communicate directly, proxy will help forwarding instead Web Security : Theory And Applications 30 / 63

6.2 Design Principles of Firewall Topological Graph Web Security : Theory And Applications 31 / 63

6.2 Design Principles of Firewall Topological Graph Web Security : Theory And Applications 32 / 63

6.2 Design Principles of Firewall Function Offered by Proxy Authentication mechanism Content Filtering Mature Log Web Security : Theory And Applications 33 / 63

6.2 Design Principles of Firewall Advantages Accelerate the network by its Cache Prevent any detection to internal network Filtering the content of the packet effectively Reduce direct attack to internal network No IP Address Spoofing Attack Mature Log Web Security : Theory And Applications 34 / 63

6.2 Design Principles of Firewall Disadvantages A special service must have a special proxy Too much access delay when proxy server is busy Opaque (not transparent) for the users Slower than Packet Filtering firewall Example: H3C SecPath F1000-A-EI Web Security : Theory And Applications 35 / 63

6.2 Design Principles of Firewall 6.2.4 Bastion Host Topological Graph Design Principles of Bastion Host Type of Bastion Host Physical Placement of Bastion Host Web Security : Theory And Applications 36 / 63

6.2 Design Principles of Firewall Topological Graph Web Security : Theory And Applications 37 / 63

6.2 Design Principles of Firewall Physical placement of bastion host Web Security : Theory And Applications 38 / 63

6.2 Design Principles of Firewall Physical placement of bastion host Web Security : Theory And Applications 39 / 63

6.2 Design Principles of Firewall Physical placement of bastion host Web Security : Theory And Applications 40 / 63

Outline 6.1 Introduction to Firewall 6.2 Design Principles of Firewall 6.3 Penetration of firewall Attacking Packet Filtering Firewall Attacking Stateful Inspection Firewall Attacking Proxy 6.4 Firewall installation and Configuration Web Security : Theory And Applications 41 / 63

6.3 Penetration of Firewall 6.3.1 Attacking Packet Filtering Firewall IP Address Spoofing Attack Denial-of-service Attack Tiny Fragment Attack Trojan Attack Web Security : Theory And Applications 42 / 63

6.3 Penetration of Firewall 6.3.2 Attacking Stateful Inspection Firewall Protocol Tunneling Trojans Rebound Web Security : Theory And Applications 43 / 63

6.3 Penetration of Firewall 6.3.3 Attacking Proxy Unauthorized Web Access Unauthorized Socks Access Unauthorized Telnet Access Web Security : Theory And Applications 44 / 63

6.3 Penetration of Firewall WinGate Web Security : Theory And Applications 45 / 63

6.3 Penetration of Firewall Hardware Firewall vs Software Firewall Hardware firewalls are specifically built within hardware devices like routers whereas software firewalls are software programs installed on computers. Hardware firewalls protect a whole network while software firewalls protect individual computers on which they are installed. By default, hardware firewalls filter web packets while software firewalls may not filter web packets unless web traffic filtering controls are enabled. A hardware firewall can be configured to use a proxy service for filtering packets while a software firewall does not use a proxy service to filter. Web Security : Theory And Applications 46 / 63

Outline 6.1 Introduction to Firewall 6.2 Design Principles of Firewall 6.3 Penetration of firewall 6.4 Firewall installation and Configuration Web Security : Theory And Applications 47 / 63

6.4 Firewall Installation and Configuration Security on Linux - Iptables What is Iptables Architecture of Iptables Command Format Examples Web Security : Theory And Applications 48 / 63

6.4 Firewall Installation and Configuration What is Iptables Iptables is a generic table structure that defines rules and commands as part of the netfilter framework that facilitates Network Address Translation (NAT), packet filtering, and packet mangling in the Linux 2.4 and later version of linux. Web Security : Theory And Applications 49 / 63

6.4 Firewall Installation and Configuration Architecture of Iptables Web Security : Theory And Applications 50 / 63

6.4 Firewall Installation and Configuration Command Format iptables [-t table_name] <command> [Chain_name] [Rule_No.] [Rule] [-j Target_Action] Web Security : Theory And Applications 51 / 63

6.4 Firewall Installation and Configuration Command Format command -A <Chain_name> <Rule> -D <Chain_name> <Rule> -D <Chain_name> <Rule No.> -R <Chain_name> <Rule No.> <Rule> -I <Chain_name> [Rule No.] <Rule> -L [Chain_name] -F [Chain_name] -N <Chain_name> -X [Chain_name] -P <Chain_name> <Target> -E <Old Chain_name> <New Chain_name> Add Rule Delete Rule Replace Rule Insert Rule List Rule Delete All Rule in Chain New Chain Delete Chain Default Rule Rename Chain Web Security : Theory And Applications 52 / 63

6.4 Firewall Installation and Configuration Command Format Rule -p <Protocol Type> -s <IP Address/Mask> -d <IP Address/Mask> -i <Port> -o <Port> Specify Upper Protocol Specify Source IP ADD Specify Destination IP ADD Specify Input Network Interface Specify Output Network Interface Web Security : Theory And Applications 53 / 63

6.4 Firewall Installation and Configuration Command Format Target_Action -j ACCEPT -j REJECT -j DROP -j REDIRECT -j LOG -j <Chain_name> Web Security : Theory And Applications 54 / 63

6.4 Firewall Installation and Configuration Examples Host Firewall iptables -N MYCHAIN iptables -A MYCHAIN -p tcp --dport 80 -j ACCEPT iptables -A MYCHAIN -j RETURN iptables -P INPUT DROP iptables A INPUT i lo j ACCEPT iptables -A INPUT -j MYCHAIN iptables -A INPUT -p tcp --dport 22 -j LOG --log-prefix "<--my GO ON-->" iptables -A OUTPUT DROP iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT iptables -L Web Security : Theory And Applications 55 / 63

6.4 Firewall Installation and Configuration Examples Gateway Firewall Web Security : Theory And Applications 56 / 63

6.4 Firewall Installation and Configuration Examples Gateway Firewall iptables -F iptables -F -t nat iptables -F -t mangle iptables -P FORWARD DROP iptables -A FORWARD -i eth3 -p tcp --dport 80 -j ACCEPT iptables -A FORWARD -i eth2 -p tcp --sport 80 -j ACCEPT iptables -A FORWARD -i eth3 -p tcp --dport 21 -j ACCEPT iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -p tcp --dport 22 -j ACCEPT Web Security : Theory And Applications 57 / 63

6.4 Firewall Installation and Configuration Examples NAT(SNAT) iptables -F iptables -t nat -F iptables -P FORWARD ACCEPT iptables -A FORWARD -i eth3 -d 192.168.2.0/24 -p tcp --syn -j DROP iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth3 -j SNAT -- to-source 202.204.235.100 Web Security : Theory And Applications 58 / 63

6.4 Firewall Installation and Configuration Examples NAT(DNAT) iptables -F iptables -t nat F iptables -t nat -A PREROUTING -i eth3 -d 192.168.2.0/24 -p tcp --syn -j DROP iptables -t nat -A PREROUTING -i eth3 -p tcp --dport 80 -j DNAT --to 192.168.2.2:80 iptables -t nat -A PREROUTING -i eth3 -p tcp --dport 21 -j DNAT --to 192.168.2.2:21 iptables -t nat -A PREROUTING -i eth3 -p tcp --dport 22 -j DNAT --to 192.168.2.2:22 iptables -P FORWARD DROP Web Security : Theory And Applications 59 / 63

6.4 Firewall Installation and Configuration Practice: 1. Understand IPTABLES 2. Try to install and configurate IPTABLES. Web Security : Theory And Applications 60 / 63

References 1. Wikipedia Firewall (computing) http://en.wikipedia.org/wiki/firewall_(computing) 2. Wes Noonan, Ido Dubrawsky, Firewall Fundamentals 3. Hui Yan, Wei Wang, Yupeng Ning, Principle and Technology of Firewall 4. Technology of Building Boston Host http://www.bitscn.com/netpro/firewall/200704/101642.html 5. D. Brent Chapman & Elizabeth D. Zwicky Building Internet Firewalls http://sjoel.home.xs4all.nl/the-networking-cdbookshelf/firewall/index.htm 6. Several Common Technology Used By Hacker To Attack Firewall http://it.rising.com.cn/newsite/channels/safety/safetyresourse/safe _Foundation/200503/01-093018524.htm Web Security : Theory And Applications 61 / 63

References 7. The Vulnerability and Defect of Firewall http://www.xinfengit.com/201001/14101948.html 8. Tianfeng Lin. A Guide to Setting Up a Server. 9. Difference Between Hardware Firewall and Software Firewall http://www.differencebetween.net/technology/difference-betweenhardware-firewall-and-software-firewall/ 10. WinGate: http://www.wingate.com/products/wingate/index.php 11. Greg Hoglund,James Butler, Rootkits: Subverting the Windows kernel, Pearson Education Inc, 2006 12. Michael Gregg,Stephen Watkins, Hack the Stack, Syngress, 2006 Web Security : Theory And Applications 62 / 63

Thank you! Web Security : Theory And Applications 63 / 63