Ch6 - Operating System Forensics
Ch6 - Operating System Forensics
Session Objectives:
At the end of this Session, you will be able to understand Where evidence resides in a Windows System? Conducting Windows Examination. Event Viewer. How to find events in Logs? How to Manage Log Contents? Few Ways to recover Deleted Data. Windows Registry Basics. Forensics of Linux System. Linux system Analysis.
Inroduction__________________________________________
When your initial response indicates that further investigation is warranted, you have two options: You could perform the investigative steps on the evidence media itself, or you could perform forensic duplication of the evidence media, and then perform the investigative steps on a restored image. If you choose to investigate the evidence media itself without creating a forensic duplication, you will be changing the actual evidence, and you will not have a baseline for comparison after your intrusive investigative steps have altered the system. For example, simply viewing a file or directory entry on the evidence system causes information on the system to be changed. But this information could be the key element in establishing the acts of a suspect. On the other hand, if you have created a forensic duplicate of the evidence media, you will always have the original forensic image to restore should your investigative steps accidentally delete or destroy evidence. Therefore, we recommend using a forensic duplication for your investigations. This chapter explores the different ways to investigate Windows systems (NT, 2000, and XP) in an effort to confirm unlawful, unacceptable, or unauthorized behavior. We assume that you have performed the following tasks: 1. Conducted an initial response and confirmed that further investigation is necessary. 2. Consulted with legal counsel. 3. Performed a forensic duplication of the evidence drive, using Safeback, EnCase, or another imaging tool. You will need a formal approach to investigating the system, because a disorganized approach will lead to mistakes and overlooked evidence. This chapter outlines many of the steps you will need to take to unearth the evidence for proving or disproving allegations.
The Recycle Bin (a hidden, logical file structure where recently deleted items can be found) The printer spool Sent or received email, such as the .pst files for Outlook mail
Any user can view the Application and System logs, but only administrators can read the Security log. The Security log is usually the most useful log during incident response. An investigator must be comfortable with viewing and filtering the output to these logs to recognize the evidence that they contain.
Investigators are most interested in the event IDs in the Event column. Each event ID represents a specific type of system event. Experienced system administrators are familiar with the event IDs that are listed in Table given below. ID 516 517 528 529 531 538 576 578 595 608 610 612 624 626 630 636 642 643 Description Some audit event records discarded Audit log cleared Successful logon Failed logon Failed logon, locked Successful logoff Assignment and use of rights Privileged service use Indirect access to object Rights policy change New trusted domain Audit policy change New account added User account enabled User account deleted Account group change User account change Domain policy change
Type The type of event. This can be one of the following five types: Error, Warning, Information, Success Audit, or Failure Audit. Category A classification of the event by the event source. This is primarily used in the security log. 6.4.4.2 Event Types The description of each event that is logged depends on the type of event. Each event in a log can be classified into one of the following types: Information An event that describes the successful operation of a task, such as an application, driver, or service. For example, an Information event is logged when a network driver loads successfully. Warning An event that is not necessarily significant, however, may indicate the possible occurrence of a future problem. For example, a Warning message is logged when disk space starts to run low. Error An event that describes a significant problem, such as the failure of a critical task. Error events may involve data loss or loss of functionality. For example, an Error event is logged if a service fails to load during startup. Success Audit (Security log) An event that describes the successful completion of an audited security event. For example, a Success Audit event is logged when a user logs on to the computer. Failure Audit (Security log) An event that describes an audited security event that did not complete successfully. For example, a Failure Audit may be logged when a user cannot access a network drive.
The event that matches your search criteria is highlighted in the details pane. Click Find Next to locate the next occurrence of an event as defined by your search criteria. 6.4.5.2 How to Filter Log Events To filter log events, follow these steps: 1. Click Start, and then click Control Panel. Click Performance and Maintenance, then click Administrative Tools, and then double-click Computer Management. Or, open the MMC containing the Event Viewer snap-in. 2. In the console tree, expand Event Viewer, and then click the log that contains the event that you want to view. 3. On the View menu, click Filter. 4. Click the Filter tab (if it is not already selected). 5. Specify the filter options that you want, and then click OK. Only events that match your filter criteria are displayed in the details pane. To return the view to display all log entries, click Filter on the View menu, and then click Restore Defaults.
Log-file format (.evt) Text-file format (.txt) Comma-delimited text-file format (.csv)
All Rights Reserved. www.sedulitygroups.com
To archive a log, follow these steps: 1. Click Start, and then click Control Panel. Click Performance and Maintenance, then click Administrative Tools, and then double-click Computer Management. Or, open the MMC containing the Event Viewer snap-in. 2. In the console tree, expand Event Viewer, and then right-click the log in which you want to archive, and then click Save Log File As. 3. Specify a file name and location where you want to save the file. In the Save as type box, click the format that you want, and then click Save. The log file is saved in the format that you specified.
Using PsLogList and importing the event logs into Excel or some other spreadsheet application, as described in the previous section, makes it easier to review the logs and create reports.
11
Popular third-party software can augment the monitoring and record keeping a Windows system performs. You hit a jackpot every time your incidents occur on a system running a host-based firewall. Third-party firewall software provides fantastic audit trails for investigators to piece together incoming and outgoing network activity on a system. Most personal firewall applications record every web site a system visits, trap viruses, and provide an audit trail for every known attack on the system. This certainly makes reconstructing events easier.
12
As this table shows, you can determine the actions taken by an attacker by reviewing the time/date stamps.
All Rights Reserved. www.sedulitygroups.com
13
15
Links are used to associate a desktop shortcut or a Start menu item with an application or a document. Manually removing applications or documents does not remove the links that were created for them. Users may delete files but forget to delete the desktop icon on the system. The NTRK tool chklnks.exe is excellent for unearthing files that were once installed but now are nowhere to be found. As shown below, chklnks finds dead (broken) links.
Links are also important when considering network connections and shortcuts. Average users have desktopshortcuts for their ISP dialupconnections and other network connections. Check out the users \%systemroot%\Profiles\<user>\Desktopdirectory and review all the links (*.lnk) for that users desktop applications.
For the initial response, you can simply use the about:cache URL to review the contents of the fat.db. Internet Explorer maintains its temporary Internet files in the \Documents and Settings\<UserId>\Local Settings\Temporary Internet Files directory. The index.dat file holds the viewer history. The actual HTML and files are stored in the Internet Explorer cache files, usually found in the \WINNT\Temporary Internet Files directory on Windows NT systems. Windows 2000 maintains the web browser cache in \Documents and Settings\<User Account>\Local Settings\Temporary Internet Files. The index.dat file in Windows 2000 that maps cached HTML pages to actual dates, times, and specific URLs is located in the \Documents and Settings\<User Account>\Application Data\Microsoft\ Internet Explorer\UserData directory. Netscapes fat.db and netscape.hst files and Internet Explorers index.dat file are binary files. Therefore, you must use a special utility to view them. The Internet Explorer History Viewer tool allows you to view most of the binary files maintained by both Netscape (fat.db and netscape.hst) and Internet Explorer (index.dat). Pasco, a free forensic utility written by Keith Jones of Foundstone, allows the examination of Internet Explorer cache files. (Keith Jones also wrote several other free forensic utilities to view the contents of cookie files and the INFO2 file.)
18
Other commonly used methods to hide files within the logical file system include changing the file extension or creatively naming the files to match those of important system files. Neither of these methods should throw off an experienced examiner, but they can fool some popular automated forensic tools.
19
Remote-control applications allow only a single remote user to control the system at a time. Thus, attackers prefer to connect to a service that allows remote access, rather than remote control. Windows RAS enables remote access, where multiple remote users can simultaneously connect to the system via a modem connection. RAS is a favorite access point for the ex-employee who wants to maintain access to his prior employers network. This is because RAS is the only remote-command-level access that comes standard with Windows NT Server systems. Windows NT Server is capable of handling 256 incoming RAS connections right out of the box. Use the tool rasusers to list all the user accounts that have the privilege to log in to the RAS server. We issue the net start command without any arguments to view all the running services: Net start If a system is offering RAS, you will see this service being offered when you issue the net start command.
It is also a good idea to immediately review the files in the Recycle Bin to determine whether the employee deleted anything that was critical to the company or obfuscating the fact that she had files that she should not have been able to access. Use AFind (a tool from Foundstone) to determine all the files accessed in the last few days prior to departure. Or, use dir output to search on time/date stamps. Finally, perform a quick review of the most recently used files by using the GUI interface or viewing the Registry.
Common Areas view Report view Generate Report function Decryption and interpretation of protected storage areas
All Rights Reserved. www.sedulitygroups.com
21
Note: The dongle is checked only at program startup; putting in or taking out a dongle during a session does not switch from Demo mode to Full mode. You must restart Registry Viewer in order to switch between Demo and Full program modes.
System
\Windows \Windows\profiles\useraccount \Documents and Settings\user Protected storage for the user account Most recently used (MRU) files User preference settings \Winnt\system32\config System settings \Winnt\system32\config User account management and security settings \Winnt\system32\config Security settings \Winnt\system32\config All installed programs, their settings, and any usernames and passwords associated with them \Winnt\system32\config System settings
When you open one of these files in Registry Viewer, a registry tree appears in the left pane of the Full Registry view. The tree is organized in a hierarchical structure, similar in appearance to the folder and file structure of the Windows file system. Each registry entry, denoted by a folder icon, is called a key. Some keys contain subkeys, which may in turn contain other subkeys. 22
All Rights Reserved. www.sedulitygroups.com
When you select a key, the top-right pane displays the keys values or the information associated with that key. Each value has a name and data type, followed by a representation of the values data. The data type tells you what kind of data the value contains as well as how it is represented. For example, values of the REG_BINARY type contain raw binary data and are displayed in hexadecimal format. The following table lists the possible data types: Data Type REG_BINARY Description Raw binary data displayed in hexadecimal format. Most hardware component information is stored as binary data. REG_DWORD Data represented by a number that is four bytes long (a 32-bit integer). Many parameters for device drivers and services are this type, and are displayed in binary, hexadecimal, or decimal format. Related values are: DWORD_LITTLE_ENDIAN (the least significant byte is at the lowest address) REG_DWORD_BIG_ENDIAN (the least significant byte is at the highest address) REG_EXPAND_SZ A variable-length data string. This data type includes variables that are resolved when a program or service uses the data. REG_MULTI_SZ A multiple string. Entries are separated by spaces, commas, or other marks. Values that contain lists or multiple values in a format that people can read are usually this type. REG_SZ A fixed-length text string. REG_NONE Data with no particular type. This data is written to the registry by the system or application, and is displayed in hexadecimal format. REG_LINK A Unicode string naming a symbolic link. REG_QWORD Data represented by 64-bit integer. REG_RESOURCE_LIST A series of nested arrays designed to store a resource list used by a hardware device driver or one of the physical devices it controls. This data is detected by the system and is displayed in hexadecimal format as a binary value. REG_RESOURCE_REQUIREMENTS_LIST A series of nested arrays designed to store a device drivers list of possible hardware recourses it, or one of the physical devices it controls, can use. This data is detected by the system and is displayed in hexadecimal format as a binary value. All Rights Reserved. www.sedulitygroups.com 23
REG_FULL_RESOURCE_DESCRIPTOR
A series of nested arrays designed to store a resource list used by a physical hardware device. This data is displayed in hexadecimal format as a binary value.
24
To use the Find option: 1 From the menu, select Edit, and then Find. The Find dialog appears. 2 In the Find What field, enter the text string for which you want to search. 3 Select the registry file areas you want to search. Mark the Keys checkbox to search for the specified string in all key names. Mark the Values checkbox to search for the specified string in all value names. Mark the Data checkbox to search for the specified string in all value data. Mark the Match Whole String Only checkbox to find only data that matches the entire specified string.
4 Click Find Next to search for the specified string. When Registry Viewer finds a match
to the specified string, it expands the registry tree and highlights the key that contains the matching data. To search for the next instance of the specified string, select Edit, and then Find Next from the menu, or press F3. Using the Advanced Search Option The Advanced Find option lets you search for and view all instances of a specific text string. You can also add the search results to the Report view.
25
To use the Advanced Find Option: 1. From the menu, select Edit, and then Advanced Find. The Advanced Find dialog opens. 2. In the Find What field, enter the text string for which you want to search. 3. In the drop-down box, select the registry area you want to search: Full Registry, Report Items, or Common Areas. 4. Mark the registry file items you want to search: Mark the Keys checkbox to search for the specified string in all key names. Mark the Values checkbox to search for the specified string in all value names. Mark the Data checkbox to search for the specified string in all value data. 5. Check Match Whole String Only to find only data that matches the entire specified string. 6. Click Search to look for all instances of the specified string. Registry Viewer displays all keys that contain matching data in the results list. The total number of found keys is displayed at the upper-right corner of the list. To add keys in the Results list to the Report view: Mark the checkbox next to the keys you want to add. To checkmark all listed keys, click the checkmark button. To uncheck all marked keys, click the empty button. Click Add to Report. The marked keys are added to the Report view at the root level. Click Clear Results to clear all found keys from the Results list. When finished, click Done. Using the Search by Date Option The Search by Date option lets you search for keys based on the date they were last written to the registry file. You can add found keys to the Report view. To use Search by Date to search for keys: 1. From the menu, select Edit, and then Search by Date. The Search by Last Written Date dialog appears. 2. Select the date range you want to search. Select during a Date Range to search for keys last written between two specified dates. Select During and After a Given Date to search for keys last written on or after a specified date. Select During and Before a Given Date to search for keys last written on or before a specified date. 3. In the Search In drop-down box, select the registry area you want to search: Full Registry, Report Items, or Common Areas. 4. In the date fields, enter a date, or click the drop-down arrow to select a date from the popup calendar. 5. Click Search to look for all keys last written in the specified date range. Registry Viewer displays all matching keys in the Results list. The total number of found 26
All Rights Reserved. www.sedulitygroups.com
keys is displayed at the upper-right corner of the list. To add keys in the Results list to the Report view: Mark the checkbox next to the keys you want to add. To checkmark all listed keys, click the checkmark button. To uncheck all marked keys, click the empty button. Click Add to Report. The marked keys are added to the Report view at the root level. Click Clear Results to clear all found keys from the Results list. When finished, click Done. Using the Full Registry View The Full Registry view displays all the contents of the open registry file. A Windows registry is made up of multiple files. Because Registry Viewer opens one file at a time, it does not display the whole registry but only the information contained in the currently open file. The Full Registry view is the default view when opening a file.
Using the Common Areas View The Common Areas view helps you quickly access those areas of a registry file most likely to contain information important to you. Unlike the Full Registry view, which displays all the contents of a registry file, the Common Areas view shows only those keys, such as usernames, passwords, browser history, which you have marked in other registry files as forensically interesting. Note: Registry viewer provides some customizable common areas by default. Of course, the various files that make up a registry contain different information, so the keys and subkeys that appear in your Common Areas view depend upon whether they exist in the newer registry file as well.
All Rights Reserved. www.sedulitygroups.com
27
To view the Common Areas, select View, and then Common Areas from the menu.
Adding Keys to the Common Areas View Registry Viewer keeps track of each key you add, remembering them between registry files and sessions. Keys that have been added to the Common Areas view are identified by a folder icon overlaid by a green key To add a key to the Common Areas view: 1. Select View, and then the Full Registry from the menu. 2. In the registry tree, locate and select the key you want to add. 3. Select Edit from the menu, and then Add to Common Areas. Removing Keys from the Common Areas View Registry Viewer keeps track of each key you remove. The folder icon no longer appears next to the key. To remove a key from the Common Areas view: 1. In the Common Areas view, locate and select the key you want to remove. 2. From the menu, select Edit, and then Remove from Common Areas. Using the Reports View The Report view lists the keys you add to a report in the order you add them. You can reorder keys in the tree by dragging them up or down. You can also remove keys from the Report view. When you are finished, you can generate a report file containing all the selected keys and their associated information. To view the Report view, select View, and then Report Items from the menu.
28
Adding Keys to the Report View Keys added to the Report view are not saved between sessions or registry files. To save a record of this information, you must generate a report file or a summary report before closing the registry file or exiting Registry Viewer. Keys that have been added to the Report view are identified by special folder icons in the registry tree: Keys added individually are denoted by. Keys added with children are denoted by. Keys added as children of a parent key are denoted by.
To add a key to the Report view:
1. Open the view that contains the keys you want to add. To open the Full Registry, select View, and then Full Registry from the menu. To open the Common Areas, select View, and then Common Areas from the menu. 2. In the registry tree, locate and select the key you want to add. 3. Add the key to the Report view by doing one of the following: From the menu, select Report, and then Add to Report. From the menu, select Report, and then Add to Report with Children. Note: In the Common Areas view, if you select the Common Areas root item in the tree, this option becomes Add Children to Report. Each child key (with its subkeys) under the Common Areas root item is added individually to the Report view. Because each key is added at the main level of the Report tree, you can also remove individual keys. For more information on removing keys, see the following section Removing Keys from the Report View.
The selected key is added to the Report view at the root of the Report tree.
29
Removing Keys from the Report View You can remove keys from the Report view. You can remove only keys at the main level of the Report tree. You cannot remove individual subkeys. To remove a key from the Report view: 1. In the Report view, Full Registry view, or Common Areas view, locate and select the key you want to remove. 2. From the menu, select Report, and then Remove from Report. To remove all keys from the Report view, select Report, and then Clear All Report Entries from the menu. Generating a Report After you have finished adding keys to the Report view, you can generate a printable, HTML report file containing all the selected keys and their associated information. To generate a report file: 1. From the menu, select Report, and then Generate Report. The Create Report dialog appears. 2. In the Report Title field, enter a title for the report. 3. In the Report Location field, enter the location where you want to save the report file or click Browse to navigate to the directory location. The default location for report files is \AccessData\AccessData Registry Viewer\Report. 4. In the Report Filename field, enter a filename for the report file. The name of the current registry file is entered by default. 5. Mark the Reduce Excess Data Output checkbox to limit the data displayed for a value or string to the first 17 bytes. In the generated report, you can view the additional data for a value or string by moving your cursor over the Data field. A popup displays the complete data. 6. Mark the Also Show DWORD Values as Timestamps checkbox to display timestamp equivalents for all DWORD values. Timestamps are displayed in both UTC and local time formats. 7. Mark the Show Key Properties Only checkbox to include the items displayed in the Key Properties pane. 8. Mark the View Report when Created checkbox to automatically open the newly created report file (Index.htm) in your Internet browser. 9. Click OK to generate the report file. If you integrate Registry Viewer with AccessData Forensic Toolkit (FTK), Registry Viewer uses the case report location defined in FTK as the default location for the generated report. For more information, see Integrating the Forensic Toolkit or see the Forensic Toolkit manual. Generating a File-types Report Registry Viewer lets you create a report that identifies all the file-type information stored in the currently open registry file. A files type indicates what kind of information is stored in the file. Each file type is associated with one or more filename extensions (e.g., .txt, .doc, and .htm) and with the programs that can open those files. To generate a file types report:
30
1. From the menu, select Report, and then Generate File Types Report. The Create File Types Report dialog appears. 2. In the Report Title field, enter a title for the report. 3. In the Report Location field, enter the location where you want to save the report file, or click Browse to navigate to the directory location. The default location for report files is \AccessData\AccessData Registry Viewer\Report. 4. In the Report Filename field, enter a filename for the report file. The name <current registry file>-filetypes is entered by default. 5. Mark the View Report when Created checkbox to automatically open the newly created report file (*.htm) in your Internet browser. 6. Click OK to generate the report file. Defining a Summary Report In addition to creating reports by adding keys to the Report view, Registry Viewer gives you the option to define summary reports. Summary reports differ from those created in the Report view in three important ways: You add individual key values to a summary report definition. Unlike the Report view in which adding a key automatically adds all the values contained in that key, a summary report definition allows you to select and add individual key values from any key in the registry file. Summary report definitions allow you to create reports that contain only those key values of forensic interest. You can also create multiple summary report definitions for the same registry file, each targeted to a different area of an investigation. You can group the added key values into user-defined sections. In a summary report definition, key values can be grouped in up to ten different sections. When the summary report is generated, grouped key values appear together under a specified section heading. You can use sections to combine information from different areas of a registry file. For example, you can group together all the key values containing information about a specific user (e.g., username, visited Internet Websites, and MRU lists). Summary report definitions are saved between registry files and sessions. Registry Viewer automatically saves the summary report definitions that you create. You can use these saved definitions again and again to generate summary reports from different registry files. The resulting reports contain the same key values, grouped in the same sections, but the actual information associated with those values is, of course, specific to each registry file.
31
To define a summary report: 1. Open the view that contains the key values you want to add. 2. In the registry tree, locate and select the key that contains the values you want to add. 3. Select Report from the menu, and then Define Summary Report. You can also right-click the key and select Define Summary Report from the quick menu. The Define Summary Report dialog opens. 4. In the Summary Report Title field, enter a name for the summary report definition. The name of the selected key is entered by default. The Summary Report Title appears in the Summary Reports dialog and is also the filename for all reports generated with this definition. Be sure to choose a descriptive, easily identifiable name. 5. Define wildcard keys, if needed. A wildcard key allows you to add key values to the summary report definition for keys that may exist in the current registry file. There are two types of wildcard keys: a wildcard that finds the specified key values in any of the direct subkeys of a selected parent key, and a wildcard that finds the specified key values in the selected key and any of its descendants. For more information, see Adding Wildcard Keys to a Summary Report. 6. In the Summary Key registry tree, locate and select a key that contains key values you want to add. The keys values are displayed in the Available Items list. 7. If you want to group added key values into sections: Select the appropriate section number (110) from the drop-down list. You must define sections sequentially (i.e., define section 1 first, then section 2, and so forth). 7b In the Section Title field, enter a name for the section. This is the name that appears as the section heading in a generated report, so be sure to choose a descriptive name.
32
8. Add specific key values to the summary report definition by doing any of the following: Select a key value in the Available Items list and click Add Value. Press the Ctrl button and click to select multiple key values. Click Add Value to add all the selected values to the report definition. To add all the key values in the Available Items list, click Select All, and then Add Value. The key values appear in the Included Items list. 9. Select Match any item, then click Add Value to add a key-value wildcard to the summary report definition. A key-value wildcard reports all values for the selected key, even if those values change in name or number between registry files. For example, you can use a key-value wildcard to return all the values in the MUICache key, even though the number and names of those key values (program paths, links, etc.) are unique to each registry file. 10. Click Add Unlisted Value to specify a value for the selected key that is not available in the current registry file. In the Add an Unlisted Value dialog, type the name of the key value, then click OK to add it to the summary report definition. For example, if you know that a software key often contains a Version value, but that value is not present in the current registry file, you can still add it to the summary report definition using the Add Unlisted Value option. If you then use the summary definition to create reports from other registry files, the Version value is reported whenever it is present. 11. To remove key values from the Included Items list, do one of the following: Select a key value and click Remove Value. Click Remove All to remove all key values in the list. 12. Click Preview Report to generate and view a printable HTML report file from the summary report definition. Preview reports are temporary: they are deleted from memory when you close the browser window. To generate a saved report, you must save the summary report definition and then generate the report from the Managing Summary Reports dialog. 13. When finished, click Save and Close to save the summary report definition, and to exit the dialog. After you have created a summary report definition, you can use the Manage Summary Reports feature to generate and view additional summary report files. Adding Wildcard Keys to a Summary Report When you define a summary report, you add values from specific keys. Because each key has a set name and registry. path, Registry Viewer can locate those keys in any registry file, and include their values in the generated report. Some keys, however, have names that change among registry files. For example, registry files often include username keys, where the name of each key is the name of a user with an account on that system. Because a username key is unique to a specific file, Registry Viewer cannot use its name and registry path to locate similar keys in other registry files. A wildcard key allows you to select and include key values from the subkeys under a selected parent key, even though the number and names of those subkeys change from registry file to registry file. Using a wildcard key allows you to include username key values in a summary report definition. When you add a wildcard key, you select a parent key that contains the subkeys you want to include in the report. You can then add specific key values from these subkeys (or children) to the summary report definition. Each value needs to be added only once for all the subkeys.
All Rights Reserved. www.sedulitygroups.com
33
When you generate the summary report, Registry Viewer uses the parent keys name and registry path to locate all of its subkeys, and display the selected key value information for each one. For example, you may want to a summary report to include password and login key values for each username key in a registry file. In the current file, there are two username keys, peter1 and paul2. Both are children of Users key. To set the wildcard key, you select the Users key as the parent key. You then select the peter1 subkey and add its password and login key values to the definition. When you generate the summary report, Registry Viewer first lists the password and login key value information for peter1, then the password and login information for paul2. Suppose you then use the summary report definition to create a report from a different registry file. In this file, the Users key contains three children: mary1, mary2 and mary3. The generated report lists the password and login information for mary1, followed by the password and login information for mary2, then mary3. If mary3 doesnt have a defined password, This summary report item does not exist in the current registry file displays for that value. To add a wildcard key to a summary report definition: 1. 1 In the Summary Key registry tree, locate and select the parent key of the subkeys you want to include in the report. 2. In the Wildcard Key definition box, select the type of wildcard key you want to add: Match All Immediate Children finds the specified key values in the direct subkeys of only the selected parent key. Match the Entire Subtree finds the specified key values in the selected parent key and any of its descendants. 3. Click Use Currently Selected Key. The full registry path of the parent key appears in the Wildcard Key field. Managing Summary Reports After you have created a summary report definition, you can use the Manage Summary Reports feature to preview and generate a printable HTML report file containing the summary reports selected key values and associated information. You can also edit or delete existing summary report definitions. To manage summary report definitions, select Report, and then Manage Summary Reports from the menu. The Summary Reports dialog lists the available summary report definitions. Previewing a Summary Report When you preview a summary report, Registry Viewer generates a temporary report using the information in the currently open registry file and then displays it in Internet Explorer. Preview reports are not saved; they are deleted from memory when you close the browser window. To preview a summary report: 1 In the Available Summary Reports list, select the report definition. 2 Mark the Reduce Excess Data Output checkbox to limit the data displayed for a value or string to the first 17 bytes. In the generated report, you can view the additional data for a value or string by moving your cursor over the Data field. A popup displays the complete data. 34
All Rights Reserved. www.sedulitygroups.com
1. Mark the Also Show DWORD Values as Timestamps checkbox to display timestamp equivalents for all DWORD values. Timestamps are displayed in both UTC and local time formats. 2. Click Preview. Registry Viewer asks if you wish to include Empty Values in this report. Click Yes to include all defined key values, even if they contain no data. Click No to include only those key values that contain data. 3. Registry Viewer opens the summary report file in Internet Explorer. Generating a Summary Report When you generate a summary report, Registry Viewer uses the selected report definition to extract the specified key values from the currently open registry file. The resulting report is then saved. To generate a summary report: 1. In the Available Summary Reports list, select the report definition. 2. Mark the Reduce Excess Data Output checkbox to limit the data displayed for a value or string to the first 17 bytes. In the generated report, you can view the additional data for a value or string by moving your cursor over the Data field. A popup displays the complete data. 3. Mark the Also Show DWORD Values as Timestamps checkbox to display timestamp equivalents for all DWORD values. Timestamps are displayed in both UTC and local time formats. 4. Click Generate to make the HTML report file. Registry Viewer asks if you wish to include Empty Values in this report. Click Yes to include all defined key values, even if they contain no data. Click No to include only those key values that contain data. The generated file is automatically saved in the \AccessData\AccessData Registry Viewer\Reports folder. A time and date stamp is added to the filename for easy identification. 5 After the report generates successfully, click OK. To view a generated report, select Report, and then View Existing Reports from the menu. Editing a Summary Report Definition Registry Viewer allows you to edit previously created summary report definitions. To edit a summary report definition: 1. In the Available Summary Reports list, select the report definition. 2. Click Edit. The Define Summary Report dialog opens. 3. Edit the summary report definition as needed. 4. Click Save and Close to save your changes. Changes made to a summary report definition are permanent and affect all subsequent reports generated from that definition. Deleting a Summary Report Definition Registry Viewer lets you delete previously created summary report definitions. Deleting a report definition does not delete any summary report files generated from that definition. To delete a summary report definition: 1. In the Available Summary Reports list, select the report definition. 2. Click Delete Registry Viewer asks if you want to permanently delete the summary report definition. 3. Click Yes to delete the definition.
All Rights Reserved. www.sedulitygroups.com
35
Integrating Registry Viewer with Other AccessData Tools AccessData forensic tools generate lists of words from the drive images taken. These word lists are then used to attack passwords and open locked files and systems. Much of the functionality of these tools overlaps, and understanding how the programs work together will help you apply them to your cases. The AccessData Forensic Toolkit (FTK) indexes drive image files from which you can create your wordlists. This index includes all non-encrypted data in registry files such as the System Software and the unencrypted portions of the ntuser.dat file. By itself, FTK cant index encrypted portions of registry files such as the Protected Storage area of the registry files desired. FTK utilizes Registry Viewer to decrypt and obtain word lists from these files. Registry Viewer can also create an individual word list from a single registry file. Use FTK to create your initial indexes and word lists. Use Registry Viewer to access the encrypted areas of ntuser.dat, then add Registry Viewers word list to the larger FTK word lists. One large, comprehensive word list will be easier to manage, and more efficient to apply to your case. Integrating Registry Viewer with the Forensic Toolkit (FTK) Integrating Registry Viewer with FTK allows you to seamlessly view registry files and create registry reports from within FTK. Any created reports are saved by default in the current FTK case report location. Integration also allows you to extract and open registry files on the fly from hard drive images. FTK automatically creates a temporary registry file from the image and opens it in Registry Viewer; after youre finished, FTK deletes the temporary file. To run Registry Viewer from FTK: 1. In FTK, open an existing case by selecting File, and then Open Case. 2. If you have chosen to always display the FTK Startup screen, select Open an Existing Case and then click OK. 3. Select the case you want to open. 4. Select File, and then Registry Viewer. 5. Select the registry file you want to view, and then click View File. 6. If you have located registry files in the case in FTK, you can right-click on a file and then select iew in Registry Viewer. Registry Viewer automatically launches. Updating Index.htm Registry Viewer generates a list of the reports named Index.htm used for reference by the Forensic Toolkit. This list is updated every time you create new report, but must be manually updated when you remove reports from the Report folder. To manually regenerate the Index.htm: 1. Activate the Report menu by opening a file in Registry Viewer. 2. From the main menu, select Report, and then Regenerate Index.htm to update the list of reports currently in your Report folder. Exporting a Word List If you are using PRTK, you can export the case index to use as a dictionary in the password recovery process. To export the word list: 36
All Rights Reserved. www.sedulitygroups.com
1. Select Tools, and then Export Word List. 2. Select the file and location to which you want to write the word list. The default filename is case_name.txt. 3. To add registry files, click Add Files and then select the registry files to add to the word list. 4. Click Save. For more information, see the AccessData Forensic Toolkit Users Guide. Integrating Registry Viewer with the Password Recovery Toolkit (PRTK) Registry Viewer lets you create and export a word list containing all the strings in a registry file. The word list can then be used in AccessData Password Recovery Toolkit (PRTK) as a dictionary for decoding passwords and pass-phrases. Exporting a Word List When you export a word list, Registry Viewer searches the registry file for key values that are stored as strings. Each string it finds is exported into a text file as a separate line. The resulting file contains a list of every string value in the registry. If you save or copy the word list file into the PRTK Dictionary folder (i.e., \AccessData\PRTK6\Dictionaries), PRTK can access the file as a user-defined dictionary. PRTK uses each line in the file as a possible password or pass-phrase in a password recovery operation. To export a word list: 1. From the menu, select Report, and then Export Word List. The Generate Word List dialog appears. 2. Navigate to the directory location where you want to save the word list file. The default path for word list files is \AccessData\AccessData Registry Viewer. 3. In the Filename field, enter a name for the word list file. The file (*.txt) is saved in plain-text format. 4. Click Save to export the word list.
6.28 Forensic Analysis of a Live Linux System, Pt. 1 Mariusz Burdach 2004-03-22
During the incident response process we often come across a situation where a compromised system wasn't powered off by a user or administrator. This is a great opportunity to acquire much valuable information, which is irretrievably lost after powering off. I'm referring to things such as: running processes, open TCP/UDP ports, program images which are deleted but still running in main memory, the contents of buffers, queues of connection requests, established connections and modules loaded into part of the virtual memory that is reserved for the Linux kernel. All of this data can help the investigator in offline examination to find forensic evidence. Moreover, when an incident is still relatively new we can recover almost all data used by and activities performed by an intruder. Sometimes the live procedure described here is the only way to acquire incident data because certain types of malicious code, such as LKM based rootkits, are loaded only to memory and don't modify any file or directory. A similar situation exists in Windows operating systems -- the Code Red worm is a good example of this, where the malicious code was not saved as a file, but was inserted into and then run directory from memory.
All Rights Reserved. www.sedulitygroups.com
37
On the other hand, methods presented below also have serious limitations and violate the primary requirement of the collection procedure for digital investigation -- a requirement which can not be easily fulfilled. That is: every user and kernel space tool used to collect data by nature changes the state of the target system. By running any tools on a live system we load them into memory and create at least one process which can overwrite possible evidence. By creating a new process, the memory management system of the operating system allocates data in main memory and then can overwrite other unallocated data in main memory or in the swap file system. Other problems arise when we plan to take legal actions and need to comply with local laws. The signs of intrusions found in images of main memory can be untrusted, because they could be created by our acquisition tools. So before taking any action we must decide whether to acquire some data from a live compromised system or not. It is very often worth it to collect such information. In the main memory image we can find passwords or decrypted files. Using /proc pseudo file system we can also recover programs that have been deleted but are still allocated in memory. In an ideal world, I could imagine a kind of hardware based solution for Intel-based computers, which would allow us to dump the whole memory to an external storage device without assistance of operating system. Such a solution exits on Sparc machines, whereby we can dump the whole physical memory by using the OpenBoot firmware. Unfortunately, no similar solution exists for Intel- or AMD-based computers. Despite the above problem, software based methods also have advantages for forensic purposes, and I'll try to show them in this paper. The main goal of this article is a presentation of methods used during an evidence collection procedure. All collected data can be used later to perform offline forensic analysis. Some of presented tasks can be also be performed in the preparation and identification phases of the incident response cycle -- these are two of the six phases defined in a guide called "Incident Handling Step by step", published by the SANS Institute.
We must make additional notes after every finished step as well as if something goes wrong. Documentation is important, and is something to keep in mind if we plan to take our forensic case to court. Our next step is to record the results of commands run during our phase of data gathering. From there, we connect a destination host to the same local area network on which we will be sending information from the compromised host. Remember, we are not allowed to write any results on the compromised system. Recording data locally on the compromised host can delete signs of an intrusion. To make less of an impact on a compromised system we have to send all our digital data to a remote, or destination, host. This is one of the most important rules in the forensic analysis process. And once again, as described earlier this is a requirement that is not always easily to fulfill. If we don't have a forensic toolkit available for install on removable media, now is a good time to prepare it for our compromised system. Using tools from this toolkit we will collect all important data, beginning from the volatile to the less volatile. The following methods describe a method how to prepare our media into a forensic toolkit.
39
Table 1: Requirements for a forensic toolkit on removable media. program 1 2 nc dd source & method of creation http://www.atstake.com/research/tools/network_utilities/nc110.tgz How to build: $tar zxvf nc110.tgz; make linux How to verify: file nc or ldd nc http://www.gnu.org/software/fileutils/fileutils.html (added to core utilities) http://www.gnu.org/software/coreutils/ How to build: $ tar zxvf coreutils-5.0.tar.gz; configure CC="gcc -static", make How to verify: file date cat or ldd date cat http://www.porcupine.org/forensics/tct How to build: $tar zxvf tct-1.14.tgz; make CC="gcc -static" How to verify: file pcat or ldd pcat
datecat
pcat
http://www.phrack.org/phrack/61/p61-0x03_Linenoise.txt To make the module more "independent" we have to delete the following lines from the source code: #ifdef CONFIG_MODVERSIONS #define MODVERSIONS Hunter.o #include <linux/modversions.h> #endif We can load this module to other kernels by removing the MODVERSIONS. How to build: $ gcc -c hunter.c -I/usr/src/linux/include/ insmod http://www.kernel.org/pub/linux/utils/kernel/modutils/for kernel 2.4 How to build: $./configure-enable-insmod_static; make How to verify: file insmod.static or ldd insmod.static
http://freshmeat.net/projects/net-tools/ NetstatAr How to build: $bzip2 -d net-tools-1.60.tar.bz2; tar xvf net-toolsproute 1.60.tar.bz2; make config; make CC="gcc -static" How to verify: file netstat arp route or ldd netstat arp route dmesg http://ftp.cwi.nl/aeb/util-linux/util-linux-2.12.tar.gz How to build: $./configure; make CC="gcc -static" How to verify: file dmesg or ldd dmesg
When we build all above tools successfully, we can copy all of them to our removable media (such as a CD-RW disc).
Table 2: Files accessed by the mount command. File /etc/ld.so.cache /lib/tls/libc.so.6 /etc/fstab /etc/mtab* /dev/cdrom Modified Meta-data by the mount command atime atime atime atime, mtime, ctime atime
/usr/lib/locale/locale-archive atime
/bin/mount atime *We can avoid access to this file by using a "-n" switch. We can imagine a situation when an intruder modifies the mount command. When someone tries to run this command perhaps a special process, which removes all evidence from the compromised system, is initiated instead of allowing the media to be mounted. Such a process is called a "deadman switch". But let's assume this is not the case, and now go back to the process of data collection. I suggest that one verify every command that is going to be put on the forensic toolkit media, which later will be used on the compromised system to collect evidence. We also have to stop and think about potential problems met during the mounting process: After putting the media into a drive, the Volume Manager process will mount the media automatically. Which files and directories will be modified? Are these files listed in the table 1? Suppose an unknown media is currently mounted on a compromised system. Then the first task is to unmount that media. How should we safely unmount it? I can suggest two solutions. We can use the untrusted unmount command or we can put the trusted unmount command (statically linked) on a floppy disc. Next, we use the untrusted mount command to mount the floppy and then run the All Rights Reserved. www.sedulitygroups.com 41
trusted unmount command. It is a little bit complicated but effective. We still use only one untrusted command. An administrator is logged off or even worse an administrator password is changed by an intruder. When the administrator is logged off we have to login into the system. What files will be accessed or modified during the login process? How many additional processes will be created? If the administrator password was changed what are the other accounts on the system? What volatile data can be collected without access to a shell? Open TCP/UDP ports, current connections, what else? Are there other unpredictable problems?
If the mounting process is successful we can start with the most important phase of data collection. Remember, all results generated by trusted commands have to be sent to the remote host. I use the netcat tool and the pipe method to do this. To better differentiate which tasks are performed on which host, all commands run on the compromised host will be prefixed with a (compromised) word in brackets. Commands run on the remote host will be prefixed with a (remote) word in brackets. Consider the following example. To send information about an actual date of the compromised system into the remote location (the IP address of remote host in this case is 192.168.1.100) we have to open TCP port on the remote host as it follows: (Remote host)# nc -l -p 8888 > date_compromised Next, on the compromised host we do the following: (Compromised host)# /mnt/cdrom/date | /mnt/cdrom/nc 192.168.1.100 8888 -w 3 To maintain the integrity of digital evidence we calculate the hash value of the collected file and clearly document every step on our paper copy, to document this procedure. (remote host)# md5sum date_compromised > date_compromised.md5 Sometimes we can generate checksums on the compromised system and send the result to the remote host. A bit more about some of the problems this can cause has been discussed elsewhere in this article.
(compromised host)# /mnt/cdrom/md5sum /etc/fstab | /mnt/cdrom/nc 192.168.1.100 8888 -w 3
Mac address cache table: (remote)# nc -l -p port > arp_compromised (compromised)# /mnt/cdrom/arp -an | /mnt/cdrom/nc (remote) port (remote)# md5sum arp_compromised > arp_compromised.md5 Kernel route cache table: (remote)# nc -l -p port > route_compromised (compromised) # /mnt/cdrom/route -Cn | /mnt/cdrom/nc (remote) port (remote)#md5sum route_compromised > route_compromised.md5
We can use the cat command instead of the netstat one in this case. Information about open ports is kept in the /proc pseudo file system (/proc/net/tcp and /proc/net/udp files). Information about current connections is placed in the /proc/net/netstat file. All data in those files are represented in the hex format. For example: 0100007F:0401 in decimal is 127.0.0.1:1025. As mentioned before, current connections can be detected by analyzing of the recorded traffic. It is important to note: an easy method of detecting a rootkit, loaded into kernel memory, is when one of its tasks is hiding an open port. We have to scan the compromised host remotely and compare the detected open ports with our result from the netstat command. But this causes a lot of harm and we once again change the state of the compromised system, in step seven I will present an alternate method of detecting hidden LKM based rootkits.
6.30.1 Introduction :
FCCU GNU/Linux Forensic Bootable CD is a bootable CD based on KNOPPIX that contains a lot of tools suitable for computer forensic investigatins, including bash scripts.
All Rights Reserved. www.sedulitygroups.com
43
FCCU GNU/Linux Forensic Boot CD's main purpose is to create images of devices prior to analysis, and it is used by the Belgian Federal Computer Crime Unit. Here are some key features of "FCCU GNU/Linux Forensic Boot CD": This CD is based on KNOPPIX by Klauss Knopper. It is a remaster that I made to use at my work as a computer forensic investigator. Its main purpose is to create images copies of devices before analyse. It does not use a lot of CPU cycles for unnecessary programs, which is why it drops you to a shell right after the boot. It recognizes lots of hardware (Thanks to Klauss Knopper). It leaves the target devices unaltered (It does not use the swap partitions found on the devices). It contains a lot of tools with forensic purpose. What's New in This Release? The ability to start in non-graphical mode by passing "live 3" as a boot parameter. An updated version of Guymager (0.3.1). Two Windows tools to copy Win32 memory (including Vista): win32dd and mantech mdd. The memory analysis tool Volatility was added. The registry analysis tool regripper was added. aeskeyfinder and rsakeyfinder were added. A better starting Web page and a better description of the tools on the CD. An updated version (0.40) of the Perl library Parse-win32Registry. Version 3.3.4 of afflib. Many other updates. Forensic acquisition: dd : tool to make bit to bit copies and backups dd_rescue : more or less the same as dd but handles disk errors dd_rhelp : a script to facilitate the use of dd_rescue dcfldd : tool to make bit to bit copies AFFLIB : Advanced Forensic Format tools sdd : a dd clone specialized in tapes AIR : A graphical frontend for dd and dcfldd
45
ripole : A tool to rip attachements from MS files tnef : A tool to decode MS encapsulation format fccu-docprop : a tool to read MS OLE files (mainly doc, xls) properties fccu.evtreader : a tool to parse MS evt log files reglookup : MS windows registry viewer grokevt : An MS win event log viewer with dll message import eindeutig : read and convert dbx files clit : convert MS e-books cookie_cruncher.pl : a tool to parse cookies dumpster_dive.pl : a tool to read m$ recycle bin files mscompress : Decompress files compressed with compress.exe
6.42 Network:_________________________________________
RIP and PXE boot : A complete system for large network keyword search sbd : a netcat like utility with encryption supprot smbc : samba commander p0f : A passive OS fingerprinting tool arping : a ping utility ngrep : grep utility for network packets netwox : a toolbox with more than 200 network tools sshfs : a filesystem client based on ssh lft : a traceroute tool socat : a netcat like tool netdiscover : a tool to discover networks mimms : download mms streams weplab : a wep security analyzer netsed : network srteam altering tool
47
hydra : a network services password guessing tool chatsniff : an instant messenger sniffer msn-capture : a tool to capture msn traffic from the network imsniff : an instant messaging sniffer darkstat : another packet sniffer netwox : a toolbox with more than 200 network tools prismstumbler : a wireless sniffer
dmidecode : a tool to display hardware informations shed : an text based hexa editor hexcat : like cat but with hexadecimal output mbuffer : another pipe measurement tool w3m : a tool to get web pages like curl or wget
49