Mastering Network security

Mastering



Network Security
Second Edition

Chris Brenton
Cameron Hunt

San Francisco London

Mastering



Network Security
Second Edition

Chris Brenton
Cameron Hunt


San Francisco London

Associate Publisher: Neil Edde
Acquisitions and Developmental Editor: Chris Denny
Editor: Pat Coleman
Production Editor: Elizabeth Campbell
Technical Editor: Andy Leaning
Graphic Illustrator: Tony Jonick
Electronic Publishing Specialist: Maureen Forys, Happenstance Type-O-Rama
Book Designer: Maureen Forys, Happenstance Type-O-Rama
Proofreaders: Dave Nash, Nancy Riddiough
Indexer: Ted Laux
Cover Design: Design Site
Cover Illustrator: Tania Kac, Design Site
Copyright © 2003 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved. No part of this publication may be
stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photograph, magnetic, or other record,
without the prior agreement and written permission of the publisher.
An earlier version of this book was published under the title Active Defense: A Comprehensive Guide to Network Security © 1999 SYBEX Inc.
Library of Congress Card Number: 2002108077

ISBN: 0-7821-4142-0
SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the United States and/or other countries.
Mastering is a trademark of SYBEX Inc.
Screen reproductions produced with FullShot 99. FullShot 99 © 1991–1999 Inbit Incorporated. All rights reserved.
FullShot is a trademark of Inbit Incorporated.
TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the
capitalization style used by the manufacturer.
The author and publisher have made their best efforts to prepare this book, and the content is based upon final release software whenever possible.
Portions of the manuscript may be based upon pre-release versions supplied by software manufacturer(s). The author and the publisher make no
representation or warranties of any kind with regard to the completeness or accuracy of the contents herein and accept no liability of any kind
including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or
alleged to be caused directly or indirectly from this book.
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1

This book is dedicated to bleary-eyed, sleep-deprived,
socially-inept, autistically savantic misfit technophiliacs...
—Cameron Hunt

Acknowledgments

I have to thank Princess Knikki for keeping my creditors silenced, Mistress Elizabeth for providing a carrot along with a stick, Patsie (Pat Coleman) for being the ultimate professional, Chris Denny
for enthusiasms, and all manufacturers of caffeine products.
—Cameron Hunt

Contents at a Glance
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Chapter 1 • A Systems Analysis Approach to Information Technology . . . . . . . . . . 1
Chapter 2 • Security as a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 3 • Understanding How Network Systems Communicate . . . . . . . . . . . . 31
Chapter 4 • Topology Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 5 • Firewalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Chapter 6 • Cisco’s PIX Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Chapter 7 • Intrusion Detection Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Chapter 8 • Authentication and Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Chapter 9 • Virtual Private Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Chapter 10 • Viruses, Trojans, and Worms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Chapter 11 • Disaster Prevention and Recovery . . . . . . . . . . . . . . . . . . . . . . . . 277
Chapter 12 • The Wide World of Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Chapter 13 • Unix-Based Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Chapter 14 • The Anatomy of an Attack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415

Chapter 15 • Security Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Appendix A • Operating System Security Checklists . . . . . . . . . . . . . . . . . . . . . 451
Appendix B • Sample Network Usage Policy . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465

Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Chapter 1 • A Systems Analysis Approach to Information Technology . . . . . . . 1
An Introduction to Systems Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Define the Scope of the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Determine Objectives, Constraints, Risks, and Cost . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Applying Systems Analysis to Information Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
The Nature of the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
The Types of Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
How the Organization Uses the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
How Individuals Use the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Models and Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2 • Security as a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Survival of the Fittest: The Myth of Total Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Risk Mitigation: Case Studies of Success and Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
The Systems Development Life Cycle (SDLC): Security as a Process
from Beginning to End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Conceptual Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Functional Requirement Determination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Protection Specifications Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Design Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Development and Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Component and Code Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
System Test Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Certification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Accreditation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Operation and Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Disposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Steady As It Goes: Putting the “Constant” Back into Vigilance . . . . . . . . . . . . . . . . . . . . 28
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 3 • Understanding How Network Systems Communicate
The Anatomy of a Frame of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ethernet Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Frame Header Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A Protocol’s Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The OSI Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How the OSI Model Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
More on the Network Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . 31
. . . . . . . . . . 31
. . . . . . . . . . 31
. . . . . . . . . . 33
. . . . . . . . . . 36
. . . . . . . . . . 37
. . . . . . . . . . 40
. . . . . . . . . . 42

CONTENTS

Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Routing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Static Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Distance Vector Routing . . . . . . . . . . . . . . . . . . . . . .
Link State Routing . . . . . . . . . . . . . . . . . . . . . . . . . .
Label Switching and MPLS . . . . . . . . . . . . . . . . . . . .
Connectionless and Connection-Oriented Communications
Connection-Oriented Communications . . . . . . . . . . . .
Connectionless Communications . . . . . . . . . . . . . . . . .
Security Implications . . . . . . . . . . . . . . . . . . . . . . . . .
Network Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Transfer Protocol (FTP): The Special Case . . . . . .
Other IP Services . . . . . . . . . . . . . . . . . . . . . . . . . . .
Upper Layer Communications . . . . . . . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.


.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

42
43
44
45
51
53
56
57
59
60
60
66
68
80
81

Chapter 4 • Topology Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Understanding Network Transmissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Digital Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Electromagnetic Interference (EMI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Fiber-Optic Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Bound and Unbound Transmissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Choosing a Transmission Medium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Topology Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
LAN Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Wide Area Network Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Frame Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Asynchronous Transfer Mode (ATM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Wireless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Basic Networking Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Hubs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
A Comparison of Bridging/Switching and Routing . . . . . . . . . . . . . . . . . . . . . . . . . 107
Layer-3 Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Chapter 5 • Firewalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Defining an Access Control Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Definition of a Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
When Is a Firewall Required? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Dial-In Modem Pool and Client-Initiated VPN . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
External Connections to Business Partners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Between Departments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Hosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Firewall Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Static Packet Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

vii

viii

CONTENTS

Dynamic Packet Filtering . . . . . . . . .
Stateful Filtering . . . . . . . . . . . . . . .
Proxy Servers . . . . . . . . . . . . . . . . . .
Firewall Types . . . . . . . . . . . . . . . . . . . .
Which Firewall Functions Should I Use?
Which Type Should I Choose? . . . . . . . .
Server-Based Firewalls . . . . . . . . . . .
Appliance-Based Firewalls . . . . . . . . .
Additional Firewall Considerations . . . . .
Address Translation . . . . . . . . . . . . .
Firewall Logging and Analysis . . . . .
Virtual Private Networks (VPNs) . .
Intrusion Detection and Response . .
Integration and Access Control . . . .
Third-Party Tools . . . . . . . . . . . . . .
You Decide . . . . . . . . . . . . . . . . . . .
Firewall Deployment . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 6 • Cisco’s PIX Firewall
An Overview of PIX . . . . . . . . . . . .
Installing PIX . . . . . . . . . . . . . . . . .
Installing PDM . . . . . . . . . . . . .
Configuring PDM . . . . . . . . . . .
Configuring PIX . . . . . . . . . . . . . . .
Configuring PIX Security . . . . . . . . .
The Access Rules Tab . . . . . . . .
AAA Rules . . . . . . . . . . . . . . . .
Filter Rules . . . . . . . . . . . . . . . .
Translation Rules . . . . . . . . . . . .
Monitoring . . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

123
128
129
133
133
134
135
141
142
142
145
147
147
148
148
149
149
152

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

Chapter 7 • Intrusion Detection Systems
IDS Types . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Intrusion Detection System . . . . .
System Integrity Verifier . . . . . . . . . . . . . . .
Log File Monitor . . . . . . . . . . . . . . . . . . .
Honeypot . . . . . . . . . . . . . . . . . . . . . . . . .
NIDS Limitations . . . . . . . . . . . . . . . . . . . . . .
Teardrop Attacks . . . . . . . . . . . . . . . . . . . .
Other Known NIDS Limitations . . . . . . . .
NIDS Countermeasures . . . . . . . . . . . . . . .
Host-Based IDS . . . . . . . . . . . . . . . . . . . . . . .
NIDS Fusion . . . . . . . . . . . . . . . . . . . . . . . . .
Snort: A Popular NIDS . . . . . . . . . . . . . . . . . .
Snort Rules . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . 191
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

CONTENTS

Before You Begin . . . . . . . .
Configuring Snort . . . . . . .
Snort Alert Example . . . . .
Suggestions for Using Snort
Summary . . . . . . . . . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

209
211
213
213
214

Chapter 8 • Authentication and Encryption . . . . . . . . . . . . . . . . . . . . . . . . . 215
The Need for Improved Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Passively Monitoring Clear Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Clear Text Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Good Authentication Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Session Hijacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Verifying the Destination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Encryption 101 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Methods of Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Encryption Weaknesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Government Intervention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Good Encryption Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Data Encryption Standard (DES) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Advanced Encryption Standard (AES) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Digital Certificate Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
IP Security (IPSEC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Kerberos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
PPTP/L2TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
EAP (Extensible Authentication Protocol) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Remote Access Dial-In User Service (RADIUS) . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
RSA Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Secure Shell (SSH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Secure Sockets Layer (SSL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Security Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Simple Key Management for Internet Protocols (SKIP) . . . . . . . . . . . . . . . . . . . . . . 234
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Chapter 9 • Virtual Private Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
VPN Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
VPN Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Selecting a VPN Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
VPN Product Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
VPN Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Setting Up a VPN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Preparing the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Our VPN Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Configuring the VPN Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Configuring the VPN Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Testing the VPN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

ix

x

CONTENTS

Chapter 10 • Viruses, Trojans, and Worms
Viruses: The Statistics . . . . . . . . . . . . . . . . . . . .
What Is a Virus? . . . . . . . . . . . . . . . . . . . . . . . .
Replication . . . . . . . . . . . . . . . . . . . . . . . . .
Concealment . . . . . . . . . . . . . . . . . . . . . . . .
Bomb . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Social-Engineering Viruses . . . . . . . . . . . . . .
Worms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Trojan Horses . . . . . . . . . . . . . . . . . . . . . . . . . .
Preventive Measures . . . . . . . . . . . . . . . . . . . . . .
Access Control . . . . . . . . . . . . . . . . . . . . . .
Checksum Verification . . . . . . . . . . . . . . . . .
Process Monitoring . . . . . . . . . . . . . . . . . . .
Virus Scanners . . . . . . . . . . . . . . . . . . . . . . .
Heuristic Scanners . . . . . . . . . . . . . . . . . . . .
Application-Level Virus Scanners . . . . . . . . .
Deploying Virus Protection . . . . . . . . . . . . . . . .
Protecting the Desktop Systems . . . . . . . . . .
Protecting the Server Operating Systems . . . .
Protecting the Unix-Based System . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . 257
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

Chapter 11 • Disaster Prevention and Recovery
Disaster Categories . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Disasters . . . . . . . . . . . . . . . . . . . . . . . . . . .
Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LAN Topology . . . . . . . . . . . . . . . . . . . . . . . . . .
WAN Topologies . . . . . . . . . . . . . . . . . . . . . . . . .
Single Points of Failure . . . . . . . . . . . . . . . . . . . .
Saving Configuration Files . . . . . . . . . . . . . . . . . .
Server Disasters . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Uninterruptible Power Supply (UPS) . . . . . . . . . .
RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Redundant Servers . . . . . . . . . . . . . . . . . . . . . . . .
Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Application Service Providers . . . . . . . . . . . . . . . .
Server Recovery . . . . . . . . . . . . . . . . . . . . . . . . . .
Extreme Disasters . . . . . . . . . . . . . . . . . . . . . . . . . . .
Nondestructive Testing . . . . . . . . . . . . . . . . . . . . .
Document Your Procedures . . . . . . . . . . . . . . . . .
VERITAS Storage Replicator . . . . . . . . . . . . . . . . . . .
VSR Planning . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing VSR . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring VSR . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Replication . . . . . . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

. . . . . . . . . . . . . . . . . . . . . . 277
. . . . . . . . . . . . . . . . . . . . . . . . 278
. . . . . . . . . . . . . . . . . . . . . . . . 278
. . . . . . . . . . . . . . . . . . . . . . . . 278
. . . . . . . . . . . . . . . . . . . . . . . . 280
. . . . . . . . . . . . . . . . . . . . . . . . 280
. . . . . . . . . . . . . . . . . . . . . . . . 284
. . . . . . . . . . . . . . . . . . . . . . . . 286
. . . . . . . . . . . . . . . . . . . . . . . . 288
. . . . . . . . . . . . . . . . . . . . . . . . 290
. . . . . . . . . . . . . . . . . . . . . . . . 290
. . . . . . . . . . . . . . . . . . . . . . . . 291
. . . . . . . . . . . . . . . . . . . . . . . . 293
. . . . . . . . . . . . . . . . . . . . . . . . 294
. . . . . . . . . . . . . . . . . . . . . . . . 295
. . . . . . . . . . . . . . . . . . . . . . . . 298
. . . . . . . . . . . . . . . . . . . . . . . . 298
. . . . . . . . . . . . . . . . . . . . . . . . 299
. . . . . . . . . . . . . . . . . . . . . . . . 301
. . . . . . . . . . . . . . . . . . . . . . . . 301
. . . . . . . . . . . . . . . . . . . . . . . . 301
. . . . . . . . . . . . . . . . . . . . . . . . 302
. . . . . . . . . . . . . . . . . . . . . . . . 303
. . . . . . . . . . . . . . . . . . . . . . . . 304
. . . . . . . . . . . . . . . . . . . . . . . . 308
. . . . . . . . . . . . . . . . . . . . . . . . 313

CONTENTS

Chapter 12 • The Wide World of Windows . . . . . . . . . . . . . . . . . . . . . . . . . . 315
NT Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Active Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
The Domain Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Storing Domain Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Domain Trusts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Working with SIDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
The Security Account Manager in Windows NT . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Configuring Group Policies for Windows 2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Other Registry-Based Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Configuring User Manager Policies for Windows NT . . . . . . . . . . . . . . . . . . . . . . . 331
Policies and Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
The File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Share Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
File Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Configuring Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Reviewing the Event Viewer Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Auditing System Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Security Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Available IP Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Computer Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
DHCP Relay Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Microsoft DHCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Microsoft DNS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Microsoft Internet Information Server (IIS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Microsoft TCP/IP Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Network Monitor Agent and Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
RIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
RPC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Simple TCP/IP Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
SNMP Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Windows Internet Naming Service (WINS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Packet Filtering with Windows NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Enabling Packet Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Configuring Packet Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
A Final Word on Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Securing DCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Selecting the DCOM Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Limiting the Ports Used by DCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
DCOM and NAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Ports Used by Windows Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Additional Registry Key Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Producing a Logon Banner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Hiding the Last Logon Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Securing the Registry on Windows NT Workstation . . . . . . . . . . . . . . . . . . . . . . . . 362
Securing Access to Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Cleaning the Page File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

xi

xii

CONTENTS

Windows 2000 . . . . . . . . . . . . . .
File System Permissions . . . . .
Encrypting File System . . . . .
Kerberos Version 5 . . . . . . . . .
Public Key Certificate Services
IPsec . . . . . . . . . . . . . . . . . . .
Smart Cards . . . . . . . . . . . . .
Windows .NET . . . . . . . . . . . . . .
The .NET Security Policy . . .
Policy Tools . . . . . . . . . . . . . .
Policy Recommendations . . . .
Summary . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

364
364
364
366
370
372
373
374
375
376
376
377

Chapter 13 • Unix-Based Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Unix History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
The Unix File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Understanding UID and GID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
File Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Account Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
The Password File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
The Group File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
PAM (Pluggable Authentication Module) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Limit Root Logon to the Local Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Optimizing the Unix Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Running make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Changing the Network Driver Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
IP Service Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
IP Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
inetd and xinetd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Working with Other Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
TCP Wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Unix Checklist Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Preinstallation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
Chapter 14 • The Anatomy of an Attack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Collecting Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
The whois Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
The nslookup Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Search Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Probing the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
The traceroute Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Host and Service Scanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Passive Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Checking for Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427

CONTENTS

Launching the Attack . . . . . . . . .
Hidden Accounts . . . . . . . . .
MITM (Man in the Middle)
Buffer Overflows . . . . . . . . .
SYN Attack . . . . . . . . . . . .
Teardrop Attacks . . . . . . . . .
Smurf . . . . . . . . . . . . . . . . .
Brute Force Attacks . . . . . . .
Physical Access Attacks . . . .
Summary . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

Chapter 15 • Security Resources
Information from the Vendor . . . . . .
3COM . . . . . . . . . . . . . . . . . . .
Cisco . . . . . . . . . . . . . . . . . . . .
Linux . . . . . . . . . . . . . . . . . . . .
Microsoft . . . . . . . . . . . . . . . . .
Novell . . . . . . . . . . . . . . . . . . . .
Sun Microsystems . . . . . . . . . . .
Third-Party Channels . . . . . . . . . . .
Vulnerability Databases . . . . . . .
Websites . . . . . . . . . . . . . . . . . .
Mailing Lists . . . . . . . . . . . . . . .
Newsgroups . . . . . . . . . . . . . . .
Summary . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

429
430
430
432
433
433
434
436
437
438

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

Appendix A • Operating System Security Checklists . . . . . . . . . . . . . . . . . . . 451
Appendix B • Sample Network Usage Policy . . . . . . . . . . . . . . . . . . . . . . . . . 457
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465

xiii

Introduction
Some of us can remember a time when securing a network environment was a far easier task
than it seems to be today. As long as every user had a password and the correct levels of file permissions had been set, we could go to sleep at night confident that our network environment was
relatively secure. This confidence may or may not have been justified, but at least we felt secure.
Then along came the Internet and everything changed. The Internet has accelerated at an
amazing rate the pace at which information is disseminated. In the early 1990s, most of us would
not hear about a security vulnerability unless it was reported by a major magazine or newspaper.
Even then, the news release typically applied to an old version of software that most of us no
longer used anyway. These days, hundreds of thousands of people can be made privy to the
details of a specific vulnerability in less than an hour.
This is not to say that all this discussion of product vulnerabilities is a bad thing. Actually,
quite the opposite is true. Individuals with malicious intent have always had places to exchange
ideas. Pirate bulletin boards have been around since the 1980s. Typically, it was the rest of us who
were left out in the cold with no means of dispersing this information to the people who needed
it most: the network administrators attempting to maintain a secure environment. The Internet
has become an excellent means by which to get vulnerability information into the hands of the
people responsible for securing their environments.
Increased awareness also brings increased responsibility. This is not only true for the software
company that is expected to fix the vulnerability; it is also true for the network administrator or
security specialist who is expected to deploy the fix. Any end user with a subscription to a mailing
list can find out about vulnerabilities as quickly as the networking staff. This greatly increases the
urgency of deploying security-related fixes as soon as they are developed. (As if we didn’t have
enough on our plates already!)
So, along with all our other responsibilities, we need to maintain a good security posture. The
first problem is where to begin. Should you purchase a book on firewalls or on securing your network servers? Maybe you need to learn more about network communications to be able to understand how these vulnerabilities can even exist. Should you be worried about running backups or
redundant servers?
One lesson that has been driven home since the publication of the first edition of this book is
the need to view security not as a static package, but rather as a constant process incorporating all
facets of networking and information technology. You cannot focus on one single aspect of your
network and expect your environment to remain secure. Nor can this process be done in isolation

INTRODUCTION

from other networking activities. This book provides system and network administrators with the
information they need to run a network with multiple layers of security protection, while considering issues of usability, privacy, and manageability.

What This Book Covers
Chapter 1 starts with the idea that our technology, as well as the context in which that technology is
used, should be thought of as a series of embedded systems. Using traditional system analysis vocabulary and techniques to understand and describe all the components in our security landscape
ensures that we have a good understanding of the relationship and impact that our various components have on one another.
Chapter 2 extends the idea of systems to discuss security systems and security itself in a context
of a continual (and recursive) process of discovery, analysis, planning, and implementation.
In Chapter 3, you’ll get an overview of how systems communicate across a network. The chapter
looks at how the information is packaged and describes the use of protocols. You’ll read about vulnerabilities in routing protocols and whic