Rootkits : subverting the Windows kernel / Greg Hoglund, James Butler.
By: Hoglund, Greg
.
Contributor(s): Butler, James
.
Material type:
BookPublisher: Upper Saddle River, NJ : Addison-Wesley, c2006Description: xxiii, 324 p. : ill. ; 23 cm. + pbk.ISBN: 0321294319; 9780321294319.Subject(s): Microsoft Windows (Computer file) | Computers -- Access control| Item type | Current library | Call number | Copy number | Status | Barcode | |
|---|---|---|---|---|---|---|
| General lending | MTU Bishopstown Library Lending | 005.8 (Browse shelf(Opens below)) | 1 | Available | 00133415 |
Enhanced descriptions from Syndetics:
"It''s imperative that everybody working in the field of cyber-security read this book to understand the growing threat of rootkits."
--Mark Russinovich, editor, Windows IT Pro / Windows & .NET Magazine
--Tony Bautts, Security Consultant; CEO, Xtivix, Inc. "This book is an essential read for anyone responsible for Windows security. Security professionals, Windows system administrators, and programmers in general will want to understand the techniques used by rootkit authors. At a time when many IT and security professionals are still worrying about the latest e-mail virus or how to get all of this month''s security patches installed, Mr. Hoglund and Mr. Butler open your eyes to some of the most stealthy and significant threats to the Windows operating system. Only by understanding these offensive techniques can you properly defend the networks and systems for which you are responsible."
--Jennifer Kolde, Security Consultant, Author, and Instructor "What''s worse than being owned? Not knowing it. Find out what it means to be owned by reading Hoglund and Butler''s first-of-a-kind book on rootkits. At the apex the malicious hacker toolset--which includes decompilers, disassemblers, fault-injection engines, kernel debuggers, payload collections, coverage tools, and flow analysis tools--is the rootkit. Beginning where Exploiting Software left off, this book shows how attackers hide in plain sight.
"Rootkits are extremely powerful and are the next wave of attack technology. Like other types of malicious code, rootkits thrive on stealthiness. They hide away from standard system observers, employing hooks, trampolines, and patches to get their work done. Sophisticated rootkits run in such a way that other programs that usually monitor machine behavior can''t easily detect them. A rootkit thus provides insider access only to people who know that it is running and available to accept commands. Kernel rootkits can hide files and running processes to provide a backdoor into the target machine.
"Understanding the ultimate attacker''s tool provides an important motivator for those of us trying to defend systems. No authors are better suited to give you a detailed hands-on understanding of rootkits than Hoglund and Butler. Better to own this book than to be owned."
--Gary McGraw, Ph.D., CTO, Cigital, coauthor of Exploiting Software (2004) and Building Secure Software (2002), both from Addison-Wesley "Greg and Jamie are unquestionably the go-to experts when it comes to subverting the Windows API and creating rootkits. These two masters come together to pierce the veil of mystery surrounding rootkits, bringing this information out of the shadows. Anyone even remotely interested in security for Windows systems, including forensic analysis, should include this book very high on their must-read list."
--Harlan Carvey, author of Windows Forensics and Incident Recovery (Addison-Wesley, 2005) Rootkits are the ultimate backdoor, giving hackers ongoing and virtually undetectable access to the systems they exploit. Now, two of the world''s leading experts have written the first comprehensive guide to rootkits: what they are, how they work, how to build them, and how to detect them. Rootkit.com''s Greg Hoglund and James Butler created and teach Black Hat''s legendary course in rootkits. In this book, they reveal never-before-told offensive aspects of rootkit technology--learn how attackers can get in and stay in for years, without detection. Hoglund and Butler show exactly how to subvert the Windows XP and Windows 2000 kernels, teaching concepts that are easily applied to virtually any modern operating system, from Windows Server 2003 to Linux and UNIX. They teach rootkit programming techniques that can be used for a wide range of software, from white hat security tools to operating system drivers and debuggers. After reading this book, readers will be able to Understand the role of rootkits in remote command/control and software eavesdropping Build kernel rootkits that can make processes, files, and directories invisible Master key rootkit programming techniques, including hooking, runtime patching, and directly manipulating kernel objects Work with layered drivers to implement keyboard sniffers and file filters Detect rootkits and build host-based intrusion prevention software that resists rootkit attacks
Includes bibliographical references and index.
Leave No Trace -- Subverting the Kernel -- The Hardware Connection -- The Age-Old Art of Hooking -- Runtime Patching -- Layered Drivers -- Direct Kernel Object Manipulation -- Hardware Manipulation -- Covert Channels -- Rootkit Detection.
Table of contents provided by Syndetics
- Preface (p. xv)
- Acknowledgments (p. xix)
- About the Authors (p. xxi)
- About the Cover (p. xxiii)
- 1 Leave No Trace (p. 1)
- Understanding Attackers' Motives (p. 2)
- The Role of Stealth (p. 2)
- When Stealth Doesn't Matter (p. 3)
- What Is a Rootkit? (p. 4)
- Why Do Rootkits Exist? (p. 4)
- Remote Command and Control (p. 5)
- Software Eavesdropping (p. 5)
- Legitimate Uses of Rootkits (p. 6)
- How Long Have Rootkits Been Around? (p. 7)
- How Do Rootkits Work? (p. 8)
- Patching (p. 8)
- Easter Eggs (p. 9)
- Spyware Modifications (p. 9)
- Source-Code Modification (p. 9)
- The Legality of Software Modification (p. 10)
- What a Rootkit Is Not (p. 10)
- A Rootkit Is Not an Exploit (p. 11)
- A Rootkit Is Not a Virus (p. 11)
- Rootkits and Software Exploits (p. 13)
- Why Exploits Are Still a Problem (p. 15)
- Offensive Rootkit Technologies (p. 17)
- HIPS (p. 17)
- NIDS (p. 17)
- Bypassing the IDS/IPS (p. 18)
- Bypassing Forensic Tools (p. 18)
- Conclusion (p. 20)
- 2 Subverting the Kernel (p. 21)
- Important Kernel Components (p. 22)
- Rootkit Design (p. 23)
- Introducing Code into the Kernel (p. 25)
- Building the Windows Device Driver (p. 26)
- The Device Driver Development Kit (p. 27)
- The Build Environments (p. 27)
- The Files (p. 27)
- Running the Build Utility (p. 29)
- The Unload Routine (p. 30)
- Loading and Unloading the Driver (p. 30)
- Logging the Debug Statements (p. 31)
- Fusion Rootkits: Bridging User and Kernel Modes (p. 32)
- I/O Request Packets (p. 33)
- Creating a File Handle (p. 37)
- Adding a Symbolic Link (p. 38)
- Loading the Rootkit (p. 39)
- The Quick-and-Dirty Way to Load a Driver (p. 40)
- The Right Way to Load a Driver (p. 41)
- Decompressing the .sys File from a Resource (p. 43)
- Surviving Reboot (p. 46)
- Conclusion (p. 47)
- 3 The Hardware Connection (p. 49)
- Ring Zero (p. 50)
- Tables, Tables, and More Tables (p. 52)
- Memory Pages (p. 53)
- Memory Access Check Details (p. 53)
- Paging and Address Translation (p. 55)
- Page-Table Lookups (p. 56)
- The Page-Directory Entry (p. 58)
- The Page-Table Entry (p. 59)
- Read-Only Access to Some Important Tables (p. 59)
- Multiple Processes, Multiple Page Directories (p. 59)
- Processes and Threads (p. 60)
- The Memory Descriptor Tables (p. 61)
- The Global Descriptor Table (p. 61)
- The Local Descriptor Table (p. 62)
- Code Segments (p. 62)
- Call Gates (p. 62)
- The Interrupt Descriptor Table (p. 62)
- Other Types of Gates (p. 65)
- The System Service Dispatch Table (p. 66)
- The Control Registers (p. 66)
- Control Register Zero (CR0) (p. 66)
- Other Control Registers (p. 67)
- The EFlags Register (p. 67)
- Multiprocessor Systems (p. 68)
- Conclusion (p. 69)
- 4 The Age-Old Art of Hooking (p. 71)
- Userland Hooks (p. 71)
- Import Address Table Hooking (p. 73)
- Inline Function Hooking (p. 74)
- Injecting a DLL into Userland Processes (p. 76)
- Kernel Hooks (p. 81)
- Hooking the System Service Descriptor Table (p. 82)
- Hooking the Interrupt Descriptor Table (p. 91)
- Hooking the Major I/O Request Packet Function Table in the Device Driver Object (p. 96)
- A Hybrid Hooking Approach (p. 106)
- Getting into a Process' Address Space (p. 106)
- Memory Space for Hooks (p. 111)
- Conclusion (p. 112)
- 5 Runtime Patching (p. 113)
- Detour Patching (p. 114)
- Rerouting the Control Flow Using MigBot (p. 115)
- Checking for Function Bytes (p. 117)
- Keeping Track of the Overwritten Instructions (p. 118)
- Using NonPagedPool Memory (p. 121)
- Runtime Address Fixups (p. 121)
- Jump Templates (p. 125)
- The Interrupt Hook Example (p. 126)
- Variations on the Method (p. 133)
- Conclusion (p. 133)
- 6 Layered Drivers (p. 135)
- A Keyboard Sniffer (p. 136)
- I/O Request Packet (IRP) and Stack Locations (p. 137)
- The KLOG Rootkit: A Walk-through (p. 140)
- File Filter Drivers (p. 153)
- Conclusion (p. 167)
- 7 Direct Kernel Object Manipulation (p. 169)
- DKOM Benefits and Drawbacks (p. 169)
- Determining the Version of the Operating System (p. 171)
- User-Mode Self-Determination (p. 171)
- Kernel-Mode Self-Determination (p. 173)
- Querying the Operating System Version in the Registry (p. 174)
- Communicating with the Device Driver from Userland (p. 175)
- Hiding with DKOM (p. 179)
- Process Hiding (p. 180)
- Device-Driver Hiding (p. 185)
- Synchronization Issues (p. 189)
- Token Privilege and Group Elevation with DKOM (p. 193)
- Modifying a Process Token (p. 194)
- Faking out the Windows Event Viewer (p. 208)
- Conclusion (p. 210)
- 8 Hardware Manipulation (p. 213)
- Why Hardware? (p. 215)
- Modifying the Firmware (p. 216)
- Accessing the Hardware (p. 217)
- Hardware Addresses (p. 217)
- Accessing Hardware Is Not Like Accessing RAM (p. 218)
- Timing Considerations (p. 219)
- The I/O Bus (p. 219)
- Accessing the BIOS (p. 221)
- Accessing PCI and PCMCIA Devices (p. 221)
- Example: Accessing the Keyboard Controller (p. 222)
- The 8259 Keyboard Controller (p. 222)
- Changing the LED Indicators (p. 222)
- Hard Reboot (p. 229)
- Keystroke Monitor (p. 229)
- How Low Can You Go? Microcode Update (p. 236)
- Conclusion (p. 237)
- 9 Covert Channels (p. 239)
- Remote Command, Control, and Exfiltration of Data (p. 240)
- Disguised TCP/IP Protocols (p. 241)
- Beware of Traffic Patterns (p. 242)
- Don't Send Data "in the Clear" (p. 242)
- Use Time to Your Advantage (p. 243)
- Hide Under DNS Requests (p. 243)
- "Stego" on ASCII Payloads (p. 244)
- Use Other TCP/IP Channels (p. 245)
- Kernel TCP/IP Support for Your Rootkit Using TDI (p. 246)
- Build the Address Structure (p. 246)
- Create a Local Address Object (p. 248)
- Create a TDI Endpoint with Context (p. 252)
- Associate an Endpoint with a Local Address (p. 254)
- Connect to a Remote Server (Send the TCP Handshake) (p. 257)
- Send Data to a Remote Server (p. 259)
- Raw Network Manipulation (p. 262)
- Implementing Raw Sockets on Windows XP (p. 262)
- Binding to an Interface (p. 263)
- Sniffing with Raw Sockets (p. 264)
- Promiscuous Sniffing with Raw Sockets (p. 264)
- Sending Packets with Raw Sockets (p. 265)
- Forging the Source (p. 266)
- Bouncing Packets (p. 266)
- Kernel TCP/IP Support for Your Rootkit Using NDIS (p. 267)
- Registering the Protocol (p. 267)
- The Protocol Driver Callbacks (p. 273)
- Moving Whole Packets (p. 278)
- Host Emulation (p. 285)
- Creating Your MAC Address (p. 286)
- Handling ARP (p. 286)
- The IP Gateway (p. 289)
- Sending a Packet (p. 289)
- Conclusion (p. 293)
- 10 Rootkit Detection (p. 295)
- Detecting Presence (p. 295)
- Guarding the Doors (p. 296)
- Scanning the "Rooms" (p. 298)
- Looking for Hooks (p. 298)
- Detecting Behavior (p. 308)
- Detecting Hidden Files and Registry Keys (p. 308)
- Detecting Hidden Processes (p. 309)
- Conclusion (p. 312)
- Index (p. 315)
Excerpt provided by Syndetics
Author notes provided by Syndetics
Greg Hoglund has been a pioneer in the area of software security. He is CEO of HBGary, Inc., a leading provider of software security verification services. After writing one of the first network vulnerability scanners (installed in over half of all Fortune 500 companies), he created and documented the first Windows NT-based rootkit, founding rootkit.com in the process. Greg is a frequent speaker at Black Hat, RSA, and other security conferences.
James Butler, Director of Engineering at HBGary, has a world-class talent for kernel programming and rootkit development and extensive experience in host-based intrusion-detection systems. He is the developer of VICE, a rootkit detection and forensics system. Jamie's previous positions include Senior Security Software Engineer at Enterasys and Computer Scientist at the National Security Agency. He is a frequent trainer and speaker at Black Hat security conferences. He holds a masters of computer science from the University of Maryland, Baltimore County. He has published articles in the IEEE Information Assurance Workshop, Phrack, USENIX ;login:, and Information Management and Computer Security.