Tag Archives: forensic examination

A taste of memory forensics

As hacking techniques evolve more and more, hacks are being done without the malicious programs touching the hard drive. All of these processes reside inside the memory of the victim computer. When this happens memory forensics becomes necessary. In this post I’m going to show a few of the volatility modules that can be used to find running processes, unknown network connections, and the DLLs associated with each process that are found inside of computer memory.

First I’m going to make sure I’m in the directory that has my memory images

I navigated to the directory where I have my memory images and I used the ls command to list them.
I navigated to the directory where I have my memory images and I used the ls command to list them.

Once I know I have the right images to analyze I use the volatility framework to analyze the memory files. Volatility is a free open source suite of software that is used for advanced memory forensics. It is supported by the Volatility Foundation. The website for the volatility foundation can be found at: http://www.volatilityfoundation.org/

First I’m going to check for open network connections.

This is the command that is used to see the open network connections at the time the memory image was taken
This is the command that is used to see the open network connections at the time the memory image was taken. The timeliner module is going to be used
I used the grep command to narrow down the results to just network connections that are active or "established".
I used the grep command to narrow down the results to just network connections that are active or “established”.

This is odd because this computer should not have any active network connections at all. So this is the first indication that something is wrong.

Next I dig a little deeper and I use volatility to display a list of all the running processes. The pslist module is used to do this.

The command for viewing the running processes
The command for viewing the running processes
Notice that you see an FTKimager.exe process. This is the imaging software that I used to capture the memory image
Notice that you see an FTKimager.exe process. This is the imaging software that I used to capture the memory image

In windows each executable (.exe) has dynamic link libraries (DLLs) associated with it. These are located inside of the .exe file. Volatility can be used to see each DLL that is inside of an executable. The dlllist module is used for this task.

The command to get the DLLs from the executables.
The command to get the DLLs from the executables.
The dlllidt module lists all of the DLLs associated with the EXEs. The modle also lists the command line syntax that is used to run each executable. The process ID for each EXE is also listed.
The dlllist module lists all of the DLLs associated with the EXEs. The module also lists the command line syntax that is used to run each executable. The process ID for each EXE is also listed.

I found an interest DLL in one of the executables. I decided to Google it to see if it was something odd.

After searching Google for this I found out that this DLL is the Microsoft Visual C Run Time Library. It is a normal process that runs in Windows.
After searching Google for this I found out that this DLL is the Microsoft Visual C Run Time Library. It is a normal process that runs in Windows.

This is a small taste of what memory forensics is. It is a growing field and the more complex hacking attacks get the more rouge processes may be located in memory. Thanks for reading!

A mock case of IP theft

Greetings everyone. This post is going to be a mock digital forensics case and how I would go about answering the questions about an event that takes place on a computer system. First I’ll give you the case details:

XYZ corp has contacted me about an attempted cyber theft of sensitive company information. They believe that an administrator who works for the company is involved in the theft. They confiscated a personal USB drive that belonged to the employee in question. They believe this USB was used to steal the sensitive information. My job will be to confirm that the information is on the USB drive and that the USB was plugged into the work computer that contains the company’s information. I was told that the sensitive files are on his work computer and they have the words “secret” and “confidential” in their file names.

There are several questions I need to answer about the case:

  • Is the stolen data on the USB drive?
  • When was the data stolen?
  • When was the last time the USB drive was plugged into the computer?
  • What user account was logged into the computer at the time the data was stolen?

So the first step that I would take would be to take images of both the computer and the USB drive.

I used dd to take the image of the USB drive.
I used dd to take the image of the USB drive

Next I took a live image of the xyz computer.

I changed the power settings for both the machine being imaged and the forensic machine performing the imaging. I didn't either machine to go to sleep which the imaging was taking place.
I changed the power settings for both the machine being imaged and the forensic machine performing the imaging. I didn’t want either machine to go to sleep while the imaging was taking place.
Here is the settings I used for taking the image of the xyz computer. I didn't want to deal with a bunch of fragmented image files so I set the fragment size to zero.
Here is the settings I used for taking the image of the xyz computer. I didn’t want to deal with a bunch of fragmented image files so I set the fragment size to zero.
When the imaging finished FTK Imager automatically started to hash the image file and verify the hashes.
When the imaging finished FTK Imager automatically started to hash the image file and verify the hashes.
Both the MD5 and SHA-1 hashes verified. Now Im ready to prep both pieces of evidence for examination.
Both the MD5 and SHA-1 hashes verified. Now I’m ready to prep both pieces of evidence for examination.

The images I took above are the “best” evidence. A best practice is to never examine the original or “best” evidence. So in order to get the image files over to my forensic system I have two choices:

  • Copy the image files over using a normal copy method like drag and drop
  • Take an image of the best evidence and use that image as the “working” evidence or the evidence to be examined

I chose option two because with taking an image I’ll know for sure that the copies will be exactly the same bit for bit. With the drag and drop copy I won’t be sure if the operating system will make changes to the evidence.

Imaging working copy of xyz corp computer
So I took my forensic hard drive that contained the original evidence and mounted it to my forensic system. Then I rehashed the xyz computer image and took an image of the best evidence using the dcfldd tool.
Next I took a second image of the USB drive
Next I took a second image of the USB drive to use as the “working” evidence”
After both working copies were made I hashed both of them and compared them to the original evidence.
After both working copies were made I hashed both of them and compared them to the original evidence.

With both working copies made and the hashes checking out I move on to the examination of both pieces of evidence. The first question I want to answer is if the stolen data is on the USB drive. I have two ways of confirming this:

  • Mount the drive to the forensic system and see if the data is on the drive
  • Use the Autopsy forensic browser and run a keyword search

I decided to use Autopsy to run a Keyword search. Because I know that either the words “Confidential” or “Secret” is in the file names. I ran a search for both of these keywords.

Keyword search using Autopsy
Searching the USB for the word “confidential” on the USB drive
Search results for the keyword "Confidential"
Search results for the keyword “Confidential” on the USB drive
Searching for the keyword "secret"
Search results of Autopsy looking for the keyword “Secret” on the USB drive

So far these search results tell me that four hits were found for “confidential” and 3 hits were found for “secret”. This is a good indication that the stolen files are on the USB drive.

I did not want to base the answer to the question on the keyword search results alone so I used Autopsy to perform file analysis on the USB drive’s contents. This option will give me a list of what files are on the drive, if they are deleted or not, the file’s timestamps, and which metadata entry points to the file.

All of the stolen files are found. This answers the first question of the case.
All of the stolen files are found.

With this the first question of the case is answered. The stolen files are on the USB drive. There is something odd with the timestamps however. The time values in the yellow box are the written timestamps and the time values in the red box and the created timestamps. Under normal circumstances the creation time would be before the written time. But this clearly says the the last written time is before the created time. This is a clear indication that the files that were stolen were created on a different machine and moved to the USB drive. So the created time values are the times when the file’s were created on the USB drive. So each file’s creation time is when the file was stolen. This answers the second question.

  • Confidential file # 1
    • Stolen on 11/30/2014 at 13:06:11 EST
  • Secret File 1
    • Stolen on 11/30/2014 at 12:41:43 EST
  • Secret File 2
    • Stolen on 11/30/2014 at 12:41:43 EST
  • Secret File 3
    • Stolen on 11/30/2014 at 12:41:43 EST

Now that I have some time values I can check the computer image and see who was logged in at the time the files were stolen. Also I will check when the USB drive was plugged into the computer. I mounted the computer image file to my forensics system and ran a program that extracts data from the Windows registry. The program is called regripper. The registry is a series of database files that contain configuration information for the operating system. With Windows the registry is split into five hives:

  • Sam
  • Security
  • System
  • Software
  • NTUSER.DAT

Each user account on a computer has an NTUSER.DAT registry hive that is associated with it. The hives that contain the information I need to learn about the USB drive are located in the Software, System, and NTUSER.DAT hives. I first decided to rip the information from the System hive.

I used the losetup command along with the mount command for mounting the image file.
I used the mmls, losetup command, and  the mount command to mount the image file.
I used regripper to rip the information from the system hive. From this information I found the last time the USB was plugged into the computer
I used regripper to rip the information from the system hive. From this information I found the last time the USB was plugged into the computer

So this answers the third question: The USB was last plugged into the computer on Dec 2, 2014 at 01:09:07 UTC. Registry times are in UTC time or Zulu time. Since this computer was located on the east coast the time (which is 5 hours behind zulu time) is Dec 1 2014 at 22:09:07 EST. This is the last time the USB drive was plugged into the computer. Next I ripped the Software and the NTUSER.DAT registry hives for more information about the USB drive itself. I was able to find out several things about the USB drive from these hives:

  • Serial number
  • USB Vendor
  • Vendor ID
  • Product ID
  • Last drive letter the USB drive was assigned
  • Volume GUID (Globally unique identifier)
  • The user account which was logged in when the USB was plugged in

Once I found out the volume GUID I used this information to find out which user account was logged on when the USB was plugged in.

Once I ripped the NTUSER.DAT hive I searched for the volume GUID. Since the GUID is found it confirms that the account associated with this NTUSER.DAT hive was logged in when the USB was plugged in.
Once I ripped the NTUSER.DAT hive I searched for the volume GUID. Since the GUID is found it confirms that the account associated with this NTUSER.DAT hive was logged in when the USB was plugged in.

Now the final question is answered. This NTUSER.DAT hive belongs to the Admin account on the computer in question, so the Admin account was logged in when the USB drive was plugged in.

After the examination I would report to my mock client that I found evidence that the Admin account was logged in when the USB drive in question was plugged into the computer. Also that the sensitive company information was found on the USB drive. There was no need to find out if his account was compromised due to the fact that the suspect was seen plugging in his personal USB drive into the computer at the time of the theft. So with this evidence xyz corp woud make a decision based on the facts.

In the world of information security any number of cyber crimes can be committed against a person or an organization. This is one example of what can happen to a company. With that said always be careful with what you put on the internet. Thanks for reading!

Acquisition: Storing the evidence and imaging tools

In the previous post I discussed some of the first steps in the acquisition process. Finding the physical or digital evidence at the crime scene, starting the chain of custody, recording when change of control takes place on the chain of custody document, image hashing, and making the copy of the original or best evidence to use for forensic examination. The only task left in the acquisition process is storing the original evidence. In this post I’ll also introduce some acquisition tools and describe some of their features.

Depending on whether or not the best evidence in a case is digital or physical the best practices for storing that evidence will change how the original evidence should be stored. If a physical hard drive is the original evidence then the usual storing method is to place the hard drive on a shelf in a climate controlled room. There are several problems with this method. Original evidence can sit in storage for years before it is called upon for a case. This can lead to the hard drive breaking down while it is in storage. If this happens then the evidence will be changed and the case will most likely be thrown out. With physical hard drives there is not much that can be done to fix this. However with digital evidence measures can be taken that can safeguard it from these problems. The best thing to do with digital evidence is to upload it to a managed RAID system that has regular backups done. (RAID stands for redundant array of independent disks. This type of system is designed to be a more robust type of data storage.) Another method is to have offsite backups of the evidence done. The main copy can be in a computer system at the police station and the backup can be at a separate location for example. If disaster strikes the main location and the main storage system is damaged or destroyed the backup can be used.

There are multiple disk imaging tools to choose from, some use the command line and others use the GUI (Graphical user interface). Let’s start with one of the oldest tools still in use: dd.

dd is a command line tool that is used to capture forensic images from hard drives, USB drives, and other forms of media. dd stands for data description; others may believe that dd stands for data dump. I’ve heard both terms being used so I interchange them; they both refer to the same tool. Dd is built into the Unix operating system, is part of the GNU Corutils package, and has many features:

  • Forensic image creation
  • Drive wiping
  • Data copying

Dcfldd is an upgraded version of the dd program that was created by the US Department of Defense Computer Forensics Lab. Dcfldd has many more features than its dd counterpart:

  • Hashing of the data on the fly
    • Meaning that while the imaging is in progress the program is creating a hash
  • Displays progress of the imaging process
  • Imaging bit for bit verification
  • MD5 and SHA-256 hashing of data

FTK Imager is a GUI based tool made by Access Data. FTK Imager can be run from a forensic system or from a USB drive. This tool has a plethora of features:

  • Forensic image creation
  • Memory image creation
  • Local file system mounting
    • This feature will allow the examiner to take a peek at what’s inside the hard drive and determine if further examination is needed
  • Image mounting
  • Deleted file recovery
  • Hashing of the imaged media
  • File and folder exporting from forensic images

These are three great tools that can be used to acquire forensic images in the field. In my next post I’ll show how to use each of these tools. Thanks for reading.