Showing posts with label DFIR. Show all posts
Showing posts with label DFIR. Show all posts

Monday, July 2, 2012

DFIR SUMMIT 2012: A Look Back


     Last week was the SANS Digital Forensics and Incident Response Summit in Austin, Texas.  I have to say the summit was probably my favorite conference experience I have had thus far.  It was a great mix of networking and content.  Your days are filled with spectacular information and you are still provided with a lot of opportunity to meet new people and discuss.  Plus, if you're active in the #DFIR twitter space, then it was an excellent opportunity to actually meet many of the people who use it.  I would highly suggest that, if you the ability to attend the summit.  I hope to be back in the coming years.

     As I mentioned, days at the summit are filled with a lot of great content from the speakers at the conference.  I have to say my favorite presentation, personally, was When Macs Get Hacked from Sarah Edwards.  This was simply because it was something I have yet to really see or research and provided a great baseline of knowledge where to look for information and various tools to utilize.  This presentation went very well with Andrew Cases's talk on Mac Memory Analysis with Volatility.

     Nick Harbour gave an EXCELLENT talk on Anti-Incident Response, that I really enjoyed a lot.  His talk was pretty technical and provided a lot of insight into the mind of an attacker.  Jeff Hamm's presentation on Carve for Records Not Files provided a lot of good information that should be considered in an investigation.  Event records very well may be much easier to carve for than an entire event log file.  Where a file is likely to miss all the information, carving for a fragment of that information is a lot simpler and may be just as useful.

     Cindy Murphy, this years Forensic 4Cast Examiner of the Year,  gave an amazing keynote to open the summit.  I thought it was very interesting and insightful.  If nothing else, I think a lot of people left the talk inspired and proud to be a part of this community.  Mike Viscuso's ending talk on Security Cameras - The Corporate DFIR Tool of the Future was also very interesting and, at least personally, gave a lot to think about the future of investigations and what that brings with big data.

     This is just a small sample of what the Summit offered, after all there were two tracks going the whole time (I couldn't make it to everything).  The presentations are posted already on SANS website here:  http://computer-forensics.sans.org/community/summits.  I highly recommend that you go through and take a look for yourself.  I really enjoyed the Summit, meeting everyone was awesome and it was nice to be around people that share the same passion (it's reinvigorating).

Thursday, March 1, 2012

File Tags and Digital Forensics


                So I was bored one day and decided that with school and work, I just wasn’t busy enough and I needed a new project.  I wanted to do some research, preferably in the realm of digital forensics.  I started talking to my buddy Rob Marmo (@robmarmo) and the idea of looking how Windows utilizes the tag properties within certain files came up.  Eventually, after some thought and consideration we decided that it would make for an extremely fun project that would make for a great booster for our experience.  As it ends up it was a great learning experience in doing research and developing a way to utilize the information.


Background

                If you are not familiar, Windows introduced the ability to “tag” files in Windows Vista.  This feature allows the user to add a desired keyword to certain file types so they could easily be categorized and searched within the Search function they included within Vista as well.  Here is an example of how you can tag your files:


Your other option for tagging your file is via the file properties option for the file.  If the file format supports tagging you will see the option available within the “Details” tab, like so: 


These file tags are a great way to organize information in a user customized way.  To me, that is why file tags are quite interesting from a forensic point of view, as these tags are inputted manually via the user’s input.  So it’s quite possible to say that if a file is tagged with a certain keyword it may provide that file with an added value of interest to an investigation.


How It Works

                After a lot of looking and failed avenues, I was finally able to get a handle on how Windows implements the ability to File Tag.  First, you may have noticed that I said only certain file types can be tagged.  I don’t deliberately state the files that are tagged because it is a variable.  When you begin the tagging process, simply put, the tags are inserted into an XML that is then inserted into the file.  How this is handled varies on the file type.  This determination is handled by reading the registry.  If you look at HKEY_CLASSES_ROOT\SystemFileAssociations in the registry, you will find a list of various file types registered within the operating system.  Each file type has two keys of interest for our purposes the “FullDetails” and the “PreviewDetails”.  Within these keys are several values, and the one for file tags is “System.Keywords”.  This value says there is a way for Windows to store the tags within the file.  The actual injection of the XML is done via a property handler that is based on the file type, often done via a DLL. 
            There is another part the file tagging system, beyond simply adding the keywords to a file.  As you recall, I mention that this implementation was intended to allow for quick searching of files by these keywords via the Windows Search function.  This plays an interesting point with the file tagging system.  As you enter in these keywords this creates an interaction with the Windows Search Index.  I created a quick animation GIF to show how the Search Index works as I understand it:

As you can see, the search index works with a data store.  Those data stores work with the Search function and filters, as well as a notification system.  If certain parameters are met they are then gathered and sent to the System Index, which is actually a database locally stored on the system at: 

C:\ProgramData\Microsoft\Search\Data\Application\Windows\Windows.edb *
*It should be noted that this  location can be altered via the Index Options in the Advanced options.

This is a interesting database and seems to be proprietary to the Microsoft Operating System and is utilized by a few of their applications.  If you’re interested in taking a look at the database, I was able to by doing the following:
  • Turn off Windows Search Service (This essentially unlocks the DB so you can use it)
  • Navigate to the Index location
  • Make a copy of the index EDB file
  • You can turn back on Windows Search Service
  • Download and install an EDB Viewer (I suggest EseDB Viewer from Woanware)
  • Open your copied EDB file in the viewer

Viewing the Search Index provides an interesting look at all the information that your Windows systems can analyze in a short amount of time.  As best as I can tell the Search Index database is utilized by the tagging system for the preview generation.  While you’re inputting a tag, often time you will find that upon entry once you type in a letter you will be given option of tags.  These are tags that have previously been applied to files, and from what I can tell these are pulled from the Search Index database.  The “PreviewDetail” key discussed earlier is how the registry knows you can get these tags via preview and then the property handler works with the index. 


Interest in Recovery

                Again, each file type handles tag in a different way; it is dependent upon the property handler assigned to it.  How these handlers deal with the data and inject it into the files is different, and through my testing of various files types and how they dealt with the file tags I came across an interesting discovery.  Some of file types store tag data not only within the file XML but also in various parts throughout the file.  In testing I was able to see when tags were added or modified, and even if the file tags have been deleted (or not viewable by the OS as Windows will only read tags from the XML), they are still located within the file and viewable within the hex.  Now, this only occurs in certain file types with, dare I say, inefficient property handlers.  Looking at the new Office formats like .docx it handles XML with a higher proficiency it writes most all its properties to XML and then archives it and then is read via Word or whatever.  To me that makes for much more efficient way to deal with files.  However, when we look at something like a .jpeg, it writes the tags to the file in different locations based upon the interaction.  Forensically, this provides an investigator with an added way to look at a file.  My thought was if you have a file that has a MAC timestamp of all the same times exactly, but you see that within the file that it has indications that tags were added or modified it may indicate that the file timestamps may have been altered.


Future

                I am still in the research phase with this information, but this is everything I have gathered thus far.  I have developed a proof of concept application that is working and pulling files that have been tagged and readable by the OS.  It’s still in development, and I plan and getting it out to the community eventually once I have it optimized and have added all the features I wish to include.  Also, you may be wondering how I came to acquire this information, so I am planning on posting a research and implementation article as well that will describe the research I did in a fair amount of detail with pertinent examples and such.  It may also include how I learned to program the tool I am developing as well.  I think explaining the thought process behind research and development may be beneficial to the community and hopefully inspire others to do the same by providing some background and basic thought process.


Hope you enjoyed this, and if you have any thoughts on the implications of file tags and how they can be utilized in an investigation I would love to hear them.  Leave a comment or e-mail me at:  michael.ahrendt@gmail.com