Windows Forensics and Incident Recovery

Paperback | July 21, 2004

byHarlan Carvey

not yet rated|write a review
[html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:w="urn:schemas-microsoft-com:office:word"xmlns="http://www.w3.org/TR/REC-html40">Preface @font-face {font-family:"Times New Roman"; panose-1:0 2 2 6 3 5 4 5 2 3; mso-font-alt:Times; mso-font-charset:77; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:50331648 0 0 0 1 0;}@font-face {font-family:Geneva; panose-1:0 2 11 5 3 3 4 4 4 2; mso-font-charset:0; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:50331648 0 0 0 1 0;}@font-face {font-family:"Frutiger 67BoldCn"; mso-font-alt:Arial; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;}@font-face {font-family:"New Caledonia"; mso-font-alt:Arial; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;}@font-face {font-family:"I New Caledonia Italic"; mso-font-alt:Arial; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;}@font-face {font-family:Courier-AddisonWesley; mso-font-alt:Arial; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:Geneva; color:fuchsia;}p.HB, li.HB, div.HB {mso-style-name:HB; mso-style-parent:"; margin-top:12.0pt; margin-right:0in; margin-bottom:71.0pt; margin-left:0in; line-height:36.0pt; mso-line-height-rule:exactly; mso-pagination:widow-orphan; font-size:34.0pt; font-family:"Frutiger 67BoldCn";}p.Body, li.Body, div.Body {mso-style-name:Body; mso-style-parent:"; margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:48.0pt; margin-bottom:.0001pt; text-align:justify; text-indent:.25in; line-height:13.0pt; mso-line-height-rule:exactly; mso-pagination:widow-orphan lines-together; font-size:11.0pt; font-family:"New Caledonia";}p.BodyNoIndent, li.BodyNoIndent, div.BodyNoIndent {mso-style-name:BodyNoIndent; mso-style-parent:Body; margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:48.0pt; margin-bottom:.0001pt; text-align:justify; line-height:13.0pt; mso-line-height-rule:exactly; mso-pagination:widow-orphan lines-together; font-size:11.0pt; font-family:"New Caledonia";}span.BodyCODE {mso-style-name:BodyCODE; mso-style-parent:"; font-size:9.5pt; letter-spacing:0pt;} @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no; mso-footnote-position:end-of-section; mso-endnote-position:end-of-section; mso-footnote-numbering-start:0; mso-endnote-numbering-style:arabic; mso-endnote-numbering-start:0;}@page Section1 {size:588.0pt 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;}div.Section1 {page:Section1;}--> Preface As long as networks of Microsoft Windows systems aremanaged, administered, and used by people, security incidents will occur.Regardless of whether weOre talking about hundreds of corporate Windowsworkstations and servers or home user systems running Windows XP on broadbandconnections to the Internet, Windows systems will be attacked, compromised, andused for malicious purposes. This is not to say that only Windows systems willbe attacked; rather, Windows systems are highly pervasive throughout the entirecomputing infrastructure, from home and school systems to high-end e-commercesites. In contrast to this pervasiveness, information regarding conductingeffective incident response and forensic audit activities on Windows systems islimited, to say the least. Attacks may come from insiders who have legitimatephysical access to systems and are authorized to use them or from facelessindividuals hiding in the shapeless ether of the Internet. Knowing this, anyonewho manages or administers Windows systems including the home user needs toknow how to react when he suspects that an incident has occurred. When it comes to investigating and resolving computer securityincidents, Windows systems lag well behind Linux and<_spanstyle3d_27_27_font-family3a_courier-addisonwesley27_27_>* nix systems. This gapcan be attributed to a variety of reasons. One reason is a lack of detailedtechnical knowledge regarding Windows systems themselves on the part ofadministrators. This lack of understanding may be due at least in part toMicrosoftOs use of graphical user interfaces GUIs to control everything fromthe installation process to all aspects of system administration. Attackers andmalicious users take steps to ensure that their activities remain hidden fromview, particularly from the systemOs GUI tools such as the Event Viewer and theTask Manager. For example, enabling an audit policy requires that the systemadministrator navigate through multiple layers of the GUI, while an attackercan easily disable and then reenable, if necessary that audit policy with asingle command line tool which, incidentally, is provided for free fromMicrosoft . Other reasons for the "incident response gap" include a lack ofunderstanding regarding how to use available native and third-party tools toretrieve data and how to interpret the data that is collected from potentiallyinfected or compromised systems. Many useful and powerful tools that mirror thefunctionality used on Linux systems are not available through either theMicrosoft operating system distributions or the Resource Kits. Sites that makethese tools available are scattered across the Internet, with no centrallocation cataloguing them. This book was written to aid anyone investigatingincidents that occur on Windows systems by providing information regarding thetools and techniques used to respond to incidents and conduct forensic audits. This book arose out of a need that I, and I am sure others, haveseen in the Microsoft Windows system administration community. MicrosoftOsnetwork operating systems, beginning with Windows NT, are designed to be easyto use and manage. These systems come with some very powerful tools. As usefulas these tools are to the administrator, they are also very useful to anattacker or to a malicious user. Most system administrators and owners spendtheir time dealing with Windows operating systems through the GUI, and in doingso, miss many of the important aspects of the operating system that go on"under the hood." For example, the Task Manager does not show the complete pathto the executable image for each process, nor does it display the command lineused to launch each process. This information is available using third-partytools, which most folks who work with Windows systems may not be familiar with.Therefore, it may be relatively simple to hide an errant process, such as anetwork backdoor, by renaming the file "svchost.exe" or something similarlyinnocuous. Several years ago, I developed a hands-on course for teachingsystem administrators how to respond to security incidents on Windows 2000systems. While teaching the course to system administrators at variousorganizations, I saw the same things that I saw on listservs and on forums onthe Internet. During the first break on the first day of the course, I would goaround the room and "infect" all of the systems with a "Trojan." This "Trojan"was netcat, renamed to "inetinfo.exe," listening on port 80. When the attendeesreturned to the room, IOd tell them that I "infected" their systems andchallenged them to find it. The purpose of this exercise was not to find outwho could find the "Trojan" first but to look at the steps that the attendeeswould go through in their incident response activities, to look at their"methodology." Invariably, every attendee would examine the contents of theEvent Log, comb through the Task Manager, and maybe run<_spanstyle3d_27_27_font-family3a_courier-addisonwesley27_27_>netstat -an from acommand prompt. All of the systems were connected to the Internet, and the onlyinstructions I would give to the class was that they could not use any of thetools from the course CD that IOd put together. As the course progressedthrough the rest of the two days, the attendees became familiar with the toolsand techniques they could use to retrieve valuable data about a system, as wellas how to interpret that data. IOve assembled a good deal of unique content for this book,information that IOve developed because I havenOt been able to locate it anyplace else and therefore had to do my own research. For example, when I firstbegan researching NTFS alternate data streams, there wasnOt much informationavailable. Over time, research has revealed additional information, which isincluded in this book. IOve included tools that IOve developed written inPerl and information, results, and insights from my own research. This bookalso includes information from a variety of sources put together in a singlelocation so that it can be easily referenced. Unlike other books about incident response, this book is specificto Windows systems. Other books on the subject will present a great deal ofinformation regarding Linux and Unix systems, and in some cases, leave it up tothe reader to extrapolate the information to Windows. All of the tools andtechniques presented in this book are specific to Windows NT, 2000, XP, and2003 systems. The book is organized so that the reader progresses through anunderstanding of incidents, what they are and how they can and do occur. Fromthere, the reader is guided through developing an understanding of what isrequired to prevent incidents and how to prepare for them, and then where tolook for data and how to analyze that data, should an incident occur. Datahiding and tools used in incident response and live forensic audits are coveredat great length, and all of the information presented is specific to Windowsoperating systems, file systems i.e., NTFS , and applications i.e., MS Word,etc. . This information is presented in a progression, each chapter taking thecontent of the previous chapter further. However, each chapter can also stand onits own, as a reference that the reader can return to time and time again. The main premise of this book is really very simple. Whenincidents occur, an entire spectrum of incident response activities can beperformed. The lower end of the spectrum involves...well...nothing. Noactivity. Basically, the incident goes completely unrecognized or is simplyignored. The opposite end of the spectrum consists of those activities thatpurists think of when they hear the word "forensics": the system is shut down ina forensically sound manner and a bit-level image of the drive is made. Allinvestigative activities are then conducted against that copy. This is usuallyaccompanied by law enforcement involvement and may even lead to prosecution.However, many organizations do not wish to involve law enforcement when anincident occurs and generally conduct non-litigious investigations because theyjust want to get systems back online and in use. In other cases, potentiallycompromised systems may be part of an e-commerce infrastructure, in whichdowntime is measured in hundreds of dollars per minute. In such cases, aninvestigation will occur, but it will not involve law enforcement or legalprosecution, as the goal is determining what, if anything, happened. These stepsmay be required to gather information and facts in order to justify furtheraction, such as taking the system down. In addition, a great deal of extremely valuable informationregarding the state of the system is lost when the system is shut down. This informationis referred to as "volatile" information, and it includes such things asprocess information, network connections, clipboard contents, etc. Thisinformation can be retrieved, parsed, and analyzed in order to determine firstwhether an incident has even occurred, and then the extent of the incident. Insome cases, enough information may have been collected to show that theincident is manageable, and the system does not have to be taken out of serviceto be "cleaned." More importantly, the investigator will want to understand<_spanstyle3d_27_27_font-family3a_22_i new="" caledonia="" _italic22_27_27_="">how the system was infectedor compromised so that shortfalls in security policies can be rectified andother systems protected. The Perl programming language is used to programmaticallydemonstrate many of the concepts addressed throughout the book. The underlyingpremise of the book is to get the reader "under the hood" within the Windowssystem, that is, to show the reader how to move beyond the simple GUI toolsprovided with the operating system in order to collect information about thestate of the system. Many third-party tools are discussed, and several Perlscripts are provided in order to support this premise. Perl scripts are alsoused in this book to provide for customization and automation. Bycustomization, we mean that Perl is used to correlate and "massage" the outputof various third-party tools in order to present a more complete picture of thedata. By automation, we mean that Perl is used in this book to implement amethodology so that the investigator does not have to perform the steps byhand, thereby avoiding mistakes and making the overall process more efficient. This book guides the reader through information, tools, andtechniques that are required to conduct incident response and live forensicaudit activities. By providing the necessary background for understanding howincidents occur and how data can be hidden on compromised systems, the readerwill have a better understanding of the "whyOs" and "howOs" of incidentresponse and forensic audit activities.

Pricing and Purchase Info

$60.51 online
$67.99 list price (save 11%)
Ships within 1-2 weeks
Ships free on orders over $25

From the Publisher

[html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:w="urn:schemas-microsoft-com:office:word"xmlns="http://www.w3.org/TR/REC-html40">Preface @font-face {font-family:"Times New Roman"; panose-1:0 2 2 6 3 5 4 5 2 3; mso-font-alt:Times; mso-font-charset:77; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:vari...

From the Jacket

Praise for Windows Forensics and Incident Recovery "Windows Forensics and Incident Recovery doesn't just discuss forensics, it also includes tools for analysis and shows readers how to use them. I look forward to putting these tools through their paces, and I recommend Carvey's book as a terrific addition to the security professiona...

Harlan Carvey¿s interest in computer and information security began while he was an officer in the U.S. military, during which time he earned his master¿s degree in Electrical Engineering. After leaving military service, he began working in the field of commercial and government information security consulting, performing vulnerabilit...

other books by Harlan Carvey

Windows Registry Forensics: Advanced Digital Forensic Analysis Of The Windows Registry
Windows Registry Forensics: Advanced Digital Forensic A...

Paperback|Mar 25 2016

$91.63 online$96.95list price(save 5%)
Windows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry
Windows Registry Forensics: Advanced Digital Forensic A...

Kobo ebook|Mar 3 2016

$60.09 online$78.00list price(save 22%)
Windows Forensic Analysis DVD Toolkit
Windows Forensic Analysis DVD Toolkit

Kobo ebook|Jun 1 2009

$70.69 online$91.80list price(save 22%)
see all books by Harlan Carvey
Format:PaperbackDimensions:480 pages, 9.1 × 7 × 1.1 inPublished:July 21, 2004Publisher:Pearson EducationLanguage:English

The following ISBNs are associated with this title:

ISBN - 10:0321200985

ISBN - 13:9780321200983

Customer Reviews of Windows Forensics and Incident Recovery

Reviews

Extra Content

From the Author

PrefaceAs long as networks of Microsoft Windows systems aremanaged, administered, and used by people, security incidents will occur.Regardless of whether we’re talking about hundreds of corporate Windowsworkstations and servers or home user systems running Windows XP on broadbandconnections to the Internet, Windows systems will be attacked, compromised, andused for malicious purposes. This is not to say that only Windows systems willbe attacked; rather, Windows systems are highly pervasive throughout the entirecomputing infrastructure, from home and school systems to highend ecommercesites. In contrast to this pervasiveness, information regarding conductingeffective incident response and forensic audit activities on Windows systems islimited, to say the least. Attacks may come from insiders who have legitimatephysical access to systems and are authorized to use them or from facelessindividuals hiding in the shapeless ether of the Internet. Knowing this, anyonewho manages or administers Windows systems (including the home user) needs toknow how to react when he suspects that an incident has occurred.When it comes to investigating and resolving computer securityincidents, Windows systems lag well behind Linux and *nix systems. This gap canbe attributed to a variety of reasons. One reason is a lack of detailedtechnical knowledge regarding Windows systems themselves on the part ofadministrators. This lack of understanding may be due at least in part toMicrosoft’s use of graphical user interfaces (GUIs) to control everything fromthe installation process to all aspects of system administration. Attackers andmalicious users take steps to ensure that their activities remain hidden fromview, particularly from the system’s GUI tools such as the Event Viewer and theTask Manager. For example, enabling an audit policy requires that the systemadministrator navigate through multiple layers of the GUI, while an attackercan easily disable (and then reenable, if necessary) that audit policy with asingle command line tool (which, incidentally, is provided for free fromMicrosoft).Other reasons for the "incident response gap" include alack of understanding regarding how to use available native and third partytools to retrieve data and how to interpret the data that is collected frompotentially infected or compromised systems. Many useful and powerful toolsthat mirror the functionality used on Linux systems are not available througheither the Microsoft operating system distributions or the Resource Kits. Sitesthat make these tools available are scattered across the Internet, with nocentral location cataloguing them. This book was written to aid anyoneinvestigating incidents that occur on Windows systems by providing informationregarding the tools and techniques used to respond to incidents and conductforensic audits.This book arose out of a need that I, and I am sure others, haveseen in the Microsoft Windows system administration community. Microsoft’snetwork operating systems, beginning with Windows NT, are designed to be easyto use and manage. These systems come with some very powerful tools. As usefulas these tools are to the administrator, they are also very useful to anattacker or to a malicious user. Most system administrators and owners spendtheir time dealing with Windows operating systems through the GUI, and in doingso, miss many of the important aspects of the operating system that go on"under the hood." For example, the Task Manager does not show thecomplete path to the executable image for each process, nor does it display thecommand line used to launch each process. This information is available usingthirdparty tools, which most folks who work with Windows systems may not befamiliar with. Therefore, it may be relatively simple to hide an errantprocess, such as a network backdoor, by renaming the file"svchost.exe" or something similarly innocuous. Several years ago, I developed a handson course for teachingsystem administrators how to respond to security incidents on Windows 2000systems. While teaching the course to system administrators at variousorganizations, I saw the same things that I saw on listservs and on forums onthe Internet. During the first break on the first day of the course, I would goaround the room and "infect" all of the systems with a"Trojan". This "Trojan" was netcat, renamed to"inetinfo.exe," listening on port 80. When the attendees returned tothe room, I’d tell them that I "infected" their systems andchallenged them to find it. The purpose of this exercise was not to find outwho could find the "Trojan" first but to look at the steps that theattendees would go through in their incident response activities, to look attheir "methodology." Invariably, every attendee would examine thecontents of the Event Log, comb through the Task Manager, and maybe run netstat–an from a command prompt. All of the systems were connected to theInternet, and the only instructions I would give to the class was that theycould not use any of the tools from the course CD that I’d put together. As thecourse progressed through the rest of the two days, the attendees becamefamiliar with the tools and techniques they could use to retrieve valuable dataabout a system, as well as how to interpret that data. I’ve assembled a good deal of unique content for this book,information that I’ve developed because I haven’t been able to locate it anyplace else and therefore had to do my own research. For example, when I firstbegan researching NTFS alternate data streams, there wasn’t much informationavailable. Over time, research has revealed additional information, which isincluded in this book. I’ve included tools that I’ve developed (written inPerl) and information, results, and insights from my own research. This bookalso includes information from a variety of sources put together in a singlelocation so that it can be easily referenced. Unlike other books about incident response, this book is specificto Windows systems. Other books on the subject will present a great deal ofinformation regarding Linux and Unix systems, and in some cases, leave it up tothe reader to extrapolate the information to Windows. All of the tools andtechniques presented in this book are specific to Windows (NT, 2000, XP, and2003) systems.The book is organized so that the reader progresses through anunderstanding of incidents, what they are and how they can (and do) occur. Fromthere, the reader is guided through developing an understanding of what isrequired to prevent incidents and how to prepare for them, and then where tolook for data and how to analyze that data, should an incident occur. Datahiding and tools used in incident response and live forensic audits are coveredgreat length, and all of the information presented is specific to Windowsoperating systems, file systems (i.e., NTFS), and applications (i.e., MS Word,etc.). This information is presented in a progression, each chapter taking thecontent of the previous chapter further. However, each chapter can also standon its own, as a reference that the reader can return to time and time again.The main premise of this book is really very simple. Whenincidents occur, an entire spectrum of incident response activities can beperformed. The lower end of the spectrum involves...well...nothing. Noactivity. Basically, the incident goes completely unrecognized or is simplyignored. The opposite end of the spectrum consists of those activities thatpurists think of when they hear the word "forensics"...the system isshut down in a forensicallysound manner and a bitlevel image of the drive ismade. All investigative activities are then conducted against that copy. Thisis usually accompanied by law enforcement involvement and may even lead toprosecution. However, many organizations do not wish to involve law enforcementwhen an incident occurs and generally conduct nonlitigious investigationsbecause they just want to get systems back online and in use. In other cases,potentially compromised systems may be part of an ecommerce infrastructure, inwhich downtime is measured in hundreds of dollars per minute. In such cases, aninvestigation will occur, but it will not involve law enforcement or legalprosecution, as the goal is determining what, if anything, happened. These stepsmay be required to gather information and facts in order to justify furtheraction, such as taking the system down. In addition, a great deal of extremely valuable informationregarding the state of the system is lost when the system is shut down. Thisinformation is referred to as "volatile" information, and it includessuch things as process information, network connections, clipboard contents,etc. This information can be retrieved, parsed, and analyzed in order todetermine first whether an incident has even occurred, and then the extent ofthe incident. In some cases, enough information may have been collected to showthat the incident is manageable, and the system does not have to be taken outof service to be "cleaned." More importantly, the investigator willwant to understand how the system wasinfected or compromised so that shortfalls in security policies can berectified and other systems protected.The Perl programming language is used to programmaticallydemonstrate many of the concepts addressed throughout the book. The underlyingpremise of the book is to get the reader "under the hood" within theWindows system, that is, to show the reader how to move beyond the simple GUItools provided with the operating system in order to collect information aboutthe state of the system. Many third party tools are discussed, and several Perlscripts are provided in order to support this premise. Perl scripts are alsoused in this book to provide for customization and automation. By customization,we mean that Perl is used to correlate and "massage" the output ofvarious third party tools in order to present a more complete picture of thedata. By automation, we mean that Perl is used in this book to implement amethodology so that the investigator does not have to perform the steps byhand, thereby avoiding mistakes and making the overall process more efficient.This book guides the reader through information, tools, andtechniques that are required to conduct incident response and live forensicaudit activities. By providing the necessary background for understanding howincidents occur and how data can be hidden on compromised systems, the readerwill have a better understanding of the "why’s" and "how’s"of incident response and forensic audit activities.

Read from the Book

Preface As long as networks of Microsoft Windows systems aremanaged, administered, and used by people, security incidents will occur.Regardless of whether weÕre talking about hundreds of corporate Windowsworkstations and servers or home user systems running Windows XP on broadbandconnections to the Internet, Windows systems will be attacked, compromised, andused for malicious purposes. This is not to say that only Windows systems willbe attacked; rather, Windows systems are highly pervasive throughout the entirecomputing infrastructure, from home and school systems to high-end e-commercesites. In contrast to this pervasiveness, information regarding conductingeffective incident response and forensic audit activities on Windows systems islimited, to say the least. Attacks may come from insiders who have legitimatephysical access to systems and are authorized to use them or from facelessindividuals hiding in the shapeless ether of the Internet. Knowing this, anyonewho manages or administers Windows systems (including the home user) needs toknow how to react when he suspects that an incident has occurred. When it comes to investigating and resolving computer securityincidents, Windows systems lag well behind Linux and * nix systems. This gapcan be attributed to a variety of reasons. One reason is a lack of detailedtechnical knowledge regarding Windows systems themselves on the part ofadministrators. This lack of understanding may be due at least in part toMicrosoftÕs use of graphical user interfaces (GUIs) to control everything fromthe installation process to all aspects of system administration. Attackers andmalicious users take steps to ensure that their activities remain hidden fromview, particularly from the systemÕs GUI tools such as the Event Viewer and theTask Manager. For example, enabling an audit policy requires that the systemadministrator navigate through multiple layers of the GUI, while an attackercan easily disable (and then reenable, if necessary) that audit policy with asingle command line tool (which, incidentally, is provided for free fromMicrosoft). Other reasons for the "incident response gap" include a lack ofunderstanding regarding how to use available native and third-party tools toretrieve data and how to interpret the data that is collected from potentiallyinfected or compromised systems. Many useful and powerful tools that mirror thefunctionality used on Linux systems are not available through either theMicrosoft operating system distributions or the Resource Kits. Sites that makethese tools available are scattered across the Internet, with no centrallocation cataloguing them. This book was written to aid anyone investigatingincidents that occur on Windows systems by providing information regarding thetools and techniques used to respond to incidents and conduct forensic audits. This book arose out of a need that I, and I am sure others, haveseen in the Microsoft Windows system administration community. MicrosoftÕsnetwork operating systems, beginning with Windows NT, are designed to be easyto use and manage. These systems come with some very powerful tools. As usefulas these tools are to the administrator, they are also very useful to anattacker or to a malicious user. Most system administrators and owners spendtheir time dealing with Windows operating systems through the GUI, and in doingso, miss many of the important aspects of the operating system that go on"under the hood." For example, the Task Manager does not show the complete pathto the executable image for each process, nor does it display the command lineused to launch each process. This information is available using third-partytools, which most folks who work with Windows systems may not be familiar with.Therefore, it may be relatively simple to hide an errant process, such as anetwork backdoor, by renaming the file "svchost.exe" or something similarlyinnocuous. Several years ago, I developed a hands-on course for teachingsystem administrators how to respond to security incidents on Windows 2000systems. While teaching the course to system administrators at variousorganizations, I saw the same things that I saw on listservs and on forums onthe Internet. During the first break on the first day of the course, I would goaround the room and "infect" all of the systems with a "Trojan." This "Trojan"was netcat, renamed to "inetinfo.exe," listening on port 80. When the attendeesreturned to the room, IÕd tell them that I "infected" their systems andchallenged them to find it. The purpose of this exercise was not to find outwho could find the "Trojan" first but to look at the steps that the attendeeswould go through in their incident response activities, to look at their"methodology." Invariably, every attendee would examine the contents of theEvent Log, comb through the Task Manager, and maybe run netstat Ðan from acommand prompt. All of the systems were connected to the Internet, and the onlyinstructions I would give to the class was that they could not use any of thetools from the course CD that IÕd put together. As the course progressedthrough the rest of the two days, the attendees became familiar with the toolsand techniques they could use to retrieve valuable data about a system, as wellas how to interpret that data. IÕve assembled a good deal of unique content for this book,information that IÕve developed because I havenÕt been able to locate it anyplace else and therefore had to do my own research. For example, when I firstbegan researching NTFS alternate data streams, there wasnÕt much informationavailable. Over time, research has revealed additional information, which isincluded in this book. IÕve included tools that IÕve developed (written inPerl) and information, results, and insights from my own research. This bookalso includes information from a variety of sources put together in a singlelocation so that it can be easily referenced. Unlike other books about incident response, this book is specificto Windows systems. Other books on the subject will present a great deal ofinformation regarding Linux and Unix systems, and in some cases, leave it up tothe reader to extrapolate the information to Windows. All of the tools andtechniques presented in this book are specific to Windows (NT, 2000, XP, and2003) systems. The book is organized so that the reader progresses through anunderstanding of incidents, what they are and how they can (and do) occur. Fromthere, the reader is guided through developing an understanding of what isrequired to prevent incidents and how to prepare for them, and then where tolook for data and how to analyze that data, should an incident occur. Datahiding and tools used in incident response and live forensic audits are coveredat great length, and all of the information presented is specific to Windowsoperating systems, file systems (i.e., NTFS), and applications (i.e., MS Word,etc.). This information is presented in a progression, each chapter taking thecontent of the previous chapter further. However, each chapter can also stand onits own, as a reference that the reader can return to time and time again. The main premise of this book is really very simple. Whenincidents occur, an entire spectrum of incident response activities can beperformed. The lower end of the spectrum involves...well...nothing. Noactivity. Basically, the incident goes completely unrecognized or is simplyignored. The opposite end of the spectrum consists of those activities thatpurists think of when they hear the word "forensics": the system is shut down ina forensically sound manner and a bit-level image of the drive is made. Allinvestigative activities are then conducted against that copy. This is usuallyaccompanied by law enforcement involvement and may even lead to prosecution.However, many organizations do not wish to involve law enforcement when anincident occurs and generally conduct non-litigious investigations because theyjust want to get systems back online and in use. In other cases, potentiallycompromised systems may be part of an e-commerce infrastructure, in whichdowntime is measured in hundreds of dollars per minute. In such cases, aninvestigation will occur, but it will not involve law enforcement or legalprosecution, as the goal is determining what, if anything, happened. These stepsmay be required to gather information and facts in order to justify furtheraction, such as taking the system down. In addition, a great deal of extremely valuable informationregarding the state of the system is lost when the system is shut down. This informationis referred to as "volatile" information, and it includes such things asprocess information, network connections, clipboard contents, etc. Thisinformation can be retrieved, parsed, and analyzed in order to determine firstwhether an incident has even occurred, and then the extent of the incident. Insome cases, enough information may have been collected to show that theincident is manageable, and the system does not have to be taken out of serviceto be "cleaned." More importantly, the investigator will want to understand how the system was infectedor compromised so that shortfalls in security policies can be rectified andother systems protected. The Perl programming language is used to programmaticallydemonstrate many of the concepts addressed throughout the book. The underlyingpremise of the book is to get the reader "under the hood" within the Windowssystem, that is, to show the reader how to move beyond the simple GUI toolsprovided with the operating system in order to collect information about thestate of the system. Many third-party tools are discussed, and several Perlscripts are provided in order to support this premise. Perl scripts are alsoused in this book to provide for customization and automation. Bycustomization, we mean that Perl is used to correlate and "massage" the outputof various third-party tools in order to present a more complete picture of thedata. By automation, we mean that Perl is used in this book to implement amethodology so that the investigator does not have to perform the steps byhand, thereby avoiding mistakes and making the overall process more efficient. This book guides the reader through information, tools, andtechniques that are required to conduct incident response and live forensicaudit activities. By providing the necessary background for understanding howincidents occur and how data can be hidden on compromised systems, the readerwill have a better understanding of the "whyÕs" and "howÕs" of incidentresponse and forensic audit activities.

Table of Contents

Preface.

1. Introduction.

    Definitions.

    Intended Audience.

    Book Layout.

    Defining the Issue.

    The Pervasiveness and Complexity of Windows Systems.

    The Pervasiveness of High-Speed Connections.

    The Pervasiveness of Easy-to-Use Tools.

    Purpose.

    Real Incidents.

    Where To Go For More Information.

    Conclusion.

2. How Incidents Occur.

    Definitions.

    Purpose.

    Incidents.

    Local vs. Remote.

    Manual vs. Automatic.

    Lowest Common Denominator.

    Attacks Are Easy.

    Summary.

3. Data Hiding.

    File Attributes.

    The Hidden Attribute.

    File Signatures.

    File Times.

    File Segmentation.

    File Binding.

    NTFS Alternate Data Streams.

    Hiding Data in the Registry.

    Office Documents.

    OLE Structured Storage.

    Steganography.

    Summary.

4. Incident Preparation.

    Perimeter Devices.

    Host Configuration.

    NTFS File System.

    Configuring the System with the SCM.

    Group Policies.

    Getting Under the Hood.

    User Rights.

    Restricting Services.

    Permissions.

    Audit Settings and the Event Log.

    Windows File Protection.

    WFP and ADSs.

    Patch Management.

    Anti-Virus.

    Monitoring.

    Summary.

5. Incident Response Tools.

    Definitions.

    Tools for Collecting Volatile Information.

    Logged On User(s).

    Process Information.

    Process Memory.

    Network Information and Connections.

    Clipboard Contents.

    Command History.

    Services and Drivers.

    Group Policy Information.

    Tools for Collecting Non-Volatile Information.

    Collecting Files.

    Contents for the Recycle Bin.

    Registry Key Contents and Information.

    Scheduled Tasks.

    User Information.

    Dumping the Event Logs.

    Tools for Analyzing Files.

    Executable files.

    Process Memory Dumps.

    Microsoft Word Documents.

    PDF Documents.

    Summary.

6. Developing a Methodology.

    Introduction.

    Prologue.

    First Dream.

    Second Dream.

    Third Dream.

    Fourth Dream.

    Fifth Dream.

    Summary.

7. Knowing What to Look For.

    Investigation Overview.

    Infection Vectors.

    Malware Footprints and Persistence.

    Files and Directories.

    Registry Keys.

    Processes.

    Open Ports.

    Services.

    Rootkits.

    AFX Windows Rootkit 2003.

    Detecting Rootkits.

    Preventing Rootkit Installations.

    Summary.

8. Using the Forensic Server Project.

    The Forensic Server Project.

    Collecting Data Using FSP.

    Launching the Forensic Server.

    Running the First Responder Utility.

    File Client Component.

    Correlating and Analyzing Data Using FSP.

    Infected Windows 2003 System.

    A Rootkit on a Windows 2000 System.

    A Compromised Windows 2000 System.

    Future Directions of the Forensic Server Project.

    Summary.

9. Scanners and Sniffers.

    Port Scanners.

    Netcat.

    Portqry.

    Nmap.

    Network Sniffers.

    NetMon.

    Netcap.

    Windump.

    Analyzer.

    Ethereal.

    Summary.

Appendix A. Installing Perl on Windows.

    Installing Perl and Perl Modules.

    Perl Editors.

    Running Perl Scripts.

    Setting Up Perl for Use with this Book.

    Win32::Lanman.

    Win32::TaskScheduler.

    Win32::File::Ver.

    Win32::API::Prototype.

    Win32::Perms.

    Win32::GUI.

    Win32::FileOp.

    Win32::DriveInfo.

    Win32::IPConfig.

    Summary.

Appendix B. Web Sites.

    Searching.

    Sites for Information about Windows.

    Anti-Virus Sites.

    Program Sites.

    Security Information Sites.

    Perl Programming and Code Sites.

    General Reading.

Appendix C. Answers to Chapter 9 Questions.

    FTP Traffic Capture.

    Netcat Traffic Capture.

    Null Session Traffic Capture.

    IIS Traffic Capture.

    Nmap Traffic Capture.

Appendix D. CD Contents.

Index.