One of the biggest buzzwords in the IT industry for the past few years, virtualization has matured into a practical requirement for many best-practice business scenarios, becoming an invaluable tool for security professionals at companies of every size. In addition to saving time and other resources, virtualization affords unprecedented means for intrusion and malware detection, prevention, recovery, and analysis. Taking a practical approach in a growing market underserved by books, this hands-on title is the first to combine in one place the most important and sought-after uses of virtualization for enhanced security, including sandboxing, disaster recovery and high availability, forensic analysis, and honeypotting. Already gaining buzz and traction in actual usage at an impressive rate, Gartner research indicates that virtualization will be the most significant trend in IT infrastructure and operations over the next four years. A recent report by IT research firm IDC predicts the virtualization services market will grow from $5. 5 billion in 2006 to $11. 7 billion in 2011. With this growth in adoption, becoming increasingly common even for small and midsize businesses, security is becoming a much more serious concern, both in terms of how to secure virtualization and how virtualization can serve critical security objectives. Titles exist and are on the way to fill the need for securing virtualization, but security professionals do not yet have a book outlining the many security applications of virtualization that will become increasingly important in their job requirements. This book is the first to fill that need, covering tactics such as isolating a virtual environment on the desktop for application testing, creating virtualized storage solutions for immediate disaster recovery and high availability across a network, migrating physical systems to virtual systems for analysis, and creating complete virtual systems to entice hackers and expose potential threats to actual production systems. About the TechnologiesA sandbox is an isolated environment created to run and test applications that might be a security risk. Recovering a compromised system is as easy as restarting the virtual machine to revert to the point before failure. Employing virtualization on actual production systems, rather than just test environments, yields similar benefits for disaster recovery and high availability. While traditional disaster recovery methods require time-consuming reinstallation of the operating system and applications before restoring data, backing up to a virtual machine makes the recovery process much easier, faster, and efficient. The virtual machine can be restored to same physical machine or an entirely different machine if the original machine has experienced irreparable hardware failure. Decreased downtime translates into higher availability of the system and increased productivity in the enterprise. Virtualization has been used for years in the field of forensic analysis, but new tools, techniques, and automation capabilities are making it an increasingly important tool. By means of virtualization, an investigator can create an exact working copy of a physical computer on another machine, including hidden or encrypted partitions, without altering any data, allowing complete access for analysis. The investigator can also take a live ? snapshot? to review or freeze the target computer at any point in time, before an attacker has a chance to cover his tracks or inflict further damage.
Inhaltsverzeichnis
1;Front Cover ;1 2;Virtualization for Security;4 3;Copyright;5 4;Technical Editor;6 5;Contributing Authors;7 6;Contents ;12 7;Chapter 1: An Introduction to Virtualization;22 7.1;Introduction;23 7.2;What Is Virtualization?;23 7.2.1;The History of Virtualization;24 7.2.1.1;The Atlas Computer;24 7.2.1.2;The M44/44X Project;25 7.2.1.3;CP/CMS;25 7.2.1.4;Other Time-Sharing Projects;26 7.2.1.5;Virtualization Explosion of the 1990s and Early 2000s;27 7.2.2;The Answer: Virtualization Is;29 7.3;Why Virtualize?;30 7.3.1;Decentralization versus Centralization;30 7.3.2;True Tangible Benefits;34 7.3.2.1;Consolidation;36 7.3.2.2;Reliability;38 7.3.2.3;Security;39 7.4;How Does Virtualization Work?;40 7.4.1;OS Relationships with the CPU Architecture;41 7.4.2;The Virtual Machine Monitor and Ring-0 Presentation;43 7.4.3;The VMM Role Explored;44 7.4.3.1;The Popek and Goldberg Requirements;45 7.4.3.2;The Challenge: VMMs for the x86 Architecture;46 7.5;Types of Virtualization;47 7.5.1;Server Virtualization;47 7.5.2;Storage Virtualization;50 7.5.3;Network Virtualization;51 7.5.4;Application Virtualization;52 7.6;Common Use Cases for Virtualization;53 7.6.1;Technology Refresh;53 7.6.2;Business Continuity and Disaster Recovery;55 7.6.3;Proof of Concept Deployments;56 7.6.4;Virtual Desktops;56 7.6.5;Rapid Development, Test Lab, and Software Configuration Management;57 7.7;Summary;59 7.8;Solutions Fast Track;59 7.8.1;What Is Virtualization?;59 7.8.2;Why Virtualize?;60 7.8.3;How Does Virtualization Work?;60 7.8.4;Types of Virtualization;61 7.8.5;Common Use Cases for Virtualization;61 7.9;Frequently Asked Questions;63 8;Chapter 2: Choosing the Right Solution for the Task;65 8.1;Introduction;66 8.2;Issues and Considerations That Affect Virtualization Implementations;66 8.2.1;Performance;67 8.2.2;Redundancy;67 8.2.3;Operations;68 8.2.3.1;Backups;68 8.2.4;Security;68 8.2.5;Evolution;69 8.2.5.1;Discovery;69 8.2.5.2;Testing;69 8.2.5.3;Production;69 8.2.5.4;Mobility;70 8.2.5.5;Grid;70 8.3;Distinguish
ing One Type of Virtualization from Another;71 8.3.1;Library Emulation;71 8.3.1.1;Wine;72 8.3.1.2;Cygwin;73 8.3.2;Processor Emulation;73 8.3.3;Operating System Virtualization;74 8.3.4;Application Virtualization;74 8.3.5;Presentation Virtualization;75 8.3.6;Server Virtualization;75 8.3.6.1;Dedicated Hardware;75 8.3.6.2;Hardware Compatibility;76 8.3.7;Paravirtualization;77 8.3.8;I/O Virtualization;78 8.3.9;Hardware Virtualization;78 8.4;Summary;80 8.5;Solutions Fast Track;81 8.5.1;Issues and Considerations That Affect Virtualization Implementations;81 8.5.2;Distinguishing One Type of Virtualization from Another;81 8.6;Frequently Asked Questions;82 9;Chapter 3: Building a Sandbox;83 9.1;Introduction;84 9.2;Sandbox Background;83 9.2.1;The Visible Sandbox;85 9.2.1.1;cwsandbox.exe;88 9.2.1.2;cwmonitor.dll;89 9.3;Existing Sandbox Implementations;92 9.4;Describing CWSandbox;94 9.5;Creating a Live DVD with VMware and CWSandbox;83 9.5.1;Setting Up Linux;98 9.5.2;Setting Up VMware Server v1.05;100 9.5.3;Setting Up a Virtual Machine in VMware Server;100 9.5.4;Setting Up Windows XP Professional in the Virtual Machine;101 9.5.5;Setting Up CWSandbox v2.x in Windows XP Professional;102 9.5.6;Configuring Linux and VMware Server for Live DVD Creation;103 9.5.7;Updating Your Live DVD;105 9.6;Summary;106 9.7;Solutions Fast Track;83 9.7.1;Sandbox Background;106 9.7.2;Existing Sandbox Implementations;107 9.7.3;Describing CWSandbox;107 9.7.4;Creating a Live DVD with VMware and CWSandbox;108 9.7.5;Frequently Asked Questions;109 9.7.6;Notes;110 9.8;Bibliography;110 10;Chapter 4: Configuring the Virtual Machine;111 10.1;Introduction;112 10.1.1;Resource Management;112 10.2;Hard Drive and Network Configurations;112 10.2.1;Hard Drive Configuration;113 10.2.1.1;Growing Disk Sizes;113 10.2.1.2;Virtual Disk Types;113 10.2.1.3;Using Snapshots;114 10.2.2;Network Configuration;114 10.2.2.1;Creating an Interface;114 10.2.2.1.1;Bridged;115 10.2.2.1.2;Host-Only;116 10.2.2.1.3;Natted;117 10.2.2.2;Multipl
e Interfaces;118 10.3;Physical Hardware Access;119 10.3.1;Physical Disks;119 10.3.2;USB Devices;123 10.4;Interfacing with the Host;124 10.4.1;Cut and Paste;124 10.4.2;How to Install the VMware Tools in a Virtual Machine;125 10.4.3;How to Install the Virtual Machine Additions in Virtual PC;132 10.5;Summary;133 10.6;Solutions Fast Track;133 10.6.1;Hard Drive and Network Configurations;133 10.6.2;Physical Hardware Access;134 10.6.3;Interfacing with the Host;134 10.7;Frequently Asked Questions;135 11;Chapter 5: Honeypotting;137 11.1;Introduction;138 11.2;Herding of Sheep;138 11.2.1;Honeynets;140 11.2.1.1;Gen I;140 11.2.1.2;Gen II;141 11.2.1.3;Gen III;141 11.2.2;Where to Put It;141 11.2.2.1;Local Network;142 11.2.2.2;Distributed Network;142 11.2.3;Layer 2 Bridges;143 11.2.4;Honeymole;145 11.2.5;Multiple Remote Networks;146 11.3;Detecting the Attack;150 11.3.1;Intrusion Detection;150 11.3.2;Network Traffic Capture;151 11.3.3;Monitoring on the Box;152 11.4;How to Set Up a Realistic Environment;153 11.4.1;Nepenthes;154 11.4.2;Setting Up the Network;154 11.4.2.1;Keeping the Bad Stuff in;160 11.5;Summary;161 11.6;Solutions Fast Track;161 11.6.1;Herding of Sheep;161 11.6.2;Detecting the Attack;161 11.6.3;How to Set Up a Realistic Environment;162 11.7;Frequently Asked Questions;163 11.8;Note;163 12;Chapter 6: Malware Analysis;165 12.1;Introduction;166 12.1.1;Setting the Stage;166 12.2;How Should Network Access Be Limited?;167 12.2.1;Dont Propagate It Yourself;167 12.2.2;The Researcher May Get Discovered;168 12.2.3;Create a Victim That Is as Close to Real as Possible;168 12.2.4;You Should Have a Variety of Content to Offer;168 12.2.5;Give It That Lived-in Look;169 12.2.6;Making the Local Network More Real;169 12.2.7;Testing on VMware Workstation;171 12.2.8;Microsoft Virtual PC;173 12.3;Looking for Effects of Malware;174 12.3.1;What Is the Malwares Purpose?;174 12.3.2;How Does It Propagate?;175 12.3.3;Does the Malware Phone Home for Updates?;175 12.3.4;Does the Malware Participat
e in a Bot-Net?;176 12.3.5;Does the Malware Send the Spoils Anywhere?;176 12.3.6;Does the Malware Behave Differently Depending on the Domain?;177 12.3.7;How Does the Malware Hide and How Can It Be Detected?;177 12.3.8;How Do You Recover from It?;178 12.4;Examining a Sample Analysis Report;179 12.4.1;The Section;179 12.4.2;Analysis of 82f78a89bde09a71ef99b3cedb991bcc.exe;180 12.4.3;Analysis of arman.exe;182 12.5;Interpreting an Analysis Report;187 12.5.1;How Does the Bot Install?;188 12.5.2;Finding Out How New Hosts Are Infected;189 12.5.3;How Does the Bot Protect the Local Host and Itself?;191 12.5.4;Determing How/Which C&C Servers Are Contacted;194 12.5.5;How Does the Bot Get Binary Updates?;195 12.5.6;What Malicious Operations Are Performed?;196 12.6;Bot-Related Findings of Our Live Sandbox;201 12.7;Antivirtualization Techniques;203 12.7.1;Detecting You Are in a Virtual Environment;204 12.7.2;Virtualization Utilities;204 12.7.3;VMware I/O Port;204 12.7.4;Emulated Hardware Detection;205 12.7.4.1;Hardware Identifiers;205 12.7.4.1.1;MAC Addresses;205 12.7.4.1.2;Hard Drives;206 12.7.4.1.3;PCI Identifiers;206 12.7.5;Detecting You Are in a Hypervisor Environment;207 12.8;Summary;208 12.9;Solutions Fast Track;208 12.9.1;How Should Network Access Be Limited?;208 12.9.2;Looking for Effects of Malware;208 12.9.3;Antivirtualization Techniques;208 12.10;Frequently Asked Questions;209 13;Chapter 7: Application Testing;211 13.1;Introduction;212 13.2;Getting Up to Speed Quickly;212 13.2.1;Default Platform;213 13.2.1.1;Copying a Machine in VMware Server;213 13.2.1.2;Registering a Machine in Microsoft Virtual Server;215 13.2.2;Known Good Starting Point;216 13.2.3;Downloading Preconfigured Appliances;217 13.2.3.1;VMwares Appliance Program;217 13.2.3.2;Microsofts Test Drive Program;218 13.3;Debugging;219 13.3.1;Kernel Level Debugging;219 13.3.2;The Advantage of Open Source Virtualization;227 13.4;Summary;228 13.5;Solutions Fast Track;228 13.5.1;Getting Up to Speed Quickly
;228 13.5.2;Debugging;228 13.6;Frequently Asked Questions;229 14;Chapter 8: Fuzzing;231 14.1;Introduction;232 14.2;What Is Fuzzing?;232 14.3;Virtualization and Fuzzing;234 14.4;Choosing an Effective Starting Point;234 14.4.1;Using a Clean Slate;234 14.4.2;Reducing Startup Time;235 14.4.3;Setting Up the Debugging Tools;235 14.4.4;Preparing to Take Input;237 14.5;Preparing for External Interaction;238 14.5.1;Taking the Snapshot;238 14.6;Executing the Test;239 14.6.1;Scripting Snapshot Startup;239 14.6.2;Interacting with the Application;240 14.6.3;Selecting Test Data;241 14.6.4;Checking for Exceptions;242 14.6.5;Saving the Results;243 14.6.6;Running Concurrent Tests;243 14.7;Summary;245 14.8;Solutions Fast Track;245 14.8.1;What Is Fuzzing?;245 14.8.2;Virtualization and Fuzzing;245 14.8.3;Choosing an Effective Starting Point;245 14.8.4;Preparing for External Interaction;246 14.8.5;Executing the Test;246 14.9;Frequently Asked Questions;247 15;Chapter 9: Forensic Analysis;249 15.1;Introduction;250 15.2;Preparing Your Forensic Environment;251 15.3;Capturing the Machine;252 15.4;Preparing the Captured Machine to Boot on New Hardware;258 15.5;What Can Be Gained by Booting the Captured Machine?;259 15.5.1;Virtualization May Permit You to Observe Behavior That Is Only Visible While Live;262 15.5.2;Using the System to Demonstrate the Meaning of the Evidence;262 15.5.3;The System May Have Proprietary/ Old Files That Require Special Software;262 15.5.4;Analyzing Time Bombs and Booby Traps;263 15.5.5;Easier to Get in the Mind-Set of the Suspect;263 15.5.6;Collecting Intelligence about Botnets or Virus-Infected Systems;264 15.5.7;Collecting Intelligence about a Case;264 15.5.8;Capturing Processes and Data in Memory;265 15.5.9;Performing Forensics of a Virtual Machine;265 15.5.10;Caution: VM-Aware Malware Ahead;267 15.6;Summary;269 15.7;Solutions Fast Track;269 15.7.1;Preparing Your Forensic Environment;269 15.7.2;Capturing the Machine;270 15.7.3;Preparing the Captured Machine to Bo
ot on New Hardware;270 15.7.4;What Can Be Gained by Booting the Captured Machine?;271 15.8;Frequently Asked Questions;273 16;Chapter 10: Disaster Recovery;275 16.1;Introduction;276 16.2;Disaster Recovery in a Virtual Environment;276 16.3;Simplifying Backup and Recovery;277 16.3.1;File Level Backup and Restore;277 16.3.2;System-Level Backup and Restore;278 16.3.3;Shared Storage Backup and Restore;279 16.4;Allowing Greater Variation in Hardware Restoration;281 16.4.1;Different Number of Servers;282 16.4.1.1;Using Virtualization for Recovery of Physical Systems;282 16.4.1.2;Using Virtualization for Recovery of Virtual Systems;283 16.5;Recovering from Hardware Failures;285 16.6;Redistributing the Data Center;285 16.7;Summary;287 16.8;Solutions Fast Track;288 16.8.1;Disaster Recovery in a Virtual Environment;288 16.8.1.1;Simplifying Backup and Recovery;288 16.8.2;Allowing Greater Variation in Hardware restoration;288 16.8.3;Recovering from Hardware Failures;289 16.8.4;Redistributing the Data Center;289 16.9;Frequently Asked Questions;290 17;Chapter 11: High Availability: Reset to Good;291 17.1;Introduction;292 17.2;Understanding High Availability;292 17.2.1;Providing High Availability for Planned Downtime;293 17.2.2;Providing High Availability for Unplanned Downtime;294 17.3;Reset to Good;295 17.3.1;Utilizing Vendor Tools to Reset to Good;295 17.3.2;Utilizing Scripting or Other Mechanisms to Reset to Good;297 17.3.3;Degrading over Time;297 17.4;Configuring High Availability;298 17.4.1;Configuring Shared Storage;298 17.4.2;Configuring the Network;298 17.4.3;Setting Up a Pool or Cluster of Servers;299 17.5;Maintaining High Availability;300 17.5.1;Monitoring for Overcommitment of Resources;300 17.5.2;Security Implications;301 17.5.3;Performing Maintenance on a High Availability System;302 17.6;Summary;304 17.7;Solutions Fast Track;305 17.7.1;Understanding High Availability;305 17.7.2;Reset to Good;305 17.7.3;Configuring High Availability;305 17.7.4;Maintaining High Availabi
lity;305 17.8;Frequently Asked Questions;307 18;Chapter 12: Best of Both Worlds: Dual Booting;309 18.1;Introduction;310 18.2;How to Set Up Linux to Run Both Natively and Virtually;310 18.2.1;Creating a Partition for Linux on an Existing Drive;311 18.2.2;Setting Up Dual Hardware Profiles;315 18.3;Issues with Running Windows Both Natively and Virtualized;316 18.3.1;Precautions When Running an Operating System on Both Physical and Virtualized Platforms;316 18.3.1.1;Booting a Suspended Partition;316 18.3.1.2;Deleting the Suspended State;317 18.3.1.3;Changing Hardware Configurations Can Affect Your Software;317 18.4;Summary;319 18.5;Solutions Fast Track;319 18.5.1;How to Set Up Linux to Run Both Natively and Virtually;319 18.5.2;Issues with Running Windows Both Natively and Virtualized;319 18.6;Frequently Asked Questions;320 19;Chapter 13: Protection in Untrusted Environments;321 19.1;Introduction;322 19.1.1;Meaningful Uses of Virtualization in Untrusted Environments;322 19.1.2;Levels of Malware Analysis Paranoia;328 19.2;Using Virtual Machines to Segregate Data;336 19.3;Using Virtual Machines to Run Software You Dont Trust;338 19.4;Using Virtual Machines for Users You Dont Trust;341 19.4.1;Setting up the Client Machine;342 19.4.1.1;Installing Only What You Need;342 19.4.1.2;Restricting Hardware Access;342 19.4.1.3;Restricting Software Access;342 19.4.2;Scripting the Restore;343 19.5;Summary;345 19.6;Solutions Fast Track;345 19.6.1;Using Virtual Machines to Segregate Data;345 19.6.2;Using Virtual Machines to Run Software You Dont Trust;345 19.6.3;Using Virtual Machines for Users You Dont Trust;346 19.7;Frequently Asked Questions;347 19.8;Notes;348 20;Chapter 14: Training;349 20.1;Introduction;350 20.2;Setting Up Scanning Servers;350 20.2.1;Advantages of Using a Virtual Machine instead of a Live-CD Distribution;351 20.2.1.1;Persistence;351 20.2.1.2;Customization;351 20.2.2;Disadvantages of Using a Virtual Machine instead of a Live-CD;352 20.2.2.1;Default Platforms As Well
to Use a Variety of Tools;352 20.2.3;Scanning Servers in a Virtual Environment;353 20.3;Setting Up Target Servers;354 20.3.1;Very Open Boxes for Demonstrating during Class;355 20.3.1.1;Suggested Vulnerabilities for Windows;355 20.3.1.2;Suggested Vulnerabilities for Linux;356 20.3.1.3;Suggested Vulnerabilities for Application Vulnerability Testing;356 20.4;Creating the Capture-the-Flag Scenario;359 20.4.1;Harder Targets;359 20.4.1.1;Snapshots Saved Us;360 20.4.1.2;Require Research to Accomplish the Task;361 20.4.1.3;Introduce Firewalls;361 20.4.1.4;Multiple Servers Requiring Chained Attacks;361 20.4.2;Adding Some Realism;362 20.4.2.1;Loose Points for Damaging the Environment;362 20.4.2.2;Demonstrate What the Attack Looks Like on IDS;363 20.5;Out Brief;363 20.6;Cleaning up Afterward;363 20.7;Saving Your Back;364 20.8;Summary;365 20.9;Solutions Fast Track;365 20.9.1;Setting Up Scanning Servers;365 20.9.2;Setting Up Target Servers;365 20.9.3;Creating the Capture-the-Flag Scenario;365 20.9.4;Out Brief;366 20.9.5;Cleaning Up Afterward;366 20.9.6;Saving Your Back;366 20.10;Frequently Asked Questions;367 21;Index;369