SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
The Next Generation Hacker Book
The step-by-step guide to defending against hacker intrusions!
This easy-to-use, step-by-step guide will empower network and system administrators to defend their information and computing assetswhether or not they have security experience. In Counter Hack, leading network security expert Edward Skoudis presents comprehensive, insider's explanations of today's most destructive hacker tools and tactics-and specific, proven countermeasures for both UNIX and Windows environments. Skoudis covers all this and more:
Whatever your role in protecting network infrastructure and data, Counter Hack delivers proven solutions you can implement right nowand long-term strategies that will improve security for years to come.
Even Nastier: Traditional RootKits
Night of the Living Wi-Fi's (A Security Parable for Our Times)
Tips for Dealing with Insider Security Threats
Unwitting Collaborators, Part 12: Disinformation Changing Web Site Contents
Unwitting Collaborators, Part 13: The Winds of Digital War
Preface.
Acknowledgments.
1. Introduction.
The Computer World and the Golden Age of Hacking. Why This Book? Why Cover These Specific Tools and Techniques? How This Book Differs. The Threat: Never Underestimate Your Adversary. Attacker Skill Levels From Script Kiddies to the Elite. A Note on Terminology and Iconography. Hackers, Crackers, and Hats of Many Colors: Let's Just Use “Attackers”. Pictures and Scenarios. Naming Names. Caveat: These Tools Could Hurt You. Setting Up a Lab for Experimentation. Additional Concerns. Organization of the Rest of This Book. Getting up to Speed with the Technology. Common Phases of the Attack. Future Predictions, Conclusions, and References.
The OSI Reference Model and Protocol Layering. So How Does TCP/IP Fit In? Understanding TCP/IP. The Transmission Control Protocol (TCP). TCP Port Numbers. TCP Control Bits, the Three-Way Handshake, and Sequence Numbers. Other Fields in the TCP Header. The User Datagram Protocol (UDP). Is UDP Less Secure Than TCP? The Internet Protocol (IP) and the Internet Control Message Protocol (ICMP). IP: Drop That Acronym and Put Your Hands in the Air! Local Area Networks and Routers. IP Addresses. Netmasks. Packet Fragmentation in IP. Other Components of the IP Header. Security or (Lack Thereof) in Traditional IP. ICMP. Other Network-Level Issues. Routing Packets. Network Address Translation. Firewalls: Network Traffic Cops and Soccer Goalies. Getting Personal with Firewalls. Don't Forget about the Data Link and Physical Layers! Ethernet, the King of Connectivity. ARP ARP ARP! Hubs and Switches. Security Solutions for Networks. Application-Layer Security. The Secure Socket Layer (SSL). Security at the IP Level: IPSec. Conclusions.
Introduction. Learning about UNIX. Architecture. UNIX File System Structure. The Kernel and Processes. Automatically Starting up Processes: Init, Inetd, and Cron. Manually Starting Processes. Interacting with Processes. Accounts and Groups. The /etc/passwd File. The /etc/group File. Root: It's a Bird: It' a Plane: No, it's Super-User! Privilege Control: UNIX Permissions. SetUID Programs. UNIX Trust. Logs and Auditing. Common UNIX Network Services. Telnet: Command-Line Remote Access. FTP: The File Transfer Protocol. TFTP: The Trivial File Transfer Protocol. Web Servers: HTTP. Electronic Mail. r-Commands. Domain Name Services. The Network File System (NFS). X Window System. Conclusion.
Introduction. A Brief History of Time. Fundamental NT Concepts. Domains: Grouping Machines Together. Shares: Accessing Resources across the Network. Service Packs and Hot Fixes. Architecture. User Mode. How Windows NT Password Representations Are Derived. Kernel Mode. Accounts and Groups. Accounts. Groups. Privilege Control. Policies. Account Policy. User Properties Settings. Trust. Auditing. Object Access Control and Permissions. Ownership. NTFS and NTFS Permissions. Share Permissions. Local Access. Weak Default Permissions and Hardening Guides. Network Security. Limitations in Basic Network Protocols and APIs. The Remote Access Service (RAS). Windows 2000: Welcome to the New Millennium. What Windows 2000 Offers. Security Considerations in Windows 2000. Architecture: Some Refinements over Windows NT. Accounts and Groups. Privilege Control. Windows 2000 Trust. Auditing. Object Access Control. Network Security. Conclusion.
Low-Technology Reconnaissance: Social Engineering, Physical Break-in, and Dumpster Diving. Social Engineering. Physical Break-In. Dumpster Diving. Search the Fine Web (STFW). Searching an Organization's Own Web Site. The Fine Art of Using Search Engines. Listening in at the Virtual Watering Hole: Usenet. Defenses against Web-Based Reconnaissance. Who is Databases: Treasure Chests of Information. Researching .com, .net, and .org Domain Names. Researching Domain Names Other than .com, .net, and .org. We've Got the Registrar, Now What? IP Address Assignments through ARIN. Defenses against Who is Searches. The Domain Name System. Interrogating DNS Servers. Defenses from DNS-Based Reconnaissance. General Purpose Reconnaissance Tools. Sam Spade, a General-Purpose Reconnaissance Client Tool. Web-Based Reconnaissance Tools: Research and Attack Portals. Conclusion.
War Dialing. War Dialer vs. Demon Dialer. A Toxic Recipe: Modems, Remote Access Products, and Clueless Users. SysAdmins and Insecure Modems. More Free Phone Calls, Please. Finding Telephone Numbers to Feed into a War Dialer. A Brief History of War-Dialing Tools. THC-Scan 2.0. L0pht's TBA War-Dialing Tool. The War Dialer Provides a List of Lines with Modems: Now What? Defenses against War Dialing. Network Mapping. Sweeping: Finding Live Hosts. Traceroute: What Are the Hops? Cheops: A Nifty Network Mapper and General-Purpose Management Tool. Defenses against Network Mapping. Determining Open Ports Using Port Scanners. Nmap: A Full-Featured Port Scanning Tool. Defenses against Port Scanning. Determining Firewall Filter Rules with Firewalk. Vulnerability Scanning Tools. A Whole Bunch of Vulnerability Scanners. Nessus. Vulnerability Scanning Defenses. Intrusion Detection System Evasion. How Network-Based Intrusion Detection Systems Work. How Attackers Can Evade Network-Based Intrusion Detection Systems. IDS Evasion Defenses. Conclusion.
Script Kiddie Exploit Trolling. Pragmatism for More Sophisticated Attackers. Stack-Based Buffer Overflow Attacks. What Is a Stack? What is a Stack-Based Buffer Overflow? Exploiting Stack-Based Buffer Overflows. Finding Buffer Overflow Vulnerabilities. The Make up of a Buffer Overflow. Intrusion Detection Systems and Stack-Based Buffer Overflows. Application Layer IDS Evasion for Buffer Overflows. Once the Stack Is Smashed: Now What? Beyond Buffer Overflows. Stack-Based Buffer Overflow and Related Attack Defenses. Password Attacks. Guessing Default Passwords. Password Guessing through Login Scripting. The Art and Science of Password Cracking. Let's Crack Those Passwords! Cracking Windows NT/2000 Passwords Using L0phtCrack. Cracking UNIX (and Other) Passwords Using John the Ripper. Defenses against Password-Cracking Attacks. Web Application Attacks. Account Harvesting. Undermining Web Application Session Tracking. SQL Piggybacking. Defenses against Piggybacking SQL Commands. Conclusions.
Sniffing. Sniffing through a Hub: Passive Sniffing. Active Sniffing: Sniffing through a Switch and Other Cool Goodies. Dsniff, A Sniffing Cornucopia. Sniffing Defenses. IP Address Spoofing. IP Address Spoofing Flavor 1: Simple Spoofing: Simply Changing the IP Address. IP Address Spoofing Flavor 2: Undermining UNIX r-Commands. IP Address Spoofing Flavor 3: Spoofing with Source Routing. IP Spoofing Defenses. Session Hijacking. Session Hijacking with Hunt. Session-Hijacking Defenses. Netcat: A General Purpose Network Tool. Netcat for File Transfer. Netcat for Port Scanning. Netcat for Making Connections to Open Ports. Netcat for Vulnerability Scanning. Using Netcat to Create a Passive Backdoor Command Shell. Using Netcat to Actively Push a Backdoor Command Shell. Relaying Traffic with Netcat. Netcat Defenses. Conclusions.
Stopping Local Services. Defenses from Locally Stopping Services. Locally Exhausting Resources. Defenses from Locally Exhausting Resources. Remotely Stopping Services. Defenses from Remotely Stopping Services. Remotely Exhausting Resources. SYN Flood. Smurf Attacks. Distributed Denial-of-Service Attacks. Conclusions.
Trojan Horses. Backdoors. Netcat as a Backdoor on UNIX Systems. The Devious Duo: Backdoors Melded into Trojan Horses. Nasty: Application-Level Trojan Horse Backdoor Tools. Let's Check out Back Orifice 2000 (BO2K). Defenses against Application-Level Trojan Horse Backdoors. Bare Minimum: Use Antivirus Tools. Don't Use Single-Purpose BO2K Checkers. Know Your Software. User Education Is Also Critical. Even Nastier: Traditional RootKits. What Do Traditional RootKits Do? The Centerpiece of Traditional RootKits on UNIX: /bin/login Replacement. Traditional RootKits: Sniff Some Passwords. Traditional RootKits: Hide that Sniffer! Traditional RootKits: Hide Everything Else! Traditional RootKits: Covering the Tracks. Some Particular Examples of Traditional RootKits. Defending against Traditional RootKits. Don't Let Them Get Root in the First Place! Looking for Changes in the File System. Host-Based Security Scanners. The Best Defense: File Integrity Checkers. Uh-oh: They RootKitted Me. How Do I Recover? Nastiest: Kernel-Level RootKits. The Power of Execution Redirection. File Hiding with Kernel-Level RootKits. Process Hiding with Kernel-Level RootKits. Network Hiding with Kernel-Level RootKits. How to Implement Kernel-Level RootKits: Loadable Kernel Modules. Some Particular Examples of Kernel-Level RootKits. Defending against Kernel-Level RootKits. Fighting Fire with Fire: Don't Do It! Don't Let Them Get Root in the First Place! Looking for Traces of Kernel-Level RootKits. Automated RootKit Checkers. The Best Answer: Kernels without LKM Support. Conclusion.
Hiding Evidence by Altering Event Logs. Attacking Event Logs in Windows NT/2000. Attacking System Logs and Accounting Files in UNIX. Altering UNIX Shell History Files. Defenses against Log and Accounting File Attacks. Activate Logging, Please. Set Proper Permissions. Use a Separate Logging Server. Encrypt Your Log Files. Making Log Files Append Only. Protecting Log Files with Write-Once Media. Creating Difficult-to-Find Files and Directories. Creating Hidden Files and Directories in UNIX. Creating Hidden Files in Windows NT/2000. Defenses from Hidden Files. Hiding Evidence on the Network: Covert Channels. Tunneling. More Covert Channels: Using the TCP and IP Headers to Carry Data. Defenses against Covert Channels. Conclusion.
Scenario 1: Dial “M” for Modem. Scenario 2: Death of a Telecommuter. Scenario 3: The Manchurian Contractor. Conclusion.
Where Are We Heading? Scenario 1: Yikes! Scenario 2: A Secure Future. Scenario 1, Then Scenario 2. Keeping up to Speed. Web Sites. Mailing Lists. Conferences. Final ThoughtsLive Long and Prosper.
My cell phone rang. I squinted through my sleepy eyelids at the clock. Ugh! 4 a.m., New Year's Day. Needless to say, I hadn't gotten very much sleep that night.
I picked up the phone to hear the frantic voice of my buddy, Fred, on the line. Fred was a security administrator for a medium-sized Internet Service Provider, and he frequently called me with questions about a variety of security issues.
"We've been hacked big time!" Fred shouted, far too loudly for this time of the morning.
I rubbed my eyes to try to gain a little coherence.
"How do you know they got in? What did they do?" I asked.
Fred replied, "They tampered with a bunch of Web pages. This is bad, Ed. My boss is gonna have a fit!"
I asked, "How did they get in? Have you checked out the logs?"
Fred stuttered, "W-Well, we don't do much logging, because it slows down performance. I only snag logs from a couple of machines. Also, on those systems where we do gather logs, the attackers cleared the log files."
"Have you applied the latest security fixes from your operating system vendor to your machines?" I asked, trying to learn a little more about Fred's security posture.
Fred responded with hesitation, "We apply security patches every three months. The last time we deployed fixes was?um?two-and-a-half months ago."
I scratched my aching head and said, "Two major buffer overflow attacks were released last week. You may have been hit. Have they installed any RootKits? Have you checked the consistency of critical files on the system?"
"You know, I was planning to install something like Tripwire, but just never got around to it," Fred admitted.
I quietly sighed and said, "OK. Just remain calm. I'll be right over so we can start to analyze your machines."
You clearly don't want to end up in a situation like Fred, and I want to minimize the number of calls I get at 4 a.m. on New Year's Day. While I've changed Fred's name to protect the innocent, this situation actually occurred. Fred's organization had failed to implement some fundamental security controls, and it had to pay the price when an attacker came knocking. In my experience, many organizations find themselves in the same state of information security unpreparedness.
But the situation goes beyond these security basics. Even if you've implemented all of the controls discussed in my Fred narrative above, there are a variety of other tips and tricks you can use to defend your systems. Sure, you may apply security patches, use a file integrity checking tool, and have adequate logging, but have you recently looked for unsecured modems? Or, how about activating port-level security on the switches in your critical network segments to prevent powerful, new active sniffing attacks? Have you considered implementing non-executable stacks to prevent one of the most common types of attacks today, the stack-based buffer overflow? Are you ready for kernel-level RootKits? If you want to learn more about these topics and more, please read on.
As we will see throughout the book, computer attacks happen each and every day, with increasing virulence. To create a good defense, you must understand the offensive techniques of your adversaries. In my career as a system penetration tester, incident response team member, and information security architect, I've seen numerous types of attacks ranging from simple scanning by clueless kids to elite attacks sponsored by the criminal underground. This book boils down the common and most damaging elements from these real-world attacks, while offering specific advice on how you can proactively avoid such trouble from your adversaries. We'll zoom in on how computer attackers conduct their activities, looking at each step of their process so we can implement in-depth defenses.
The book is designed for system administrators, network administrators, and security professionals, as well as others who want to learn how computer attackers do their magic and how to stop them. The offensive and defensive techniques laid out in the book apply to all types of organizations using computers and networks today, including enterprises and service providers, ranging in size from small to gigantic.
Computer attackers are marvelous at sharing information with each other about how to attack your infrastructure. Their efficiency at information dissemination about victims can be ruthless. It is my hope that this book can help to even the score, by sharing practical advice about how to defend your computing environment from the bad guys. By applying the defenses from this book, you can greatly improve your computer security and, perhaps, we'll both be able to sleep in late next New Year's Day.