Cryptographic key recovery from Linux memory dumps

cryptoforensics_20070804.jpg

I stumbled across this paper from the 2007 Chaos Communication Camp which describes a method for extracting the cryptographic keys used by either dm-crypt or cryptoloop.

Technically, the cryptographic keys need to reside in memory while your encrypted disk is in use, so, obviously, if an attacker has access to your physical RAM, they will be able to obtain these keys and decrypt the volume at any future point in time. There were a couple of less-than-obvious takeaways, however.

The first is that there are a multitude of avenues for accessing a machine's memory. Anyone able to obtain root access could access /dev/mem remotely, but many systems (especially laptops) will actually write the memory's contents to disk during extended hibernation. Virtualization software, such as VMWare, will do exactly the same when the virtual machine is suspended. Finally (and this was news to me), the Firewire standard provides devices DMA access. You could imagine a device specifically designed for the purpose of connecting to a running machine. It would copy the machine's ram to a small hard disk, a "finished" LED would light up, and the attacker would pocket it and exit the building. The operating system wouldn't even know that anything had happened.

The second big takeaway is that it's relatively simple to search for these keys in a full memory dump. The method is slightly different for dm-crypt than it is for cryptoloop, but it basically involves a pattern search for certain characteristics in the C data scructure that holds the key. There are a couple of scripts included in the appendix for those of you who'd like to try this out.

If you use disk encryption on a laptop to protect your data from theft while you are traveling, take note. Disable hibernation mode to prevent RAM from being written to disk and do not leave your machine running while unattended, even if logged out.

Cryptographic key recovery from Linux memory dumps - Link (pdf)


Recent Entries

Comments

Oldest comments listed first.

Posted by: Crash on December 11, 2007 at 9:31 AM

very very scary stuff. would the firewire memory-copy device also be possible over USB? maybe disabling firewire unless needed would be a good idea.

would the firewire memory-copy device also be feasible in windows?


Posted by: Set the OF Password on January 30, 2008 at 1:29 AM

You can protect the Firewire-Port when you set the OpenFirmware PWD on the Mac. Although it now uses EFI, the OF-PWD is still the name of the item.
Here is the official Apple-Link:
http://docs.info.apple.com/article.html?artnum=106482


Leave a comment


Subscribe to MAKE!Subscribe to MAKE Magazine!

Subscribe today, save 42% and get web access to MAKE free. MAKE Digital Edition is available only to subscribers.

$34.95 / 1 year
(4 Quarterly Issues)

Subscribe now


Void your warranty, violate a user agreement, fry a circuit, blow a fuse, poke an eye out. Make: The risk-takers, the doers, the makers of things... Welcome to Make: Online!


CRAFT Maker Shed Maker Faire MAKE television
MAKE: en EspaƱol MAKE: Japan


Check out all of the episodes of Make: television

Make: Science Room

Connect with MAKE

Be a MAKE fan on Facebook MAKE on Facebook
Visit our Facebook page and become a fan of MAKE!
MAKE on Twitter MAKE on Twitter
Follow our MAKE tweets!
MAKE Flickr Pool MAKE on Flickr
Join our MAKE Flickr Pool!
    make_tips on Twitter

    MAKE's RSS feed is here.
    Add MAKE to iGoogle - GoogleGoogle.
    How to add MAKE to your RSS reader - Real simple.
    Add MAKE on FriendFeed




    Maker SHED

    Advertise here with FM.

    Why advertise on MAKE?
    Read what folks are saying about us!

    Click here to advertise on MAKE!



    Subscribe to MAKE Magazine!

    Make: Online authors!

    Gareth BranwynGareth Branwyn
    Senior Editor


    Phillip TorronePhillip Torrone
    Senior Editor
    | AIM | Twitter


    Becky SternBecky Stern
    Associate Editor
    | AIM | Twitter


    Marc de VinckMarc de Vinck
    Contributing Writer
    | AIM | Twitter


    John ParkJohn Park
    Contributing Writer
    | Twitter


    Sean RaganSean Ragan
    Contributing Writer
    | Twitter


    Matt MetsMatt Mets
    Contributing Writer
    | AIM | Twitter


    Dale DoughertyDale Dougherty
    Editor & Publisher
    | Twitter


    Shawn ConnallyShawn Connally
    Managing Editor
    | Twitter


    Goli MohammadiGoli Mohammadi
    Associate Managing Editor

    Kip KayKip Kay
    Weekend Projects
    | AIM | Twitter


    Collin CunninghamCollin Cunningham
    Contributing Writer
    | AIM | Twitter

    Adam FlahertyAdam Flaherty
    Contributing Writer
    | AIM | Twitter



    More contributors: Mark Frauenfelder (Editor-in-Chief, MAKE magazine), Kipp Bradford (Technical Consultant/Writer), Chris Connors (Education), Diana Eng (Guest Author), Peter Horvath (Intern), Brian Jepson (O'Reilly Media), Robert Bruce Thompson (Science Room)

    Suggest a Site!

    Current Podcast

    itunesdl.gif Weekend Project: Making Char Cloth Learn how to make a cheap and effective fire starter made from an old t-shirt. To download The Char Cloth video click here and subscribe in iTunes. See Char Cloth in action with the Fire Piston from William Gurstelle.... More...

    Get the Make: Online sent via email
    Enter your email to receive Make: Online each day:



    MAKE Fascination video series brought to you by Dow

    Make: Education

    Important please read


    Subscribe to MAKE Magazine!

    Recent Posts from the Craft: Blog