• No results found

Concepts & Examples ScreenOS Reference Guide

N/A
N/A
Protected

Academic year: 2021

Share "Concepts & Examples ScreenOS Reference Guide"

Copied!
300
0
0

Loading.... (view fulltext now)

Full text

(1)

Concepts & Examples

ScreenOS Reference Guide

Attack Detection and Defense Mechanisms

Release

6.3.0, Rev. 02

(2)

Juniper Networks, Junos, Steel-Belted Radius, NetScreen, and ScreenOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. JunosE is a trademark of Juniper Networks, Inc. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.

Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right to change, modify, transfer, or otherwise revise this publication without notice.

Products made or sold by Juniper Networks or components thereof might be covered by one or more of the following patents that are owned by or licensed to Juniper Networks: U.S. Patent Nos. 5,473,599, 5,905,725, 5,909,440, 6,192,051, 6,333,650, 6,359,479, 6,406,312, 6,429,706, 6,459,579, 6,493,347, 6,538,518, 6,538,899, 6,552,918, 6,567,902, 6,578,186, and 6,590,785.

Copyright © 2009, Juniper Networks, Inc. All rights reserved.

Revision History

December 2012—Revision 02

Content subject to change. The information in this document is current as of the date listed in the revision history.

SOFTWARE LICENSE

The terms and conditions for using this software are described in the software license contained in the acknowledgment to your purchase order or, to the extent applicable, to any reseller agreement or end-user purchase agreement executed between you and Juniper Networks. By using this software, you indicate that you understand and agree to be bound by those terms and conditions.

Generally speaking, the software license restricts the manner in which you are permitted to use the software and may contain prohibitions against certain uses. The software license may state conditions under which the license is automatically terminated. You should consult the license for further details.

For complete product documentation, please see the Juniper Networks Website atwww.juniper.net/techpubs. END USER LICENSE AGREEMENT

The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use with) Juniper Networks software. Use of such software is subject to the terms and conditions of the End User License Agreement (“EULA”) posted at

(3)

Abbreviated Table of Contents

About This Guide . . . xix

Part 1

Attack Detection and Defense Mechanisms

Chapter 1 Protecting a Network . . . 3

Chapter 2 Reconnaissance Deterrence . . . 9

Chapter 3 Denial of Service Attack Defenses . . . 31

Chapter 4 Content Monitoring and Filtering . . . 61

Chapter 5 Deep Inspection . . . 123

Chapter 6 Intrusion Detection and Prevention . . . 175

Chapter 7 Suspicious Packet Attributes . . . 255

Part 2

Appendix

Appendix A Contexts for User-Defined Signatures . . . 265

(4)
(5)

Table of Contents

About This Guide . . . xix

Document Conventions . . . xx

Document Feedback . . . xxii

Requesting Technical Support . . . xxii

Part 1

Attack Detection and Defense Mechanisms

Chapter 1 Protecting a Network . . . 3

Stages of an Attack . . . 4

Detection and Defense Mechanisms . . . 4

Exploit Monitoring . . . 6

Example: Monitoring Attacks from the Untrust Zone . . . 7

WebUI . . . 7

CLI . . . 7

Chapter 2 Reconnaissance Deterrence . . . 9

IP Address Sweep . . . 9 WebUI . . . 10 CLI . . . 10 Port Scanning . . . 10 WebUI . . . 11 CLI . . . 11

TCP/UDP Sweep Protection . . . 11

WebUI: . . . 12

CLI: . . . 12

Network Reconnaissance Using IP Options . . . 13

WebUI . . . 15

CLI . . . 15

Operating System Probes . . . 15

SYN and FIN Flags Set . . . 15

WebUI . . . 16

CLI . . . 16

FIN Flag Without ACK Flag . . . 16

WebUI . . . 17

CLI . . . 17

TCP Header Without Flags Set . . . 17

WebUI . . . 18

CLI . . . 18

Evasion Techniques . . . 18

FIN Scan . . . 18

(6)

IP Spoofing . . . 23

Example: L3 IP Spoof Protection . . . 24

Example: L2 IP Spoof Protection . . . 27

IP Source Route Options . . . 28

WebUI . . . 30

CLI . . . 30

WebUI . . . 30

CLI . . . 30

Chapter 3 Denial of Service Attack Defenses . . . 31

Firewall DoS Attacks . . . 31

Session Table Flood . . . 31

Source-Based and Destination-Based Session Limits . . . 32

Example: Source-Based Session Limiting . . . 33

Example: Destination-Based Session Limiting . . . 34

Aggressive Aging . . . 34

Example: Aggressively Aging Out Sessions . . . 35

CPU Protection with Blacklisting DoS Attack Traffic . . . 36

Example . . . 37

Prioritizing Critical Traffic . . . 38

SYN-ACK-ACK Proxy Flood . . . 40

WebUI . . . 41

CLI . . . 42

Network DoS Attacks . . . 42

SYN Flood . . . 42

SYN Flood Protection . . . 43

WebUI . . . 44 CLI . . . 45 WebUI . . . 49 CLI . . . 50 SYN Cookie . . . 51 WebUI . . . 53 CLI . . . 53 ICMP Flood . . . 53 WebUI . . . 54 CLI . . . 54 UDP Flood . . . 54 WebUI . . . 55 CLI . . . 55 Land Attack . . . 55 WebUI . . . 56 CLI . . . 56

OS-Specific DoS Attacks . . . 56

Ping of Death . . . 56

(7)

WinNuke . . . 58

WebUI . . . 59

CLI . . . 59

Chapter 4 Content Monitoring and Filtering . . . 61

Fragment Reassembly . . . 61

Malicious URL Protection . . . 61

Application Layer Gateway . . . 63

Example: Blocking Malicious URLs in Packet Fragments . . . 64

Antivirus Scanning . . . 65

External AV Scanning . . . 65

Scanning Modes . . . 66

Load-Balancing ICAP Scan Servers . . . 67

Internal AV Scanning . . . 67

AV Scanning of IM Traffic . . . 68

IM Clients . . . 68

IM Server . . . 69

IM Protocols . . . 70

Instant Messaging Security Issues . . . 70

IM Security Issues . . . 70

Scanning Chat Messages . . . 71

Scanning File Transfers . . . 71

AV Scanning Results . . . 72

Policy-Based AV Scanning . . . 73

Scanning Application Protocols . . . 74

Scanning FTP Traffic . . . 75

Scanning HTTP Traffic . . . 76

Scanning IMAP and POP3 Traffic . . . 79

Scanning SMTP Traffic . . . 80

Redirecting Traffic to ICAP AV Scan Servers . . . 82

Updating the AV Pattern Files for the Embedded Scanner . . . 83

Subscribing to the AV Signature Service . . . 83

Updating AV Patterns from a Server Updating AV Patterns from a Server . . . 84

Updating AV Patterns from a Proxy Server Updating AV Patterns from a Proxy Server . . . 86

AV Scanner Global Settings . . . 86

AV Resource Allotment . . . 87

Fail-Mode Behavior . . . 87

AV Warning Message . . . 87

AV Notify Mail . . . 88

Maximum Content Size and Maximum Messages (Internal AV Only) . . 89

HTTP Keep-Alive . . . 89

HTTP Trickling (Internal AV Only) . . . 90

AV Profiles . . . 91

Assigning an AV Profile to a Firewall Policy . . . 92

Initiating an AV Profile for Internal AV . . . 93

Example: (Internal AV) Scanning for All Traffic Types . . . 93

(8)

AV Profile Settings . . . 95

Antispam Filtering . . . 99

Blacklists and Whitelists . . . 100

Basic Configuration . . . 100

Filtering Spam Traffic . . . 101

Dropping Spam Messages Dropping Spam Messages . . . 101

Defining a Blacklist . . . 101

Defining a Whitelist . . . 102

Defining a Default Action . . . 102

Enabling a Spam-Blocking List Server . . . 102

Testing Antispam . . . 103

Web Filtering . . . 103

Using the CLI to Initiate Web-Filtering Modes . . . 104

Integrated Web Filtering . . . 105

SurfControl Servers . . . 106

Web-Filtering Cache . . . 106

Configuring Integrated Web Filtering . . . 107

Example: Integrated Web Filtering . . . 112

Redirect Web Filtering . . . 114

Virtual System Support . . . 116

Configuring Redirect Web Filtering . . . 116

Example: Redirect Web Filtering . . . 119

Chapter 5 Deep Inspection . . . 123

Overview . . . 123

Attack Object Database Server . . . 127

Predefined Signature Packs . . . 127

Updating Signature Packs . . . 128

Before You Start Updating Attack Objects . . . 129

Immediate Update . . . 129

Automatic Update . . . 130

Automatic Notification and Immediate Update . . . 131

Manual Update . . . 132

Updating DI Patterns from a Proxy Server . . . 134

Attack Objects and Groups . . . 135

Supported Protocols . . . 136

Stateful Signatures . . . 139

TCP Stream Signatures . . . 140

Protocol Anomalies . . . 140

Attack Object Groups . . . 141

Changing Severity Levels . . . 141

Disabling Attack Objects . . . 142

WebUI . . . 143

CLI . . . 143

(9)

Attack Actions . . . 143

Example: Attack Actions—Close Server, Close, Close Client . . . 144

WebUI . . . 146

CLI . . . 149

Brute Force Attack Actions . . . 151

Brute Force Attack Objects . . . 151

Brute Force Attack Target . . . 152

Brute Force Attack Timeout . . . 152

Example 1 . . . 153

Example 2 . . . 153

Example 3 . . . 153

Attack Logging . . . 154

Example: Disabling Logging per Attack Group . . . 154

WebUI . . . 154

CLI . . . 155

Mapping Custom Services to Applications . . . 155

Example: Mapping an Application to a Custom Service . . . 156

WebUI . . . 157

CLI . . . 158

Example: Application-to-Service Mapping for HTTP Attacks . . . 158

WebUI . . . 159

CLI . . . 159

Customized Attack Objects and Groups . . . 160

User-Defined Stateful Signature Attack Objects . . . 160

Regular Expressions . . . 160

Example: User-Defined Stateful Signature Attack Objects . . . 162

TCP Stream Signature Attack Objects . . . 164

Example: User-Defined Stream Signature Attack Object . . . 165

Configurable Protocol Anomaly Parameters . . . 166

Example: Modifying Parameters . . . 166

Negation . . . 167

Example: Attack Object Negation . . . 168

WebUI . . . 169

CLI . . . 171

Granular Blocking of HTTP Components . . . 171

ActiveX Controls . . . 172

Java Applets . . . 172

EXE Files . . . 173

ZIP Files . . . 173

Example: Blocking Java Applets and .exe Files . . . 173

Chapter 6 Intrusion Detection and Prevention . . . 175

IDP-Capable Security Devices . . . 175

Traffic Flow in an IDP-Capable Device . . . 176

Configuring Intrusion Detection and Prevention . . . 179

Preconfiguration Tasks . . . 179

Example 1: Basic IDP Configuration . . . 180

Example 2: Configuring IDP for Active/Passive Failover . . . 182

(10)

Configuring Security Policies . . . 186

About Security Policies . . . 186

Managing Security Policies . . . 186

Installing Security Policies . . . 187

Using IDP Rulebases . . . 187

Role-Based Administration of IDP Rulebases . . . 188

Configuring Objects for IDP Rules . . . 188

Using Security Policy Templates . . . 189

Enabling IDP in Firewall Rules . . . 189

Enabling IDP . . . 190

Specifying Inline or Inline Tap Mode . . . 190

Configuring IDP Rules . . . 191

Adding the IDP Rulebase . . . 192

Matching Traffic . . . 195

Source and Destination Zones . . . 195

Source and Destination Address Objects . . . 196

Example: Setting Source and Destination . . . 196

Example: Setting Multiple Sources and Destinations . . . 197

User Role . . . 197

Example : Setting user-roles . . . 197

Services . . . 198

Example: Setting Default Services . . . 198

Example: Setting Specific Services . . . 199

Example: Setting Nonstandard Services . . . 199

Terminal Rules . . . 201

Example: Setting Terminal Rules . . . 202

Defining Actions . . . 203

Setting Attack Objects . . . 204

Adding Attack Objects Individually . . . 205

Adding Attack Objects by Category . . . 205

Example: Adding Attack Objects by Service . . . 205

Adding Attack Objects by Operating System . . . 205

Adding Attack Objects by Severity . . . 205

Setting IP Actions . . . 206

Choosing an IP Action . . . 207

Choosing a Blocking Option . . . 207

Setting Logging Options . . . 207

Setting Timeout Options . . . 207

(11)

Configuring Exempt Rules . . . 209

Adding the Exempt Rulebase . . . 210

Defining a Match . . . 212

Source and Destination Zones . . . 212

Source and Destination Address Objects . . . 213

Example: Exempting a Source/Destination Pair . . . 213

Setting Attack Objects . . . 213

Example: Exempting Specific Attack Objects . . . 214

Setting Targets . . . 214

Entering Comments . . . 214

Creating an Exempt Rule from the Log Viewer . . . 214

Configuring Backdoor Rules . . . 215

Adding the Backdoor Rulebase . . . 216

Defining a Match . . . 218

Source and Destination Zones . . . 218

Source and Destination Address Objects . . . 219

Services . . . 219

Setting the Operation . . . 219

Setting Actions . . . 219 Setting Notification . . . 220 Setting Logging . . . 220 Setting an Alert . . . 220 Logging Packets . . . 220 Setting Severity . . . 221 Setting Targets . . . 221 Entering Comments . . . 221

Configuring IDP Attack Objects . . . 221

About IDP Attack Object Types . . . 222

Signature Attack Objects . . . 222

Protocol Anomaly Attack Objects . . . 222

Compound Attack Objects . . . 222

Viewing Predefined IDP Attack Objects and Groups . . . 222

Viewing Predefined Attacks . . . 223

Viewing Predefined Groups . . . 224

Creating Custom IDP Attack Objects . . . 225

Creating a Signature Attack Object . . . 226

Creating a Protocol Anomaly Attack . . . 232

Creating a Compound Attack . . . 233

Editing a Custom Attack Object . . . 236

Deleting a Custom Attack Object . . . 236

Creating Custom IDP Attack Groups . . . 236

Configuring Static Groups . . . 236

Configuring Dynamic Groups . . . 237

Example: Creating a Dynamic Group . . . 238

Updating Dynamic Groups . . . 240

Editing a Custom Attack Group . . . 241

(12)

Configuring the Device as a Standalone IDP Device . . . 241

Enabling IDP . . . 241

Example: Configuring a Firewall Rule for Standalone IDP . . . 242

Configuring Role-Based Administration . . . 243

Example: Configuring an IDP-Only Administrator . . . 243

Managing IDP . . . 245

About Attack Database Updates . . . 245

Downloading Attack Database Updates . . . 245

Using Updated Attack Objects . . . 245

Updating the IDP Engine . . . 246

Viewing IDP Logs . . . 248

ISG-IDP Devices . . . 248

Compiling a Policy . . . 248

Policy Size Multiplier . . . 249

User-Role-Based IDP Policies . . . 250

Unloading Existing Policies . . . 250

CPU Usage Monitoring and Event Log . . . 251

CPU Usage . . . 251

Event Log . . . 252

Core dump files . . . 253

Chapter 7 Suspicious Packet Attributes . . . 255

ICMP Fragments . . . 255

WebUI . . . 256

CLI . . . 256

Large ICMP Packets . . . 256

WebUI . . . 257 CLI . . . 257 Bad IP Options . . . 257 WebUI . . . 258 CLI . . . 258 Unknown Protocols . . . 258 WebUI . . . 259 CLI . . . 259 IP Packet Fragments . . . 259 WebUI . . . 260 CLI . . . 260 SYN Fragments . . . 260 WebUI . . . 261 CLI . . . 261

Part 2

Appendix

Appendix A Contexts for User-Defined Signatures . . . 265

(13)

List of Figures

About This Guide . . . xix

Figure 1: Images in Illustrations . . . xxii

Part 1

Attack Detection and Defense Mechanisms

Chapter 2 Reconnaissance Deterrence . . . 9

Figure 2: Address Sweep . . . 10

Figure 3: Port Scan . . . 11

Figure 4: TCP/UDP Sweep Protection . . . 12

Figure 5: Routing Options . . . 13

Figure 6: TCP Header with SYN and FIN Flags Set . . . 16

Figure 7: TCP Header with FIN Flag Set . . . 17

Figure 8: TCP Header with No Flags Set . . . 17

Figure 9: SYN Flag Checking . . . 20

Figure 10: Layer 3 IP Spoofing . . . 23

Figure 11: Layer 2 IP Spoofing . . . 24

Figure 12: Example of Layer 3 IP Spoofing . . . 25

Figure 13: IP Source Routing . . . 28

Figure 14: Loose IP Source Route Option for Deception . . . 29

Chapter 3 Denial of Service Attack Defenses . . . 31

Figure 15: Limiting Sessions Based on Source IP Address . . . 32

Figure 16: Distributed DOS Attack . . . 33

Figure 17: TCP Session Timeout . . . 35

Figure 18: HTTP Session Timeout . . . 35

Figure 19: Aging Out Sessions Aggressively . . . 36

Figure 20: SYN-ACK-ACK Proxy Flood . . . 41

Figure 21: SYN Flood Attack . . . 42

Figure 22: Proxying SYN Segments . . . 43

Figure 23: Rejecting New SYN Segments . . . 44

Figure 24: Device-Level SYN Flood Protection . . . 47

Figure 25: Establishing a Connection with SYN Cookie Active . . . 52

Figure 26: ICMP Flooding . . . 53

Figure 27: UDP Flooding . . . 54

Figure 28: Land Attack . . . 55

Figure 29: Ping of Death . . . 56

Figure 30: Teardrop Attacks . . . 57

Figure 31: Fragment Discrepancy . . . 57

Figure 32: WinNuke Attack Indicators . . . 59

(14)

Figure 33: How External Scanning Works . . . 66

Figure 34: How the AV Profile Works with the AV Scanner . . . 74

Figure 35: Antivirus Scanning for FTP Traffic . . . 76

Figure 36: Antivirus Scanning for HTTP Traffic . . . 78

Figure 37: Antivirus Scanning for IMAP and POP3 Traffic . . . 80

Figure 38: Antivirus Scanning for SMTP Traffic . . . 82

Figure 39: Updating Pattern Files—Step 1 . . . 84

Figure 40: Updating Pattern Files—Step 2 . . . 84

Figure 41: Web-Filtering Profiles and Policies Flowchart . . . 112

Figure 42: A Blocked URL from Trust Zone to Untrust Zone . . . 115

Figure 43: A Permitted URL from Trust Zone to Untrust Zone . . . 115

Chapter 5 Deep Inspection . . . 123

Figure 44: Stateful Firewall Inspection . . . 124

Figure 45: Firewall Inspection Versus Deep Inspection . . . 125

Figure 46: DI Component in the Set Policy Command . . . 126

Figure 47: Updating DI Signatures Immediately . . . 130

Figure 48: Updating DI Signatures Automatically . . . 131

Figure 49: Notifying Signature Updates . . . 132

Figure 50: Updating DI Signatures Manually . . . 133

Figure 51: Attack Objects and Groups . . . 135

Figure 52: DI Attack Actions . . . 146

Figure 53: Mapping Custom Service . . . 156

Figure 54: Mapping Custom Service to Attack Object Group . . . 156

Figure 55: Example of a TCP Stream Signature Attack Object . . . 165

Figure 56: Attack Object Negation . . . 169

Chapter 6 Intrusion Detection and Prevention . . . 175

Figure 57: Traffic Flow in the Security Device . . . 177

Figure 58: Setting Up the Device for Basic IDP . . . 180

Figure 59: Configuring IDP for Active/Passive Failover . . . 183

Figure 60: Configuring IDP for Active/Active Failover . . . 184

Figure 61: DI Profile/Enable IDP Dialog Box . . . 190

Figure 62: Adding an IDP Rulebase . . . 193

Figure 63: IDP Rulebase Added . . . 194

Figure 64: IDP Rule Added . . . 195

Figure 65: Set Source and Destination . . . 196

Figure 66: Set Multiple Source and Destination Networks . . . 197

Figure 67: Firewall configuration for user-role based policies . . . 197

Figure 68: Setting user-roles . . . 198

Figure 69: Set Default Services . . . 199

Figure 70: Set Specific Services . . . 199

Figure 71: Add Nonstandard Services Object . . . 200

Figure 72: Set Nonstandard Service . . . 201

(15)

Figure 79: Exempting a Log Record Rule . . . 215

Figure 80: Adding the Backdoor Rulebase . . . 217

Figure 81: Backdoor Rule Added . . . 218

Figure 82: Attack Viewer . . . 224

Figure 83: Custom Attack Dialog Box . . . 225

Figure 84: New Dynamic Group . . . 239

Figure 85: New Dynamic Group Members . . . 240

Figure 86: Firewall Rule for Standalone IDP . . . 242

Figure 87: IDP Rules for Standalone IDP . . . 243

Figure 88: UI Display for IDP_Administrator . . . 244

Figure 89: Attack Update Summary . . . 247

Figure 90: ISG-IDP Policy Compilation . . . 249

Chapter 7 Suspicious Packet Attributes . . . 255

Figure 91: Blocking ICMP Fragments . . . 256

Figure 92: Blocking Large ICMP Packets . . . 257

Figure 93: Incorrectly Formatted IP Options . . . 258

Figure 94: Unknown Protocols . . . 259

Figure 95: IP Packet Fragments . . . 260

(16)
(17)

List of Tables

Part 1

Attack Detection and Defense Mechanisms

Chapter 2 Reconnaissance Deterrence . . . 9

Table 1: IP Options and Attributes . . . 13

Table 2: Strict SYN Checking Rules . . . 20

Chapter 3 Denial of Service Attack Defenses . . . 31

Table 3: SYN Flood Protection Parameters . . . 48

Chapter 4 Content Monitoring and Filtering . . . 61

Table 4: Entering and Exiting Web-Filtering Modes . . . 104

Table 5: Partial List of SurfControl URL Categories . . . 108

Chapter 5 Deep Inspection . . . 123

Table 6: Predefined Signature Packs . . . 127

Table 7: URLs for Predefined Signature Packs . . . 128

Table 8: Basic Network Protocols . . . 136

Table 9: Instant Messaging Applications . . . 138

Table 10: Application Layer Gateways (ALGs) . . . 138

Table 11: Attack Object Severity Levels . . . 141

Table 12: Brute Force Attack Objects . . . 151

Table 13: Target Options . . . 152

Table 14: ScreenOS Supported Regular Expressions . . . 160

Table 15: User-Defined Stateful Signature Attack Objects . . . 162

Chapter 6 Intrusion Detection and Prevention . . . 175

Table 16: IDP Actions for ESP-NULL Traffic . . . 178

Table 17: IDP Rule Actions . . . 203

Table 18: Severity Levels with Recommended Actions and Notifications . . . 206

Table 19: Actions for Backdoor Rule . . . 219

Table 20: Attack Pattern Expressions . . . 228

Table 21: Service Context for Signature Attacks . . . 228

Part 2

Appendix

Table 22: Contexts for User-Defined Signatures . . . 265

Appendix A Contexts for User-Defined Signatures . . . 265

(18)
(19)

About This Guide

This guide describes the Juniper Networks security options available in ScreenOS. You can enable many of these options at the security zone level. These options apply to traffic reaching the Juniper Networks security device through any interface bound to a zone for which you have enabled such options. These options offer protection against IP address and port scans, denial of service (DoS) attacks, and other kinds of malicious activity. You can apply other network security options, such as Web filtering, antivirus checking, and intrusion detection and prevention (IDP), at the policy level. These options only apply to traffic under the jurisdiction of the policies in which they are enabled.

NOTE: The subject of policies is presented only peripherally in this volume, as it applies to the network security options that you can enable at the policy level. For a complete examination of policies, see“Policies” on page 2-161.

This guide contains the following sections:

• “Protecting a Network” on page 3outlines the basic stages of an attack and the firewall options available to combat the attacker at each stage.

• “Reconnaissance Deterrence” on page 9describes the options available for blocking IP address sweeps, port scans, and attempts to discover the type of operating system (OS) of a targeted system.

• “Denial of Service Attack Defenses” on page 31explains firewall, network, and OS-specific DoS attacks and how ScreenOS mitigates such attacks.

• “Content Monitoring and Filtering” on page 61describes how to protect users from malicious uniform resource locators (URLs) and how to configure the Juniper Networks security device to work with third-party products to provide antivirus scanning, antispam, and Web filtering.

• “Deep Inspection” on page 123describes how to configure the Juniper Networks security device to obtain Deep Inspection (DI) attack object updates, how to create user-defined attack objects and attack object groups, and how to apply DI at the policy level. • “Intrusion Detection and Prevention” on page 175describes Juniper Networks Intrusion

(20)

• “Suspicious Packet Attributes” on page 255presents several SCREEN options that protect network resources from potential attacks indicated by unusual IP and ICMP packet attributes.

• Appendix, Contexts for User Defined Signatures provides descriptions of contexts that you can specify when defining a stateful signature attack object.

• Document Conventions on page xx

• Document Feedback on page xxii

• Requesting Technical Support on page xxii

Document Conventions

This document uses the conventions described in the following sections:

• Web User Interface Conventions on page xx

• Command Line Interface Conventions on page xx

• Naming Conventions and Character Types on page xxi

• Illustration Conventions on page xxii Web User Interface

Conventions

The Web user interface (WebUI) contains a navigational path and configuration settings. To enter configuration settings, begin by clicking a menu item in the navigation tree on the left side of the screen. As you proceed, your navigation path appears at the top of the screen, with each page separated by angle brackets.

The following example shows the WebUI path and parameters for defining an address:

Policy > Policy Elements > Addresses > List > New: Enter the following, then click OK:

Address Name: addr_1 IP Address/Domain Name:

IP/Netmask: (select), 10.2.2.5/32 Zone: Untrust

To open Online Help for configuration settings, click the question mark (?) in the upper right of the screen.

The navigation tree also provides a Help > Config Guide configuration page to help you configure security policies and Internet Protocol Security (IPSec). Select an option from the list, and follow the instructions on the page. Click the ? character in the upper right for Online Help on the Config Guide.

Command Line Interface Conventions

The following conventions are used to present the syntax of command line interface (CLI) commands in text and examples.

(21)

Variables are in italic type.

• Anything inside square brackets [ ] is optional. • Anything inside braces { } is required.

• If there is more than one choice, each choice is separated by a pipe ( | ). For example, the following command means “set the management options for the ethernet1, the ethernet2, or the ethernet3 interface”:

set interface { ethernet1 | ethernet2 | ethernet3 } manage

NOTE: When entering a keyword, you only have to type enough letters to identify the word uniquely. Typing set adm u whee j12fmt54 will enter the command set admin user wheezer j12fmt54. However, all the commands documented in this guide are presented in their entirety.

Naming Conventions and Character Types

ScreenOS employs the following conventions regarding the names of objects—such as addresses, admin users, auth servers, IKE gateways, virtual systems, VPN tunnels, and zones—defined in ScreenOS configurations:

• If a name string includes one or more spaces, the entire string must be enclosed within double quotes; for example:

set address trust “local LAN” 10.1.1.0/24

• Any leading spaces or trailing text within a set of double quotes are trimmed; for example, “local LAN ” becomes “local LAN”.

• Multiple consecutive spaces are treated as a single space.

• Name strings are case-sensitive, although many CLI keywords are case-insensitive. For example, “local LAN” is different from “local lan”.

ScreenOS supports the following character types:

• Single-byte character sets (SBCS) and multiple-byte character sets (MBCS). Examples of SBCS are ASCII, European, and Hebrew. Examples of MBCS—also referred to as double-byte character sets (DBCS)—are Chinese, Korean, and Japanese.

• ASCII characters from 32 (0x20 in hexadecimals) to 255 (0xff), except double quotes ( “), which have special significance as an indicator of the beginning or end of a name string that includes spaces.

NOTE: A console connection only supports SBCS. The WebUI supports both SBCS and MBCS, depending on the character sets that your browser supports.

(22)

Illustration Conventions

Figure 1 on page xxiishows the basic set of images used in illustrations throughout this volume.

Figure 1: Images in Illustrations

Document Feedback

If you find any errors or omissions in this document, contact Juniper Networks at [email protected].

Requesting Technical Support

Technical product support is available through the Juniper Networks Technical Assistance Center (JTAC). If you are a customer with an active J-Care or JNASC support contract, or are covered under warranty, and need postsales technical support, you can access our tools and resources online or open a case with JTAC.

(23)

• JTAC hours of operation—The JTAC centers have resources available 24 hours a day, 7 days a week, 365 days a year.

Self-Help Online Tools and Resources

For quick and easy problem resolution, Juniper Networks has designed an online self-service portal called the Customer Support Center (CSC) that provides you with the following features:

• Find CSC offerings—http://www.juniper.net/customers/support/

• Search for known bugs—Find product

documentation—http://www.juniper.net/techpubs/

• Find solutions and answer questions using our Knowledge Base—http://kb.juniper.net/

• Download the latest versions of software and review your release notes— http://www.juniper.net/customers/csc/software/

• Search technical bulletins for relevant hardware and software notifications— http://www.juniper.net/alerts/

• Join and participate in the Juniper Networks Community Forum— http://www.juniper.net/company/communities/

• Open a case online in the CSC Case Manager— http://www.juniper.net/customers/cm/

• To verify service entitlement by product serial number, use our Serial Number Entitlement (SNE) Tool—

https://tools.juniper.net/SerialNumberEntitlementSearch/

Opening a Case with JTAC

You can open a case with JTAC on the Web or by telephone.

• Use the Case Manager tool in the CSC athttp://www.juniper.net/customers/cm/. • Call 1-888-314-JTAC (1-888-314-5822—toll free in USA, Canada, and Mexico).

For international or direct-dial options in countries without toll-free numbers, visit us at http://www.juniper.net/customers/support/requesting-support/.

(24)
(25)

PART 1

Attack Detection and Defense

Mechanisms

• Protecting a Network on page 3

• Reconnaissance Deterrence on page 9

• Denial of Service Attack Defenses on page 31

• Content Monitoring and Filtering on page 61

• Deep Inspection on page 123

• Intrusion Detection and Prevention on page 175

(26)
(27)

CHAPTER 1

Protecting a Network

There can be many reasons for invading a protected network. The following list contains some common objectives:

• Gathering the following kinds of information about the protected network: • Topology

• IP addresses of active hosts

• Numbers of active ports on active hosts

• Operating systems of active hosts

• Overwhelming a host on a protected network with bogus traffic to induce a denial of service (DoS)

• Overwhelming the protected network with bogus traffic to induce a network-wide DoS • Overwhelming a firewall with bogus traffic to induce a denial of service (DoS) for the

network behind it

• Causing damage to and stealing data from a host on a protected network • Gaining access to a host on a protected network to obtain information • Gaining control of a host to launch other exploits

• Gaining control of a firewall to control access to the network that it protects

ScreenOS provides detective and defensive tools for uncovering and thwarting the efforts of attackers to achieve the above objectives when they attempt to target a network protected by a Juniper Networks security device.

This chapter presents an overview of the main stages of an attack and the various defense mechanisms that you can employ to thwart an attack at each stage:

• Stages of an Attack on page 4

• Detection and Defense Mechanisms on page 4

(28)

Stages of an Attack

Each attack typically progresses in two major stages. In the first stage, the attacker gathers information, and in the second stage he or she launches the attack.

1. Perform reconnaissance.

a. Map the network and determine which hosts are active (IP address sweep). b. Discern which ports are active (port scans) on the hosts discovered by the IP

address sweep.

c. Determine the operating system (OS), which might expose a weakness in the OS or suggest an attack to which that particular OS is susceptible.

2. Launch the attack.

a. Conceal the origin of the attack. b. Perform the attack.

c. Remove or hide evidence.

Detection and Defense Mechanisms

An exploit can be an information-gathering probe or an attack to compromise, disable, or harm a network or network resource. In some cases, the distinction between the two objectives of an exploit can be unclear. For example, a barrage of TCP SYN segments might be an IP address sweep with the intent of triggering responses from active hosts, or it might be a SYN flood attack with the intent of overwhelming a network so that it can no longer function properly. Furthermore, because an attacker usually precedes an attack by performing reconnaissance on the target, we can consider information-gathering efforts as a precursor to an impending attack—that is, they constitute the first stage of an attack. Thus, the term exploit encompasses both reconnaissance and attack activities, and the distinction between the two is not always clear.

Juniper Networks provides various detection methods and defense mechanisms at the zone and policy levels to combat exploits at all stages of their execution:

• SCREEN options at the zone level

(29)

NOTE: Although the VLAN and MGT zones are function zones and not security zones, you can set SCREEN options for them. The VLAN zone supports the same set of SCREEN options as a Layer 3 security zone. (Layer 2 security zones support an additional SYN flood option that Layer 3 zones do not: Drop Unknown MAC). Because the following SCREEN options do not apply to the MGT zone, they are not available for that zone: SYN flood protection, SYN-ACK-ACK proxy flood protection, HTTP component blocking, and WinNuke attack protection.

To secure all connection attempts, Juniper Networks security devices use a dynamic packet-filtering method known as stateful inspection. Using this method, the security device notes various components in the IP packet and TCP segment headers— source and destination IP addresses, source and destination port numbers, and packet sequence numbers—and maintains the state of each TCP session and pseudo UDP session traversing the firewall. (The device also modifies session states based on changing elements such as dynamic port changes or session termination.) When a responding TCP packet arrives, the device compares the information reported in its header with the state of its associated session stored in the inspection table. If they match, the responding packet is allowed to pass the firewall. If the two do not match, the packet is dropped.

ScreenOS SCREEN options secure a zone by inspecting, then allowing or denying, all connection attempts that require crossing an interface bound to that zone. The security device then applies firewall policies, which can contain content filtering and intrusion detection and prevention (IDP) components, to the traffic that passes the SCREEN filters.

A Juniper Networks firewall provides the following sets of defense mechanisms:

• Reconnaissance deterrence • IP address sweep • Port scanning

• Operating system probes

• Evasion techniques

• Content monitoring and filtering • Fragment reassembly • Antivirus scanning • Antispam filtering • Web filtering • Deep inspection • Stateful signatures • Protocol anomalies

(30)

• Granular blocking of HTTP components

• Denial of service (DoS) attack defenses • Firewall DoS attacks

• Session table flood • SYN-ACK-ACK proxy flood

• Network DoS attacks • SYN flood

• ICMP flood

• UDP flood

• OS-specific DoS attacks • Ping of death

• Teardrop attack

• WinNuke

• Suspicious packet attributes • ICMP fragments

• Large ICMP packets

• Bad IP options

• Unknown protocols

• IP packet fragments

• SYN fragments

ScreenOS network-protection settings operate at two levels: security zone and policy. The Juniper Networks security device performs reconnaissance deterrence and DoS attack defenses at the security zone level. In the area of content monitoring and filtering, the security device applies fragment reassembly at the zone level and antivirus (AV) scanning and uniform resource locator (URL) filtering at the policy level. The device applies IDP at the policy level, except for the detection and blocking of HTTP components, which occurs at the zone level. Zone-level firewall settings are SCREEN options. A network protection option set in a policy is a component of that policy.

Exploit Monitoring

(31)

If you want to gather information about an exploit, you can let it occur, monitor it, analyze it, perform forensics, and then respond according to a previously prepared incident response plan. You can instruct the security device to notify you of an exploit, but then, instead of taking action, you can have the device allow the exploit to transpire. You can then study what occurred and try to understand the attacker’s methods, strategies, and objectives. Increased understanding of the threat to the network can then allow you to better fortify your defenses. Although a smart attacker can conceal his or her location and identity, you might be able to gather enough information to discover where the attack originated. You also might be able to estimate the attacker’s capabilities. Gathering and analyzing this kind of information allows you to determine your response.

Example: Monitoring Attacks from the Untrust Zone

In this example, IP spoofing attacks from the Untrust zone have been occurring daily, usually between 21:00 and midnight. Instead of dropping the packets with the spoofed source IP addresses, you want the security device to notify you that the packets have arrived but allow them to pass, perhaps directing them to a honeypot (a decoy network server that is designed to lure attackers and then record their actions during an attack) that you have connected on the DMZ interface connection. At 20:55 PM, you change the firewall behavior from notification and rejection of packets belonging to a detected attack to notification and acceptance. When the attack occurs, you can then use the honeypot to monitor the attacker’s activity after crossing the firewall. You might also work in cooperation with the upstream ISP to begin tracking the source of the packets back to their source.

WebUI

Screening > Screen (Zone: Untrust): Enter the following, then click Apply:

Generate Alarms without Dropping Packet: (select) IP Address Spoof Protection: (select)

CLI

set zone untrust screen alarm-without-drop set zone untrust screen ip-spoofing

save

NOTE: The alarm-without-drop option does not apply to the following:

• SYN-ACK-ACK proxy protection • Source IP Based Session Limit • Destination IP Based Session Limit • Malicious URL protection

If this option is set, the device does not generate alarms and pass the packets. Instead, it drops or forwards the packet based on the inspection results.

(32)
(33)

CHAPTER 2

Reconnaissance Deterrence

Attackers can better plan their attack when they first know the layout of the targeted network (which IP addresses have active hosts), the possible entry points (which port numbers are active on the active hosts), and the constitution of their victims (which operating system the active hosts are running). To gain this information, attackers must perform reconnaissance. Juniper Networks provides several SCREEN options to deter attackers’ reconnaissance efforts and thereby hinder them from obtaining valuable information about the protected network and network resources.

• IP Address Sweep on page 9

• Port Scanning on page 10

• TCP/UDP Sweep Protection on page 11

• Network Reconnaissance Using IP Options on page 13

• Operating System Probes on page 15

• Evasion Techniques on page 18

IP Address Sweep

An address sweep occurs when one source IP address sends 10 ICMP packets to different hosts within a defined interval (5000 microseconds is the default). The purpose of this scheme is to send ICMP packets—typically echo requests—to various hosts in the hopes that at least one replies, thus uncovering an address to target. The security device internally logs the number of ICMP packets to different addresses from one remote source. Using the default settings, if a remote host sends ICMP traffic to 10 addresses in 0.005 seconds (5000 microseconds), the security device flags this as an address sweep attack, and rejects all further ICMP echo requests from that host for the remainder of the specified threshold time period. The device detects and drops the eleventh packet that meets the address sweep attack criterion. This is illustrated inFigure 2 on page 10.

(34)

Figure 2: Address Sweep

Rejected

Note:After 10 ICMP packets are received, the security device logs this as an IP address sweep and rejects the eleventh packet. Source: 2.2.2.5

(Most likely a spoofed address or zombie agent)

Dst addr 1.2.2.5 1.2.2.160 1.2.2.84 1.2.2.211 1.2.2.10 1.2.2.20 1.2.2.21 1.2.2.240 1.2.2.17 1.2.2.123 1.2.2.6 Src addr 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 ICMP Packets 11 ICMP packets within 0.005 seconds ethernet0/3 1.1.1.1/24 Untrust ethernet0/2 1.2.2.1/24 DMZ

Consider enabling this SCREEN option for a security zone only if there is a policy permitting ICMP traffic from that zone. Otherwise, you do not need to enable it. The lack of such a policy denies all ICMP traffic from that zone, precluding an attacker from successfully performing an IP address sweep anyway.

To block IP address sweeps originating in a particular security zone:

WebUI

Screening > Screen (Zone: select a zone name): Enter the following, then click Apply:

IP Address Sweep Protection: (select)

Threshold: (enter a value to trigger IP address sweep protection)

NOTE: The value unit is microseconds. The default value is 5000 microseconds.

CLI

set zone zone screen ip-sweep threshold number set zone zone screen ip-sweep

Port Scanning

(35)

The device detects and drops the eleventh packet that meets the port scan attack criterion. This is illustrated inFigure 3 on page 11.

InFigure 3 on page 11, the security device makes an entry in its session table for the first 10 connection attempts from 2.2.2.5 to destination and does a route lookup and policy lookup for these. If no policy permits these connection attempts, the device tags these as invalid and removes them from the session table in the next “garbage sweep,” which occurs every two seconds. After the eleventh attempt, the device rejects all further connection attempts.

Figure 3: Port Scan

Dst addr:port 1.2.2.5:21 1.2.2.160:23 1.2.2.84:53 1.2.2.211:80 1.2.2.10:111 1.2.2.20:113 1.2.2.21:123 1.2.2.240:129 1.2.2.17:137 1.2.2.123:138 1.2.2.6139 Src addr:port 2.2.2.5:17820 2.2.2.5:42288 2.2.2.5:22814 2.2.2.515401 2.2.2.5:13373 2.2.2.5:33811 2.2.2.5:17821 2.2.2.5:19003 2.2.2.5:26450 2.2.2.5:38087 2.2.2.5:24111 Rejected

Note:After 10 IP packets containing TCP SYN segments to different ports are received at the same destination IP address, the security device logs this as a port scan and rejects further packets from the source address.

Source: 2.2.2.5 (Most likely a spoofed address or zombie agent)

IP Packets with TCP SYN Segments

11 SYN segments within 0.005 seconds ethernet3 1.1.1.1/24 Untrust ethernet2 1.2.2.1/24 DMZ destination: 1.2.2.5

To block port scans originating in a particular security zone:

WebUI

Screening > Screen (Zone: select a zone name): Enter the following, then click Apply:

Port Scan Protection: (select)

Threshold: (enter a value to trigger protection against port scans)

NOTE: The value unit is microseconds. The default value is 5000 microseconds.

CLI

set zone zone screen port-scan threshold number set zone zone screen port-scan

TCP/UDP Sweep Protection

In a TCP Sweep attack, an attacker sends TCP SYN packets to the target device as part of the TCP handshake. If the device responds to those packets, the attacker gets an indication that a port in the target device is open, which makes the port vulnerable to

(36)

attack. Similarly, in a UDP Sweep attack, an attacker sends a UDP datagram to a UDP port. Depending on the reply, the attacker determines whether or not a port is open.

Figure 4: TCP/UDP Sweep Protection

Rejected

Note:After 10 TCP SYN packets are sent from a source IP address to multiple destination address within the specified time, the security device logs this as a TCP sweep and rejects further packets from the source address.

Dst addr 1.2.2.5 1.2.2.160 1.2.2.84 1.2.2.211 1.2.2.10 1.2.2.20 1.2.2.21 1.2.2.240 1.2.2.17 1.2.2.123 1.2.2.6 Src addr 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 2.2.2.5 TCP SYN Packets ethernet3 1.1.1.1/24 Untrust ethernet2 1.2.2.1/24 DMZ Source: 2.2.2.5 11 TCP SYN packets within .005 seconds.

To prevent these attacks, ScreenOS provides a TCP/UDP Sweep Protection SCREEN option at the security-zone level. This option limits the number of packets allowed from a source IP to a multiple IPs within a particular time frame. If the number of packets exceeds the threshold limit, the device does not establish the session.

The device maintains a source hash table for each initial packet destined for a different destination. The source hash table maintains a count of the number of attempts the source makes to reach each destination within a configured period.

If the rate of attacks from the source IP exceeds the configured threshold, the

session-establishment attempts from that particular source IP are dropped and logged. The default threshold is 50 packets per second. You can enable or disable the TCP/UDP Sweep Protection SCREEN option and set the threshold rate with the WebUI or the CLI.

WebUI:

Security > Screening > Screen (Zone: select a zone name): Enter the following, then click Apply:

TCP Sweep Protection: (select)

Threshold: (enter a value to enable the TCP Sweep Protection SCREEN option) UDP Sweep Protection: (select)

Threshold: (enter a value to enable the UDP Sweep Protection SCREEN option)

CLI:

To enable the TCP Sweep Protection SCREEN option:

(37)

set zone zone-name screen udp-sweep To set the threshold rate for UDP-SWEEP:

set zone zone-name screen udp-sweep threshold threshold rate

Network Reconnaissance Using IP Options

The Internet Protocol standard RFC 791, Internet Protocol, specifies a set of options to provide special routing controls, diagnostic tools, and security. These options appear after the destination address in an IP packet header, as shown inFigure 5 on page 13.

Figure 5: Routing Options

RFC 791 states that these options are “unnecessary for the most common

communications” and, in reality, they rarely appear in IP packet headers. When they do appear, they are frequently being put to some illegitimate use.Table 1 on page 13lists the IP options and their accompanying attributes.

Table 1: IP Options and Attributes

Nefarious Use Intended Use Length Number Class Type None. Indicates the end of one or more

IP options. 0 0 0 Designed to provide extra packet or network control End of Options None. Indicates there are no IP options

in the header. 0 1 0 No Options

Unknown. However, because it is obsolete, its presence in an IP header is suspect.

Provides a way for hosts to send security, TCC (closed user group) parameters, and Handling Restriction Codes compatible with Department of Defense (DoD) requirements. (This option, as specified in RFC 791, Internet Protocol, and RFC 1038, Revised IP Security Option, is obsolete.) 11 bits

2 0

Security

(38)

Table 1: IP Options and Attributes (continued)

Nefarious Use Intended Use Length Number Class Type

Evasion. The attacker can use the specified routes to hide the true source of a packet or to gain access to a protected network. (See“IP Source Route Options” on page 28.)

Specifies a partial route list for a packet to take on its journey from source to destination. The packet must proceed in the order of addresses specified, but it is allowed to pass through other routers in between those specified. Varies 3 0 Loose Source Route

Reconnaissance. If the destination host is a compromised machine in the attacker’s control, he or she can glean information about the topology and addressing scheme of the network through which the packet passed.

Records the IP addresses of the network devices along the path that the IP packet travels. The destination machine can then extract and process the route information. (Due to the size limitation of 40 bytes for both the option and storage space, this can only record up to 9 IP addresses.) Varies

7 0

Record Route

Unknown. However, because it is obsolete, its presence in an IP header is suspect.

(Obsolete) Provided a way for the 16-bit SATNET stream identifier to be carried through networks that did not support the stream concept.

4 bits 8

0 Stream ID

Evasion. An attacker can use the specified routes to hide the true source of a packet or to gain access to a protected network. (See“IP Source Route Options” on page 28.)

Specifies the complete route list for a packet to take on its journey from source to destination. The last address in the list replaces the address in the destination field. Varies 9 0 Strict Source Route

Reconnaissance. If the destination host is a compromised machine in the attacker’s control, he or she can glean information about the topology and addressing scheme of the network through which the packet passed.

Records the time (in Universal Time) when each network device receives the packet during its trip from the point of origin to its destination. The timestamp uses the number of milliseconds since midnight UT. The network devices are identified by IP number. This option develops a list of IP addresses of the routers along the path of the packet and the duration of transmission between each one. 4 2 Designed to provide diagnostics, debugging, and measurement. Timestamp

(39)

• Record Route: The security device detects packets where the IP option is 7 (Record Route) and records the event in the SCREEN counters list for the ingress interface. • Timestamp: The security device detects packets where the IP option list includes

option 4 (Internet Timestamp) and records the event in the SCREEN counters list for the ingress interface.

• Security: The security device detects packets where the IP option is 2 (security) and records the event in the SCREEN counters list for the ingress interface.

• Stream ID: The security device detects packets where the IP option is 8 (Stream ID) and records the event in the SCREEN counters list for the ingress interface.

To detect packets with the above IP options set, do either of the following, where the specified security zone is the one from which the packets originate:

WebUI

Screening > Screen (Zone: select a zone name): Enter the following, then click Apply:

IP Record Route Option Detection: (select) IP Timestamp Option Detection: (select) IP Security Option Detection: (select) IP Stream Option Detection: (select)

CLI

set zone zone screen ip-record-route set zone zone screen ip-timestamp-opt set zone zone screen ip-security-opt set zone zone screen ip-stream-opt

Operating System Probes

Before launching an exploit, an attacker might try to probe the targeted host to learn its operating system (OS). With that knowledge, he can better decide which attack to launch and which vulnerabilities to exploit. A Juniper Networks security device can block reconnaissance probes commonly used to gather information about OS types.

SYN and FIN Flags Set

Both the SYN and FIN control flags are not normally set in the same TCP segment header. The SYN flag synchronizes sequence numbers to initiate a TCP connection. The FIN flag indicates the end of data transmission to finish a TCP connection. Their purposes are mutually exclusive. A TCP header with the SYN and FIN flags set is anomalous TCP behavior, causing various responses from the recipient, depending on the OS. SeeFigure 6 on page 16.

(40)

Figure 6: TCP Header with SYN and FIN Flags Set

An attacker can send a segment with both flags set to see what kind of system reply is returned and thereby determine what kind of OS is on the receiving end. The attacker can then use any known system vulnerabilities for further attacks.

When you enable this SCREEN option, the security device checks if the SYN and FIN flags are set in TCP headers. If it discovers such a header, it drops the packet.

To block packets with both the SYN and FIN flags set, do either of the following, where the specified security zone is the one from which the packets originate:

WebUI

Screening > Screen (Zone: select a zone name): Select SYN and FIN Bits Set Protection, then click Apply.

CLI

set zone zone screen syn-fin

FIN Flag Without ACK Flag

Figure 7 on page 17shows TCP segments with the FIN control flag set (to signal the conclusion of a session and terminate the connection). Normally, TCP segments with the FIN flag set also have the ACK flag set (to acknowledge the previous packet received). Because a TCP header with the FIN flag set but not the ACK flag is anomalous TCP behavior, there is no uniform response to this. The OS might respond by sending a TCP segment with the RST flag set. Another might completely ignore it. The victim’s response can provide the attacker with a clue as to its OS. (Other purposes for sending a TCP segment with the FIN flag set are to evade detection while performing address and port scans and to evade defenses on guard for a SYN flood by performing a FIN flood instead. For information about FIN scans, see“FIN Scan” on page 18.)

(41)

Figure 7: TCP Header with FIN Flag Set

When you enable this SCREEN option, the security device checks if the FIN flag is set but not the ACK flag in TCP headers. If it discovers a packet with such a header, it drops the packet.

To block packets with the FIN flag set but not the ACK flag, do either of the following, where the specified security zone is the one from which the packets originate:

WebUI

Screening > Screen (Zone: select a zone name): Select FIN Bit with No ACK Bit in Flags Protection, then click Apply.

CLI

set zone zone screen fin-no-ack

TCP Header Without Flags Set

A normal TCP segment header has at least one flag control set. A TCP segment with no control flags set is an anomalous event. Because different operating systems respond differently to such anomalies, the response (or lack of response) from the targeted device can provide a clue as to the type of OS it is running. SeeFigure 8 on page 17.

Figure 8: TCP Header with No Flags Set

When you enable the security device to detect TCP segment headers with no flags set, the device drops all TCP packets with a missing or malformed flags field.

(42)

To block packets with no flags set, do either of the following, where the specified security zone is the one from which the packets originate:

WebUI

Screening > Screen (Zone: select a zone name): Select TCP Packet without Flag Protection, then click Apply.

CLI

set zone zone screen tcp-no-flag

Evasion Techniques

Whether gathering information or launching an attack, it is generally expected that the attacker avoids detection. Although some IP address and port scans are blatant and easily detectable, more wily attackers use a variety of means to conceal their activity. Such techniques as using FIN scans instead of SYN scans—which attackers know most firewalls and intrusion detection programs detect—indicate an evolution of reconnaissance and exploit techniques to evade detection and successfully accomplish their tasks.

FIN Scan

A FIN scan sends TCP segments with the FIN flag set in an attempt to provoke a response (a TCP segment with the RST flag set) and thereby discover an active host or an active port on a host. An attacker might use this approach rather than perform an address sweep with ICMP echo requests or an address scan with SYN segments because he or she knows that many firewalls typically guard against the latter two approaches—but not necessarily against FIN segments. The use of TCP segments with the FIN flag set might evade detection and thereby help the attacker succeed in his or her reconnaissance efforts.

To thwart a FIN scan, you can do either or both of the following:

• Enable the SCREEN option that specifically blocks TCP segments with the FIN flag set but not the ACK flag, which is anomalous for a TCP segment:

WebUI: Screening > Screen: Select the zone to which you want to apply this SCREEN option from the Zone drop-down list, then select FIN Bit With No ACK Bit in Flags Protection.

CLI: Enter set zone name screen fin-no-ack, in which name is the name of the zone to which you want to apply this SCREEN option.

• Change the packet processing behavior to reject all non-SYN packets that do not belong to an existing session by entering the CLI command: set flow tcp-syn-check. (For more information about SYN flag checking, see“Non-SYN Flags” on page 19.) • The set flow tcp-syn-bit-check command checks the SYN bit but does not refresh

(43)

• The set flow tcp-syn-check-in-tunnel command enables SYN check for tunnel traffic. The set flow tcp-syn-check-in-tunnel command causes the PPU to check the SYN bit. If you disable this command, all SYN packets, tunnel and nontunnel will be sent to the CPU for processing.

NOTE: Changing the packet flow to check that the SYN flag is set for packets that do not belong to existing sessions also thwarts other types of non-SYN scans, such as a null scan (when no TCP flags are set).

Non-SYN Flags

By default, the security device checks for SYN flags in the first packet of a session and rejects any TCP segments with non-SYN flags attempting to initiate a session. You can leave this packet flow as is or change it to so that the device does not enforce SYN flag checking before creating a session.Figure 9 on page 20illustrates packet flow sequences when SYN flag checking is enabled and when it is disabled.

NOTE: By default, checking for the TCP SYN flag in the initial packet of a session is enabled when you install a Juniper Networks security device running ScreenOS 5.1.0 or higher. If you upgrade from a release prior to ScreenOS 5.1.0, SYN checking remains disabled by default—unless you have previously changed the default behavior.

These packet flows are the same whether the ingress interface is operating at Layer 3 (route or NAT mode) or at Layer 2 (transparent mode).

(44)

Figure 9: SYN Flag Checking

When the security device with SYN flag checking enabled receives a non-SYN TCP segment that does not belong to an existing session, it drops the packet and sends the source host to a TCP RST—unless the code bit of the initial non-SYN TCP packet is also RST. In that case, the security device simply drops the packet.

You can enable and disable SYN checking with the following CLI commands:

set flow tcp-syn-check unset flow tcp-syn-check

In addition to normal SYN checking, you can configure the security device to do strict SYN checking on all the packets by using the strict option with the set flow tcp-syn-check command.

set flow tcp-syn-check strict

When the strict feature is enabled, the security device rejects or allows the packets depending on the phase and direction of the packets as explained in the following table:

Table 2: Strict SYN Checking Rules

Others RST ACK+FIN ACK SYN+ACK SYN Phase direction phase Deny Allow Deny Deny Deny Allow client —> server Phase 1: After receiving the first

(45)

Table 2: Strict SYN Checking Rules (continued)

Deny Allow Deny Deny Allow Deny server —> client Allow Allow Allow Allow Allow Allow client —> server Phase 3: After receiving the ACK

or ACK+FIN packet from client

Allow Allow Allow Allow Allow Allow server —> client

When the strict check rule is enabled, two counters pass-cnt and drop-cnt log the number of packets allowed and denied respectively, by the strict check rule option. If the sum of the number of packets in pass-cnt and drop-cnt per session reaches 21, the time-out of that session will be set to 2 seconds. Packets that arrive within 2 seconds will be dropped and drop-cnt will work until session terminates.

When strict checking is enabled, the output of the following commands display details of the number of packets allowed and denied because of the strict checkfeature: get session id, get session hardware, get counter statistics interface, and get asic ppu tcp3–way-checkFor example, the output of get asic ppu tcp-3way-check displays the number of packets dropped because this feature is enabled.

get asic ppu tcp-3way-check Show ASIC 1 PPU information: total input: 0, total fwd: 0 total drop: 0, redirect to client: 0 packet from server: 0, msg send to server: 0 msg rcv stage 4: 0, msg rcv stage 5: 0 msg rcv stage 6: 0

Invalid session count: 0, syn bit check drop: 0 strict syn check drop: 9

Not checking for the SYN flag in the first packets offers the following advantages:

• NSRP with Asymmetric Routing: In an Active/Active NSRP configuration in a dynamic routing environment, a host might send the initial TCP segment with the SYN flag set to one security device (Device-A) but the SYN/ACK might be routed to the other security device in the cluster (Device-B). If this asymmetric routing occurs after Device-A has synchronized its session with Device-B, all is well. On the other hand, if the SYN/ACK response reaches Device-B before Device-A synchronizes the session and SYN checking is enabled, Device-B rejects the SYN/ACK, and the session cannot be established. With SYN checking disabled, Device-B accepts the SYN/ACK response—even though there is no existing session to which it belongs—and creates a new session table entry for it. • Uninterrupted Sessions: If SYN checking is enabled and you add a security device

operating in transparent mode to a working network, it disrupts all existing sessions, which must then be restarted. For lengthy sessions, such as large data transfers or database backups, this can be a troublesome disruption. Similarly, if you reset the device or even change a component in the core section of a policy and SYN checking is enabled, all existing sessions or those sessions to which the policy change applies are disrupted and must be restarted. Disabling SYN checking avoids such disruptions to network traffic flows.

(46)

NOTE: A solution to this scenario is to install the security device with SYN checking disabled initially. Then, after a few hours—when established sessions are running through the device—enable SYN checking.

The core section in a policy contains the following main components: source and destination zones, source and destination addresses, one or more services, and an action.

However, note that the above advantages exact the following security sacrifices:

• Reconnaissance Holes: When an initial TCP segment with a non-SYN flag—such as ACK, URG, RST, FIN—arrives at a closed port, many operating systems (Windows, for example) respond with a TCP segment that has the RST flag set. If the port is open, then the recipient does not generate any response.

By analyzing these responses or lack thereof, an intelligence gatherer can perform reconnaissance on the protected network and also on the ScreenOS policy set. If he sends a TCP segment with a non-SYN flag set and the policy permits it through, the destination host receiving such a segment might drop it and respond with a TCP segment that has the RST flag set. Such a response informs the perpetrator of the presence of an active host at a specific address and that the targeted port number is closed. The intelligence gatherer also learns that the firewall policy permits access to that port number on that host.

By enabling SYN flag checking, the security device drops TCP segments without a SYN flag if they do not belong to an existing session. It does not return a TCP RST segment. Consequently, the scanner gets no replies regardless of the policy set or whether the port is open or closed on the targeted host.

• Session Table Floods: If SYN checking is disabled, an attacker can bypass the ScreenOS SYN flood protection feature by flooding a protected network with a barrage of TCP segments that have non-SYN flags set. Although the targeted hosts drop the packets—and possibly send TCP RST segments in reply—such a flood can fill up the session table of the security device. When the session table is full, the device cannot process new sessions for legitimate traffic.

By enabling SYN checking and SYN flood protection, you can thwart this kind of attack. Checking that the SYN flag is set on the initial packet in a session forces all new sessions to begin with a TCP segment that has the SYN flag set. SYN flood protection then limits the number of TCP SYN segments per second so that the session table does not become overwhelmed.

(47)

device rejects TCP segments with non-SYN flags set unless they belong to an established session.

IP Spoofing

One method of attempting to gain access to a restricted area of the network is to insert a bogus source address in the packet header to make the packet appear to come from a trusted source. This technique is called IP spoofing. ScreenOS has two IP spoofing detection methods, both of which accomplish the same task: determining that the packet came from a location other than that indicated in its header. The method that a Juniper Networks security device uses depends on whether it is operating at Layer 3 or Layer 2 in the OSI Model.

• Layer 3—When interfaces on the security device are operating in route or NAT mode, the mechanism to detect IP spoofing relies on route table entries. If, for example, a packet with source IP address 10.1.1.6 arrives at ethernet3, but the security device has a route to 10.1.1.0/24 through ethernet1, IP spoof checking notes that this address arrived at an invalid interface—as defined in the route table, a valid packet from 10.1.1.6 can only arrive via ethernet1, not ethernet3. Therefore, the device concludes that the packet has a spoofed source IP address and discards it.

Figure 10: Layer 3 IP Spoofing

X

Trust Zone

Untrust Zone

2. Because IP spoof protection is enabled in the Untrust zone, the device checks if 10.1.1.6 is a valid source IP address for a packet arriving on ethernet3. 1. An IP packet arrives at ethernet3.

Its source IP address is 10.1.1.6.

3. When the route table lookup reveals that 10.1.1.6 is not a valid source IP address for a packet arriving on ethernet3, the device rejects the packet.

ethernet3 1.1.1.1/24

ethernet1 10.1.1.1/24

ID IP-Prefix Interface Gateway P 1 10.1.10/24 eth1 0.0.0.0 C

Subnet: 10.1.1.0/24 IP Packet with

Source IP 10.1.1.6

Route Table

If the source IP address in a packet does not appear in the route table, by default the security device allows that packet to pass (assuming that a policy exists permitting it). Using the following CLI command—where the specified security zone is the one from which the packets originate—you can instruct the security device to drop any packet whose source IP address is not in the route table:

set zone zone screen ip-spoofing drop-no-rpf-route

• Layer 2—When interfaces on the security device are operating in transparent mode, the IP spoof checking mechanism makes use of the address book entries. For example, you define an address for “serv A” as 1.2.2.5/32 in the V1-DMZ zone. If a packet with source IP address 1.2.2.5 arrives at a V1-Untrust zone interface (ethernet3), IP spoof checking notes that this address arrived at an invalid interface. The address belongs to the V1-DMZ zone, not to the V1-Untrust zone, and is accepted only at ethernet2,

References

Related documents

Created for New Jersey school districts through a project of the New Jersey Department of Education, Office of Academic Standards, in partnership with the N.J Association

[ 4] It was not unusual for students in the Tablet PC sections to comment that, even though the same material was covered and approximately the same number of homework

The main focus is the performance evaluation of different modulation schemes using a base-band model of the system employing concatenated LDPC codes with density evolution

In the Network Configuration --> Wireless --> <WLAN name> --> <WLAN Name> --> Security screen, the administrator can set the user authentication

5 Recorded raw data: (a) grab load and (b) height trace data and estimation techniques to provide of the fuel assembly information relating to the core condition from a source

Click on Groups > click the group you want to edit > click Manage access settings for this group > Permissions > Basic permissions > click Allow new users not in

The Model of Self Care Behaviour and the Relationship with Quality Of Life, Metabolic Control and Lipid Control of Type 2 Diabetes Mellitus Patients in Binjai

◆ Auto-antifreeze: To prevent the pipes and pumps from being frozen, the unit will defrost automatically when it meets the condition as follows: the ambient temperature is