Network Security Assessment
by Chris McNab
Copyright 2017 Chris McNab. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com/safari.). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Editors: Rachel Roumeliotis and Heather Scherer
- Production Editor: Melanie Yarbrough
- Copyeditor: Octal Publishing Services
- Proofreader: Jasmine Kwityn
- Indexer: Ellen Troutman-Zaig
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Rebecca Demarest
- December 2016: Third Edition
Revision History for the Third Edition
- 2016-12-02: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491910955 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Network Security Assessment, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-491-91095-5
[LSI]
In memory of Barnaby Jack.
Preface
Adversaries routinely target networks for gain. As I prepare this third edition of Network Security Assessment, the demand for incident response expertise is also increasing. Although software vendors have worked to improve the security of their products over the past decade, system complexity and attack surfaces have grown, and if anything, the overall integrity of the Internet has degraded.
Attacker tactics have become increasingly refined, combining intricate exploitation of software defects, social engineering, and physical attack tactics to target high-value assets. To make matters worse, many technologies deployed to protect networks have been proven ineffective. Google Project Zero
As stakes increase, so does the value of research output. Security researchers are financially incentivized to disclose zero-day vulnerabilities to third parties and brokers, who in turn share the findings with their customers, and in some cases, responsibly notify product vendors. There exists a growing gap by which the number of severe defects known only to privileged groups (e.g., governments and organized criminals) increases each day.
A knee-jerk reaction is to prosecute hackers and curb the proliferation of their tools. The adversaries we face, however, along with the tactics they adopt, are nothing but a symptom of a serious problem: the products we use are unfit for purpose. Product safety is an afterthought for many technology companies, and the challenges we face today a manifestation of this.
To aggravate things further, governments have militarized the Internet and eroded the integrity of cryptosystems used to protect data. As security professionals, we must advocate defense in depth to mitigate risks that will likely always exist, and work hard to ensure that our networks are a safe place to do commerce, store data, and communicate with one another. Life for us all would be very different without the Internet and the freedoms it provides.
Overview
This book tackles a single area of computer security in detailundertaking network-based penetration testing in a structured manner. The methodology I present describes how determined attackers scour Internet-based networks in search of vulnerable components and how you can perform similar exercises to assess your environment.
Assessment is the first step any organization should take to manage its risk. By testing your networks in the same way that a determined adversary does, you proactively identify weaknesses within them. In this book, I pair offensive content with bulleted checklists of countermeasures to help you devise a clear technical strategy and fortify your environment accordingly.
Audience
This book assumes that you have familiarity with networking protocols and Unix-based operating system administration. If you are an experienced network engineer or security consultant, you should be comfortable with the contents of each chapter. To get the most out of this book, you should be familiar with:
OSI Layer 2 network operation (primarily ARP and 802.1Q VLAN tagging)
The IPv4 protocol suite, including TCP, UDP, and ICMP
The operation of popular network protocols (e.g., FTP, SMTP, and HTTP)
Basic runtime memory layout and Intel x86 processor registers
Cryptographic primitives (e.g., Diffie-Hellman and RSA key exchange)
Common web application flaws (XSS, CSRF, command injection, etc.)
Configuring and building Unix-based tools in your environment
Organization
This book consists of 15 chapters and 3 appendixes. At the end of each chapter is a checklist summarizing the threats and techniques described, along with recommended countermeasures. The appendixes provide reference material, including listings of TCP and UDP ports you might encounter during testing. Here is a brief description of each chapter and appendix:
, discusses the rationale behind network security assessment and introduces information assurance as a process, not a product.
, covers the tools that make up a professional security consultants attack platform, along with assessment tactics that should be adopted.
, categorizes vulnerabilities in software via taxonomy, along with low-level descriptions of vulnerability classes and adversary types.
, describes the Internet-based tactics that a potential attacker adopts to map your networkfrom open web searches to DNS sweeping and querying of mail servers.
, defines the steps taken to perform local area network discovery and sniffing, along with circumvention of 802.1Q and 802.1X security features.
, discusses popular network scanning techniques and their relevant applications. It also lists tools that support such scanning types. IDS evasion and low-level packet analysis techniques are also covered.
, details the approaches used to test services found running across many operating platforms. Protocols covered within this chapter include SSH, FTP, Kerberos, SNMP, and VNC.
, covers testing of Microsoft services found in enterprise environments (NetBIOS, SMB Direct, RPC, and RDP).
, details assessment of SMTP, POP3, and IMAP services that transport email. Often, these services can fall afoul to information-leak and brute-force attacks, and in some cases, remote code execution.
, covers network-based testing of IPsec and PPTP services that provide secure network access and confidentiality of data in-transit.
, details assessment of TLS protocols and features that provide secure access to web, mail, and other network services.