The “Serial Number Descriptor” string is optional, but a fair number of devices such as thumb drives, removable USB hard drives, PDAs and cell phones have them. This started me thinking: How could this data be used in a security or forensics context? I can think of a few scenarios off the top of my head:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetEnumUSBSTOR
http://www.irongeek.com/i.php?page=security/windows-forensics-registry-and-file-system-spots
Looking at these registry values directly is kind of cumbersome. A nicer way to look at this data is with NirSoft’s freeware tool USBDeview which you can download from:

Ok, now we know where on a Windows box this information is stored, but is there an automated way to find it and search our network for other locations where the same USB device has been used? Some organizations may have an asset tracking database that would be searchable for this information, but many of us don’t have such a system in place. I was thinking of coding up something for the task, but I’m quite lazy. Then I remembered that most of Nir’s tools have the ability to be used from across the network. Sure enough, USBDeview also had this option, all I had to do to connect to a remote Windows box and look though its registry for USB devices was to issue this simple command:
That solves the problem of dumping information from one machine, but what about a whole network? Well, it seems USBDview has an option for taking a list of machines from a text file and grabbing the USB device list from all of them. The syntax is pretty simple:
\192.168.1.13
\192.168.1.14
\skynet
\cthulhu
It takes a bit of time for the results to return, so be patient. Once we get the report, we can sort by the ‘Serial Number’ field, look for repeating serial number by eye, and then scroll over to the ‘Computer Name’ field to see what computers that particular USB device has been used on. For my screen shots I’ve reordered the columns to put the fields I’m most interested in first. The ‘Created Date’ and ‘Last Plug/Unplug Date’ fields are also usefully for figuring out a time line (really handy for finding a malware Patient Zero or Typhoid Mary based on when a user was logged on last). As you can see from the first screen shot, I have two different thumb drives from Patriot Memory that have been plugged into both my Skynet and Cthulhu workstations, but none of the other boxes I scanned:

From the 2nd screen shot you can see that my IronKey and my former roommate’s Android Phone have only ever been plugged into my workstation named Cthulhu:

Now you may be thinking: sorting and looking though the table for matching USB serial numbers by hand may be fine for when you only have four workstations, but what if you have a lot more? Luckily, Nir implemented the ability to save his tool’s output to many different file formats, including CSV (Comma Separated Values). Pretty much any database tool (MS Access for example) can import a CSV file, and from there you are just a few SQL queries away from finding the devices you are seeking. For example, if I wanted to look though the output for just the serial number 07850DA305FC an SQL query similar to this one may help:
FROM Myoutput WHERE Myoutput.[serial] = ‘07850DA305FC’ ;
If you’re interested in just covering your tracks when it comes to USB serial numbers, check out my anti-forensics video:
http://www.irongeek.com/i.php?page=videos/anti-forensics-occult-computing
it’s about three hours and seven minutes long, but covers a lot more than just USB devices. I hope you have enjoyed the article, and feel free to follow me on Twitter @Irongeek_ADC .
USBDeview
http://www.nirsoft.net/utils/usb_devices_view.htmlWhat it takes for Nir’s tools to work from across the network
http://blog.nirsoft.net/2009/10/22/how-to-connect-a-remote-windows-7vistaxp-computer-with-nirsoft-utilities/
Forensically interesting spots in the Windows 7, Vista and XP file system and registry
http://www.irongeek.com/i.php?page=security/windows-forensics-registry-and-file-system-spots
Anti-Forensics video
http://www.irongeek.com/i.php?page=videos/anti-forensics-occult-computing
Добавить комментарий