<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;A0UDSXc7fyp7ImA9WhRVFUw.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904</id><updated>2012-01-14T00:34:38.907-05:00</updated><category term="mobile" /><category term="syskey" /><category term="Xen" /><category term="Andreas Schuster" /><category term="registry" /><category term="malware" /><category term="msr" /><category term="win32k" /><category term="attribution" /><category term="Georgia Tech" /><category term="updates" /><category term="baltimore" /><category term="presentation" /><category term="pyflag" /><category term="GTISC" /><category term="encryption" /><category term="module" /><category term="summer" /><category term="message" /><category term="object model" /><category term="video" /><category term="VAD" /><category term="vmi" /><category term="webjob" /><category term="regripper" /><category term="rootkits" /><category term="2008" /><category term="system" /><category term="threads" /><category term="sam" /><category term="sample data" /><category term="security" /><category term="SANS" /><category term="volrip" /><category term="construct" /><category term="globals" /><category term="memory" /><category term="collective" /><category term="undocumented" /><category term="forensics" /><category term="system calls" /><category term="oracle" /><category term="CM_BIG_DATA" /><category term="haiku" /><category term="introspection" /><category term="scanning" /><category term="reference" /><category term="SID" /><category term="worm" /><category term="Volatility" /><category term="KdVersionBlock" /><category term="release" /><category term="plugins" /><category term="ftimes" /><category term="tpi" /><category term="file formats" /><category term="moving" /><category term="virtualization" /><category term="PIL" /><category term="KdDebuggerDataBlock" /><category term="slides" /><category term="obfuscation" /><category term="CCS2009" /><category term="debugging" /><category term="cache" /><category term="FUD" /><category term="DKOM" /><category term="handles" /><category term="signature" /><category term="perl" /><category term="oakland" /><category term="reverse engineering" /><category term="dump" /><category term="rebuttal" /><category term="GDI" /><category term="PE" /><category term="ssdt" /><category term="assembly" /><category term="types" /><category term="executable" /><category term="volshell" /><category term="win7" /><category term="python" /><category term="carving" /><category term="virtuoso" /><category term="domain" /><category term="windows" /><category term="distorm" /><category term="hive" /><category term="record and replay" /><category term="screenshots" /><category term="paper" /><category term="volreg" /><category term="driver" /><category term="key" /><category term="research" /><category term="process" /><category term="programming" /><category term="tutorial" /><category term="symantec" /><category term="LSA" /><category term="encase" /><category term="ieee security and privacy" /><category term="databases" /><category term="dfrws" /><category term="pdb" /><category term="hooking" /><category term="minidump" /><category term="kernel" /><category term="memory analysis" /><category term="guidance" /><category term="microsoft" /><category term="xmagic" /><category term="pygame" /><category term="token" /><category term="virtual address descriptors" /><title>Push the Red Button</title><subtitle type="html">Malware, encryption, reverse engineering, networking, and other arcana.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/PushTheRedButton" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="pushtheredbutton" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CkMNSHk7cSp7ImA9WhdWE04.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-8538214687255962076</id><published>2011-09-06T12:34:00.000-05:00</published><updated>2011-09-06T12:34:59.709-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T12:34:59.709-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="msr" /><category scheme="http://www.blogger.com/atom/ns#" term="mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="collective" /><category scheme="http://www.blogger.com/atom/ns#" term="research" /><category scheme="http://www.blogger.com/atom/ns#" term="summer" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="microsoft" /><category scheme="http://www.blogger.com/atom/ns#" term="record and replay" /><title>What I Did on My Summer Vacation</title><content type="html">Over the summer I worked at &lt;a href="http://research.microsoft.com/en-us/"&gt;Microsoft Research&lt;/a&gt;, which has a fantastically smart bunch of people working on really cool and interesting problems. I just noticed that they've posted the video of my end-of-internship talk,&amp;nbsp;&lt;a href="http://research.microsoft.com/apps/video/default.aspx?id=152832"&gt;Monitoring Untrusted Modern Applications with Collective Record and Replay&lt;/a&gt;. Please take a look if you're curious about what it might look like to try and monitor mobile apps in the wild with low overhead!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-8538214687255962076?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/8538214687255962076/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=8538214687255962076" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8538214687255962076?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8538214687255962076?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2011/09/what-i-did-on-my-summer-vacation.html" title="What I Did on My Summer Vacation" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;A0cAQnw9fCp7ImA9WhZVFUs.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-142789157071845711</id><published>2011-05-28T02:34:00.004-05:00</published><updated>2011-05-28T02:50:43.264-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-28T02:50:43.264-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="virtuoso" /><category scheme="http://www.blogger.com/atom/ns#" term="slides" /><category scheme="http://www.blogger.com/atom/ns#" term="virtualization" /><category scheme="http://www.blogger.com/atom/ns#" term="paper" /><category scheme="http://www.blogger.com/atom/ns#" term="oakland" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="introspection" /><category scheme="http://www.blogger.com/atom/ns#" term="ieee security and privacy" /><title>Paper and Slides Available for "Virtuoso: Narrowing the Semantic Gap in Virtual Machine Introspection"</title><content type="html">I've recently returned from Oakland, CA, where the &lt;a href="http://www.ieee-security.org/TC/SP2011/"&gt;2&lt;sup&gt;5&lt;/sup&gt; IEEE Symposium on Security and Privacy&lt;/a&gt; was held. There were a lot of excellent talks, and it was great to catch up with others in the security community. Now that the conference is over, I'm happy to release the paper and slides of our work, "Virtuoso: Narrowing the Semantic Gap in Virtual Machine Introspection", which I have described in an &lt;a href="http://moyix.blogspot.com/2011/03/automatically-generating-memory.html"&gt;earlier post&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The slides contain some animations, and so I've made them available in three formats:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.cc.gatech.edu/~brendan/Virtuoso_Oakland.key"&gt;Keynote (iWork 2009)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cc.gatech.edu/~brendan/Virtuoso_Oakland.pdf"&gt;PDF&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cc.gatech.edu/~brendan/Virtuoso_Oakland_notes.pdf"&gt;PDF with notes&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;You can also get a copy of the &lt;a href="http://www.cc.gatech.edu/~brendan/virtuoso.pdf"&gt;full paper here&lt;/a&gt;. I'm also hoping to have the source ready for release soon; when it is available, you'll be able to find it on &lt;a href="http://code.google.com/p/virtuoso/"&gt;Google Code under the name Virtuoso&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once again, thanks to my most excellent co-authors at MIT Lincoln Labs and Georgia Tech for helping me see this project through!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-142789157071845711?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/142789157071845711/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=142789157071845711" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/142789157071845711?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/142789157071845711?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2011/05/paper-and-slides-available-for-virtuoso.html" title="Paper and Slides Available for &quot;Virtuoso: Narrowing the Semantic Gap in Virtual Machine Introspection&quot;" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DEcGRX4zeip7ImA9WhZREU8.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-8599412344008071888</id><published>2011-04-06T16:36:00.002-05:00</published><updated>2011-04-06T16:40:24.082-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-06T16:40:24.082-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="Georgia Tech" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="vmi" /><category scheme="http://www.blogger.com/atom/ns#" term="paper" /><title>Applying Forensic Tools to Virtual Machine Introspection</title><content type="html">I've just released a technical report summarizing some work I did a couple years ago that explores how forensic memory analysis and virtual machine introspection are closely linked.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Abstract&lt;/b&gt;: Virtual machine introspection (VMI) has formed the basis of a number of novel approaches to security in recent years. Although the isolation provided by a virtualized environment provides improved security, software that makes use of VMI must overcome the semantic gap, reconstructing high-level state information from low-level data sources such as physical memory. The digital forensics community has likewise grappled with semantic gap problems in the field of forensic memory analysis (FMA), which seeks to extract forensically relevant information from dumps of physical memory. In this paper, we will show that work done by the forensic community is directly applicable to the VMI problem, and that by providing an interface between the two worlds, the difficulty of developing new virtualization security solutions can be significantly reduced.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can read the full paper on &lt;a href="http://smartech.gatech.edu/handle/1853/38424"&gt;SMARTech&lt;/a&gt;. Hopefully this will encourage others to start using great memory analysis tools like Volatility for live analysis of virtual machines!&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-8599412344008071888?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/8599412344008071888/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=8599412344008071888" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8599412344008071888?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8599412344008071888?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2011/04/applying-forensic-tools-to-virtual.html" title="Applying Forensic Tools to Virtual Machine Introspection" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total></entry><entry gd:etag="W/&quot;C04GQX0zfSp7ImA9WhZTE00.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-2593358968866503942</id><published>2011-03-15T15:36:00.008-05:00</published><updated>2011-03-16T13:58:40.385-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-16T13:58:40.385-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="virtuoso" /><category scheme="http://www.blogger.com/atom/ns#" term="vmi" /><category scheme="http://www.blogger.com/atom/ns#" term="haiku" /><category scheme="http://www.blogger.com/atom/ns#" term="virtualization" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="oakland" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="ieee security and privacy" /><title>Automatically Generating Memory Forensic Tools</title><content type="html">&lt;div style="text-align: left;"&gt;Now that the IEEE Symposium on Security and Privacy program has &lt;a href="http://www.ieee-security.org/TC/SP2011/program.html"&gt;finally been posted&lt;/a&gt;, I can describe some research I've been working on for the past year and a half related to virtual machine introspection (VMI) and memory forensics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A well-known problem with VMI and memory forensics is the &lt;i&gt;semantic gap&lt;/i&gt; -- basically, the kind of information you want out of a memory image or a running VM is high level information (what processes are running, what files are open, and so on) but what you get is a big bunch of uninterpreted bytes (i.e., a view of physical memory). Bridging this gap is what tools like &lt;a href="http://code.google.com/p/volatility/"&gt;Volatility&lt;/a&gt; were built to do, and they do it well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, building a tool like Volatility takes a lot of work and a lot of knowledge about the internals of the operating system you're trying to examine. With operating systems like Windows, which are closed source, this kind of knowledge comes from things like the &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb963901"&gt;Windows Internals&lt;/a&gt; book, blog posts, and good old fashioned reverse engineering. This takes a lot of time, and the process has to be repeated every time there's a new version of Windows or a new operating system you want to support. Volatility's next release will support Vista and Windows 7, but it hasn't been easy – the networking code, for example, was rewritten for Vista, which required some reverse engineering by &lt;a href="http://mnin.blogspot.com/"&gt;MHL&lt;/a&gt; and a &lt;a href="http://code.google.com/p/volatility/source/browse/branches/Volatility-1.4_rc1/volatility/plugins/netscan.py"&gt;new plugin&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Is there an easier way? What we want, in an ideal world, is some way that we can generate some of these tools automatically, for any OS or version. That's the problem that we set out to solve, and it's one that I think we made some good progress on -- though as with any academic work, there's still lots of room for improvement :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The basic idea is that many of the tools we want to run on a memory image could be easily coded if we had access to the native APIs on the system – for example, we could easily write something similar to &lt;b&gt;pslist&lt;/b&gt; if we had access to the Windows API by doing something like:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;center&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/pslist.png" /&gt;&lt;/center&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Our system, which we call Virtuoso, takes advantage of this fact. We take small programs like the one shown above and run them inside a virtual machine that logs every instruction they execute, both in user-mode and in the kernel. From these logs, we can then &lt;i&gt;automatically&lt;/i&gt; generate Volatility plugins that do the same thing. Of course, I'm omitting a lot of technical detail here – there's a lot of work that needs to be done to clean up the logs, cut out irrelevant parts of the computation, and reconstitute the logs back into something that resembles a program – but that's the core idea.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In our paper, we show off our technique by automatically generating 6 different programs on Linux, Windows, and &lt;a href="http://haiku-os.org/"&gt;Haiku&lt;/a&gt;. These programs do things like list the PIDs of currently running processes, enumerate loaded kernel modules, and retrieve the executable name for a given PID, and didn't require any special knowledge to create: we just looked up the &lt;a href="http://www.haiku-os.org/legacy-docs/bebook/TheKernelKit_ThreadsAndTeams.html#get_next_team_info"&gt;API functions&lt;/a&gt; that did what we wanted and wrote small programs like the one shown above, then let Virtuoso do the hard work of creating a Volatility plugin.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In future posts, I'll go deeper into the technical methods used to achieve this. I'll also post the paper itself once the conference happens (after all, I have to give people some reason to come and see the talk ;) ). And finally, I'm hoping to release the code itself, once I get approval from the people that funded the research. For now, I'm going to employ a tactic known as "proof by screenshot", showing the steps involved in creating a plugin to list the PIDs of running proceses under Haiku. (Click any of the screenshots to see a larger version.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First we write a program that uses the Haiku API to get a list of running processes. We annotate the program with some markers that tell our logging engine where to start and stop the trace, and what the inputs and outputs are (the calls to &lt;span class="Apple-style-span"&gt;vm_mark_buf_{in,out}&lt;/span&gt;):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;center&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikups.png" /&gt;&lt;/center&gt;&lt;div&gt;We now compile and run that program inside a virtual machine running Haiku, and log what computation it does:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;center&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikutrain.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikutrain_thumb.png" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Next, we run our analyzer on it, which does its magic and produces a plugin for Volatility:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;center&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikuanalysis.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikuanalysis_thumb.png" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Finally, we can run that plugin within Volatility to analyze a Haiku memory image:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;center&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikuvol.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/blog_images/haikuvol_thumb.png" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To wrap things, up, I want to thank my co-authors Tim Leek, Michael Zhivich, Jonathon Giffin, and Wenke Lee. It's been a long road, but I'm hoping this research will make it a lot easier to build exciting new security tools for VMI and memory forensics! &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-2593358968866503942?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/2593358968866503942/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=2593358968866503942" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/2593358968866503942?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/2593358968866503942?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2011/03/automatically-generating-memory.html" title="Automatically Generating Memory Forensic Tools" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total></entry><entry gd:etag="W/&quot;CkYGRX0zfyp7ImA9WxFaEkk.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-1234576523199683755</id><published>2010-07-15T18:30:00.006-05:00</published><updated>2010-07-15T19:28:44.387-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-15T19:28:44.387-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="win32k" /><category scheme="http://www.blogger.com/atom/ns#" term="video" /><category scheme="http://www.blogger.com/atom/ns#" term="PIL" /><category scheme="http://www.blogger.com/atom/ns#" term="pygame" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="screenshots" /><category scheme="http://www.blogger.com/atom/ns#" term="GDI" /><category scheme="http://www.blogger.com/atom/ns#" term="reverse engineering" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="distorm" /><title>GDI Utilities: Taking Screenshots of Memory Dumps</title><content type="html">I've &lt;a href="http://moyix.blogspot.com/2009/02/teaser.html"&gt;posted about this before&lt;/a&gt; (&lt;a href="http://moyix.blogspot.com/2009/03/using-volatility-for-introspection.html"&gt;twice&lt;/a&gt;!), but somehow never gotten around to releasing functioning code. &lt;a href="http://www.cc.gatech.edu/~brendan/volatility/"&gt;Here (click)&lt;/a&gt;, for your downloading pleasure, is a set of plugins designed to extract information about on-screen (graphical) windows from Windows XP SP2/3 memory images. This includes:&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;window_list&lt;/b&gt; - give a text listing of the window hierarchy, with each window's on-screen coordinates, current style, and its class (Button, Window, etc.). Here's some &lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/jessek_new/windowlist.txt"&gt;example output to whet your appetite&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;screenshot&lt;/b&gt; - save a wireframe "screenshot" of the on-screen windows in a memory image. See later in this post for some examples. Requires &lt;a href="http://www.pythonware.com/products/pil/"&gt;PIL&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;wndmon&lt;/b&gt; - continuously monitor a memory image and provide an updating view of the on-screen windows. Works best in a live environment, e.g. with &lt;a href="http://code.google.com/p/xenaccess/"&gt;XenAccess and PyXa&lt;/a&gt;. Requires &lt;a href="http://www.pygame.org/"&gt;PyGame&lt;/a&gt;. (This is what I used for the &lt;a href="http://www.youtube.com/watch?v=c6OMlSoDXrw&amp;amp;feature=player_embedded"&gt;video demo&lt;/a&gt;).&lt;/li&gt;&lt;/ul&gt;All three plugins require the &lt;a href="http://code.google.com/p/distorm/"&gt;distorm disassembly library&lt;/a&gt; to work. I had a bit of trouble getting it to work under Linux, so here's the steps required so you don't have to go through the pain:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Get distorm3 from its &lt;a href="http://code.google.com/p/distorm/"&gt;Google Code site&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Go into build/linux and type "make".&lt;/li&gt;&lt;li&gt;Copy the resulting libdistorm3.so into the Python directory.&lt;/li&gt;&lt;li&gt;Rename the Python directory to "distorm" and move it somewhere in your Python path (I use Debian, and found that /usr/local/lib/python2.6/dist-packages/ worked well).&lt;/li&gt;&lt;/ol&gt;Hopefully this is a bit simpler under Windows, but I don't have a Windows box handy so I can't test that at the moment.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Have fun with the code. If you go exploring in the source, you may find some interesting things -- there's more functionality there than is exposed through the plugins, including some functions and data structures that can extract HTML content from IE in memory... ;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, to wrap things up, here's an example of the output from the screenshot plugin, running on the two NIST memory images:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From the &lt;b&gt;6/25 image&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/jessek_new/6-25.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/jessek_new/6-25_thumb.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From the &lt;b&gt;7/4 image&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/jessek_new/7-4.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/jessek_new/7-4_thumb.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And that, my friends, is the power of memory analysis.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-1234576523199683755?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/1234576523199683755/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=1234576523199683755" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/1234576523199683755?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/1234576523199683755?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2010/07/gdi-utilities-taking-screenshots-of.html" title="GDI Utilities: Taking Screenshots of Memory Dumps" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>9</thr:total></entry><entry gd:etag="W/&quot;D0ANR3c7eip7ImA9WxFbFEk.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-6395775283810654141</id><published>2010-07-06T13:17:00.012-05:00</published><updated>2010-07-06T14:49:56.902-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-06T14:49:56.902-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="rootkits" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="DKOM" /><category scheme="http://www.blogger.com/atom/ns#" term="process" /><category scheme="http://www.blogger.com/atom/ns#" term="signature" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="scanning" /><category scheme="http://www.blogger.com/atom/ns#" term="CCS2009" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Plugin Post: Robust Process Scanner</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BAQ7xz2YQlI/TDOGlNUXbLI/AAAAAAAAAUA/xxVUiuT7Ivk/s1600/scanners.png"&gt;&lt;/a&gt;&lt;div&gt;It's pretty well known, in memory forensics circles, that there are two common ways of finding processes in memory images: &lt;i&gt;list-walking&lt;/i&gt;, which traverses the kernel's linked list of process data structures, and &lt;i&gt;scanning&lt;/i&gt;, which does a sweep over memory, looking for byte patterns that match the data found in a process data structure.&lt;div&gt;&lt;br /&gt;&lt;div&gt;Having two different ways of finding processes can be very handy, especially when we suspect that someone may be trying to hide processes. One common way of hiding processes in Windows is called &lt;a href="http://www.blackhat.com/presentations/win-usa-04/bh-win-04-butler.pdf"&gt;DKOM (Direct Kernel Object Manipulation)&lt;/a&gt;; this technique works by just unlinking the process you want to hide from the kernel's list, like so:&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BAQ7xz2YQlI/TDN8e7HYwlI/AAAAAAAAATw/kFHBEX3cCRM/s1600/dkom.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 154px;" src="http://1.bp.blogspot.com/_BAQ7xz2YQlI/TDN8e7HYwlI/AAAAAAAAATw/kFHBEX3cCRM/s200/dkom.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5490869241401360978" /&gt;&lt;/a&gt;&lt;div&gt;&lt;div&gt;This makes it invisible from programs such as the task manager, as well as memory forensic tools that use list-walking (including Volatility's pslist). However, such hidden processes can still be found by scanning memory using a signature for the process data structure; this is what psscan2 does.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unfortunately, it's been known since at least 2007 (as mentioned in &lt;a href="http://www.blackhat.com/presentations/bh-dc-07/Walters/Presentation/bh-dc-07-Walters-up.pdf"&gt;AAron Walters and Nick Petroni's Blackhat DC talk&lt;/a&gt;, and more recently in a &lt;a href="http://www.kyrus-tech.com/wp-content/uploads/2010/06/Memory-Forensics-DKOM.pdf"&gt;presentation by Jesse Kornblum&lt;/a&gt;) that even signature scans can be evaded by crafty attackers. Signatures typically rely on "magic" values found in the process data structure. For example, in Windows XP, process data structures always begin with "&lt;tt&gt;\x03\x00\x1b\x00&lt;/tt&gt;", which makes it pretty easy to find them in memory images.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But is that magic value really essential to the correct functioning of a process in Windows? What if an attacker just overwrites those four bytes with zeroes? As it turns out, Windows will be perfectly happy to keep running the process! At the same time, it will be completely hidden from existing forensic tools. What's more, as I demonstrated in my paper for CCS 2009 (&lt;a href="http://www.cc.gatech.edu/~brendan/ccs09_siggen.pdf"&gt;Robust Signatures for Kernel Data Structures&lt;/a&gt;), around 51 fields in the process data structure can be manipulated by attackers in this way – including nearly all of the fields currently used to find processes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So what's a forensic analyst to do? Luckily, there are some parts of the process data structure that are hard for an attacker to mess with without causing one of these:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_BAQ7xz2YQlI/TDOB-WIqC8I/AAAAAAAAAT4/fCW4B-AhH1Q/s200/Bsod_w2k.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5490875278788529090" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 200px; height: 150px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;So if we can build a signature based on these fields, we can find processes that existing signature scanners might miss.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;And that's just what I've done. Here, for your consideration and consumption, is the creatively-named &lt;a href="http://www.cc.gatech.edu/~brendan/volatility/dl/psscan3.py"&gt;psscan3&lt;/a&gt; (just drop it into the memory_plugins directory of Volatility 1.3.2). It uses a only fields that have been identified as "robust" to locate processes in Windows memory. It's a bit slower than the existing scanners, right now, because it's checking for more things.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you want to try it out, you might also want to download this &lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/ds_fuzz_hidden_proc.img.bz2"&gt;sample memory image&lt;/a&gt;, which has a hidden process at offset 0x01a4bc20. In Volatility, pslist, psscan, and psscan2 all miss the process, but psscan3 detects it, as shown in this exciting screenshot (click to enlarge; the windows show, from left to right, psscan, psscan2, and psscan3) [EDIT: Blogger is for some reason refusing to link to the larger size; click &lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/scanners.png"&gt;here&lt;/a&gt; to view it]:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;img src="http://1.bp.blogspot.com/_BAQ7xz2YQlI/TDOGlNUXbLI/AAAAAAAAAUA/xxVUiuT7Ivk/s200/scanners.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5490880344483130546" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 200px; height: 65px; " /&gt;If you'd like a copy of the rootkit that hid this process (which is based on the &lt;a href="http://rootkit.com/board_project_fused.php?did=proj12"&gt;FU Rootkit&lt;/a&gt;), send me an &lt;a href="mailto:brendandg@gatech.edu"&gt;e-mail&lt;/a&gt; (but be warned that I probably won't be able to dig up the source until this fall).&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/scanners.png"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So that's it! If you want to find out more about what went into this plugin, you're encouraged to check out my &lt;a href="http://www.cc.gatech.edu/~brendan/ccs09_siggen.pdf"&gt;paper&lt;/a&gt;, or browse the &lt;a href="http://www.cc.gatech.edu/~brendan/ccs09_siggen_talk.pdf"&gt;slides&lt;/a&gt; from the talk at &lt;a href="http://www.sigsac.org/ccs/CCS2009/"&gt;CCS 2009&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-6395775283810654141?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/6395775283810654141/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=6395775283810654141" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/6395775283810654141?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/6395775283810654141?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2010/07/plugin-post-robust-process-scanner.html" title="Plugin Post: Robust Process Scanner" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_BAQ7xz2YQlI/TDN8e7HYwlI/AAAAAAAAATw/kFHBEX3cCRM/s72-c/dkom.png" height="72" width="72" /><thr:total>8</thr:total></entry><entry gd:etag="W/&quot;DUQARXk-fSp7ImA9WxJbEE4.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-2344779882243381617</id><published>2009-07-11T21:28:00.010-05:00</published><updated>2009-07-19T16:02:24.755-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-19T16:02:24.755-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SANS" /><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="slides" /><category scheme="http://www.blogger.com/atom/ns#" term="volrip" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="volreg" /><category scheme="http://www.blogger.com/atom/ns#" term="presentation" /><title>SANS Forensic Summit: Thoughts and Slides</title><content type="html">This past Tuesday I attended the 2009 SANS Forensic Summit. In part, I was there to give a talk on combining volatile memory analysis with forensic analysis (see below for the slides from that), but I was also pretty excited about getting to hang out with the bright lights of the forensics community like Harlan Carvey, Chris Pogue, Richard Bejtlich, and many more.&lt;br /&gt;&lt;br /&gt;Unfortunately, I was only able to attend the first day, which consisted primarily of technical talks on various aspects of forensics, incident response, and live forensics. All the talks were really excellent; Rob Lee and the folks at SANS should be commended for their great work in putting everything together. In this post I'm going to just describe the talks, rather than the panels; unfortunately I forgot to take notes during the panels and so I don't have as much to say about them, other than that they were fun and highly informative.&lt;br /&gt;&lt;br /&gt;On to the talks! The first talk of the morning was Richard Bejtlich's keynote, which gave a really great analysis of the current state of the industry and the challenges faced by investigators today. He drew heavily from the Verizon Data Breach Investigations&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Report, which gave his assertions a nice feel of solidity to them; for example, when he says that we're in bad shape (getting compromised left and right), he can back that up with statistics showing that most &lt;em&gt;&lt;/em&gt;intrusions are discovered only through third party notifications. If you're not already reading Richard's posts over at TaoSecurity, I highly encourage it.&lt;br /&gt;&lt;br /&gt;After the keynote, Kris Harms got up to talk about live response. He gave a lot of cool tips on how to use some standard tools that most people should be familiar with (pslist, handles, etc.) to quickly triage  a system and make a determination on whether it needs deeper analysis. I have to admit that I don't usually think a lot about live analysis--from a standpoint of simply collecting volatile data, I think that memory forensics offers a much better solution. However, from a triage perspective, live analysis makes a lot of sense; you can get a lot of leads very quickly by just knowing how to poke around on the live system.&lt;br /&gt;&lt;br /&gt;Nevertheless, I did have one quibble with this talk. It seemed like a lot of the techniques presented, while cool, were a little haphazard. That is, "poking around" isn't necessarily repeatable, which means that as an investigator you could end up missing data by performing a different set of actions on different cases. After all, we're only human, and sometimes we forget things. I personally prefer to make sure that anything I'm going to do more than once is scripted. This allows one to codify an investigative procedure so that it's consistent and repeatable -- think of it as an executable checklist.&lt;br /&gt;&lt;br /&gt;For example, in the presentation, Kris Harms described finding hidden processes by using handle.exe and pulling out the PIDs of each handle table it finds (Harlan Carvey now has a &lt;a href="http://windowsir.blogspot.com/2009/07/more-perl-y-goodness.html"&gt;nice perl script&lt;/a&gt; that automates this). However, there are several rootkit detectors (such as IceSword) that will do this handle table vs. process list cross-view for you. I think we should definitely learn about these techniques and how they work, but I don't see the point in trying to keep them all in your head and do them by hand each time -- put it in a script and let the computer do the work.&lt;br /&gt;&lt;br /&gt;After lunch, Harlan Carvey got up to talk about Windows registry analysis, a field that he did a lot of pioneering work in and essentially dominates. Things got a little hectic at the end, as he raced through some information-dense slides on specific kinds of forensic information you could get out of the registry, but overall I really found the talk engaging and illuminating. It also served as a really great motivator for my own talk: he spent a while near the beginning talking about volatile registry data and some of the reasons it's important. This set me up very nicely, since my own presentation was all about extracting registry data from memory. And I didn't even have to bribe him (much)!&lt;br /&gt;&lt;br /&gt;Ending out the day (for presentations, at least)  was a combined, hour and a half long session on memory analysis with Jamie Butler, Peter Silberman, and me. Peter and Jamie gave a great talk on Memoryze, which is Mandiant's free (as in beer) tool for analyzing volatile memory. Although most of the stuff presented was nothing new if you've been following memory analysis research, it was nice to see their software in action. They also announced the release of a new version of Memoryze, which supports Vista more fully, including the reworked networking code. Peter and Jamie are both very smart, and while I personally prefer Volatility for my own work, I'm glad that people have great options like Memoryze and Volatility to choose from.&lt;br /&gt;&lt;br /&gt;Finally, after Jamie and Peter, I gave my own talk on combining registry analysis with memory forensics. There wasn't much new research presented in the talk, but I think it serves as a nice introduction to the toolset for people that haven't seen it before. The slides are available at the bottom of this post (assuming I can get this embedding thing to work), and I'll let them speak for themselves. :)&lt;br /&gt;&lt;br /&gt;Once again, a huge thanks to Rob Lee and everyone who organized and attended the SANS Forensics Summit 2009! If you missed it this year, I hope this post has given you a taste of some of the great stuff that goes on there, and will encourage you to go next time!&lt;br /&gt;&lt;br /&gt;&lt;div style="width:425px;text-align:left" id="__ss_1741091"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mooyix/sans-forensics-2009-memory-forensics-and-registry-analysis" title="SANS Forensics 2009 - Memory Forensics and Registry Analysis"&gt;SANS Forensics 2009 - Memory Forensics and Registry Analysis&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sansforensics-090719155854-phpapp01&amp;stripped_title=sans-forensics-2009-memory-forensics-and-registry-analysis" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=sansforensics-090719155854-phpapp01&amp;stripped_title=sans-forensics-2009-memory-forensics-and-registry-analysis" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View more &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/"&gt;documents&lt;/a&gt; from &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/mooyix"&gt;mooyix&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-2344779882243381617?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/2344779882243381617/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=2344779882243381617" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/2344779882243381617?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/2344779882243381617?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/07/sans-forensic-summit-thoughts-and.html" title="SANS Forensic Summit: Thoughts and Slides" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUEBRXo8fSp7ImA9WxJVFEg.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-422625028568003691</id><published>2009-07-01T08:50:00.004-05:00</published><updated>2009-07-01T09:14:14.475-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-01T09:14:14.475-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SANS" /><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="volreg" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="Andreas Schuster" /><title>Odds and Ends</title><content type="html">I've been too busy to do any longer entries recently, but I wanted to note a couple things quickly.&lt;br /&gt;&lt;br /&gt;First up, Andreas Schuster has just released a &lt;a href="http://computer.forensikblog.de/files/talks/FIRST2009-Windows_Memory_Forensics_with_Volatility.zip"&gt;wonderful set of slides&lt;/a&gt; on using Volatility to do memory forensics. The slides include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Great background material on the how, what, and why of memory acquisition and forensics.&lt;/li&gt;&lt;li&gt;A refresher on some OS basics you need to really understand memory analysis.&lt;/li&gt;&lt;li&gt;An amazing and comprehensive walkthrough on how to use a number of Volatility modules plugins in an investigation (including a few of my own tools, like &lt;a href="http://moyix.blogspot.com/2008/08/auditing-system-call-table.html"&gt;ssdt.py&lt;/a&gt; and &lt;a href="http://moyix.blogspot.com/2009/01/memory-registry-tools.html"&gt;VolReg&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;Great information on the internals of Volatility, including a tutorial on creating your own plugins.&lt;/li&gt;&lt;/ul&gt;This is really awesome stuff, and I highly recommend it to anyone looking to learn more about Volatility or even start contributing to the community with new plugins! Many thanks to Andreas!&lt;br /&gt;&lt;br /&gt;Second, I wanted to let everyone know once again that I'm going to be speaking at the &lt;span style="font-size:100%;"&gt;&lt;a href="http://forensics.sans.org/summit09/"&gt;SANS WhatWorks Summit in Forensics and Incident Response&lt;/a&gt; in Washington, DC on how to combine registry analysis and memory forensics for more effective incident response. I'm really looking forward to this event, as it promises to bring together a lot of luminaries from the forensics community, such as &lt;a href="http://windowsir.blogspot.com/"&gt;Harlan Carvey&lt;/a&gt;, &lt;a href="http://jessekornblum.livejournal.com/"&gt;Jesse Kornblum&lt;/a&gt;, and &lt;a href="http://thedigitalstandard.blogspot.com/"&gt;Chris Pogue&lt;/a&gt;, as well some people with a lot of knowledge and experience with offensive techniques like &lt;a href="http://blog.mandiant.com/"&gt;Jamie Butler and Peter Silberman&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you're planning on attending, or are in the DC area, drop me a note and perhaps we can meet up at the summit!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-422625028568003691?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/422625028568003691/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=422625028568003691" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/422625028568003691?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/422625028568003691?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/07/odds-and-ends.html" title="Odds and Ends" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;A0QGQno8eip7ImA9WxJXFEs.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-7316093985374528002</id><published>2009-06-08T08:16:00.003-05:00</published><updated>2009-06-08T08:55:23.472-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-08T08:55:23.472-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="CM_BIG_DATA" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="volreg" /><category scheme="http://www.blogger.com/atom/ns#" term="volshell" /><category scheme="http://www.blogger.com/atom/ns#" term="updates" /><title>VolReg 0.6, now with BIG_DATA</title><content type="html">If you follow &lt;a href="http://www.msuiche.net/2009/06/07/windows-vista-and-later-registry-secrets/"&gt;Matthieu Suiche's blog&lt;/a&gt; (and if you don't, you really should!), you probably saw his post about an undocumented type of registry value -- CM_BIG_DATA. This is a registry optimization introduced by Microsoft with Windows XP that allows for more efficient storage of large amounts of data in the registry.&lt;br /&gt;&lt;br /&gt;You can read more about the details of this new way of storing large values in &lt;a href="http://www.msuiche.net/2009/06/07/windows-vista-and-later-registry-secrets/"&gt;his post&lt;/a&gt;, but I wanted to announce the release of a new version of VolReg with experimental support for BIG_DATA values. As always, you can get the latest version of VolReg from my &lt;a href="http://www.cc.gatech.edu/%7Ebrendan/volatility/"&gt;Volatility plugin page&lt;/a&gt;. This release also fixes a bug found by AAron Walters where an exception would be raised if the data returned for a value is less than the required amount for that type (e.g., only two bytes being available for a REG_DWORD).&lt;br /&gt;&lt;br /&gt;I also updated &lt;a href="http://www.cc.gatech.edu/%7Ebrendan/volatility/dl/volshell.py"&gt;Volshell&lt;/a&gt;, fixing a regression found by J. Hewlett that broke the ability to use the "dt" command to examine a data structure without overlaying it on memory. I also added the ability to pass the "db" and "dd" commands an address space, so that you can now get a hexdump or dword-dump of things like physical memory and registry hive spaces. The syntax for this is "dd(address, space=[addr_space])". More details are available in the online help, which you can read by doing "hh(dd)" or "hh(db)".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-7316093985374528002?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/7316093985374528002/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=7316093985374528002" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7316093985374528002?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7316093985374528002?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/06/volreg-06-now-with-bigdata.html" title="VolReg 0.6, now with BIG_DATA" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A04DQH84fyp7ImA9WxJXE00.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-4410091420390481715</id><published>2009-06-06T12:28:00.002-05:00</published><updated>2009-06-06T12:39:31.137-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-06T12:39:31.137-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="win7" /><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="sample data" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="hive" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Windows 7 Registry Hives</title><content type="html">&lt;a href="http://www.sentinelchicken.com/"&gt;Tim Morgan&lt;/a&gt; was looking for some reference &lt;a href="http://www.microsoft.com/windows/windows-7/"&gt;Windows 7&lt;/a&gt; registry hives the other day to test &lt;a href="http://projects.sentinelchicken.org/reglookup/"&gt;reglookup&lt;/a&gt;, and it occurred to me that others might find them useful as well. So, without further ado, here's a link to &lt;a href="http://amnesia.gtisc.gatech.edu/%7Emoyix/win7_hives.tar.gz"&gt;download some registry hives&lt;/a&gt; I took from a fresh Windows 7 VM.&lt;br /&gt;&lt;br /&gt;Also, in case you were thinking of being clever, the VM password was "password" ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-4410091420390481715?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/4410091420390481715/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=4410091420390481715" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/4410091420390481715?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/4410091420390481715?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/06/windows-7-registry-hives.html" title="Windows 7 Registry Hives" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C04AQ3k5cCp7ImA9WxJRGU8.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-3203599596410251976</id><published>2009-05-21T10:59:00.000-05:00</published><updated>2009-05-21T11:05:42.728-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-21T11:05:42.728-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="reference" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Comprehensive New Resource on the Windows Registry</title><content type="html">Peter Norris was kind enough to point me at his Masters Thesis, &lt;a href="http://suzibandit.ltd.uk/MSc/"&gt;The Internal Structure of the Windows Registry&lt;/a&gt;. Much of the information was previously available from a variety of sources (including this blog), but Peter's work also goes into a lot of unexplored territory, and doesn't shy away from the more esoteric aspects of the registry -- like how and when the Configuration Manager decides to update the on-disk copy of the registry with changes from memory.&lt;br /&gt;&lt;br /&gt;Anyone who works with registry data for forensics or creates tools to work with the Windows registry would do well to give this a thorough read-through. Thanks to Peter for this excellent contribution!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-3203599596410251976?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/3203599596410251976/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=3203599596410251976" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/3203599596410251976?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/3203599596410251976?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/05/comprehensive-new-resource-on-windows.html" title="Comprehensive New Resource on the Windows Registry" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0UDR349fip7ImA9WxVUGEk.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-7009441317273330405</id><published>2009-03-23T15:59:00.006-05:00</published><updated>2009-03-23T18:01:16.066-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-23T18:01:16.066-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="win32k" /><category scheme="http://www.blogger.com/atom/ns#" term="video" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="GDI" /><category scheme="http://www.blogger.com/atom/ns#" term="Xen" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Using Volatility for Introspection</title><content type="html">This post could also be titled "&lt;a href="http://moyix.blogspot.com/2009/02/teaser.html"&gt;Teaser&lt;/a&gt;", part 2 :)&lt;br /&gt;&lt;br /&gt;As part of my research at GT, I've been looking at using &lt;a href="https://www.volatilesystems.com/default/volatility"&gt;Volatility&lt;/a&gt; to examine the state of running virtual machines. Using PyXa, a wrapper around Bryan Payne's &lt;a href="http://code.google.com/p/xenaccess/"&gt;XenAccess&lt;/a&gt; library (available in the tools directory of the latest XenAccess release), you can get access to the memory of &lt;a href="http://www.xen.org/"&gt;Xen&lt;/a&gt; guest VMs in Python. From there, it's just a small step to create a new address space  that Volatility can use to examine virtual machines just as if they were any other memory image.&lt;br /&gt;&lt;br /&gt;One application of this is using introspection to find out the state of windows on screen. This has advanced significantly since the last time I mentioned it, and it's now possible to track windows, including their z-order and some on-screen text, in near-real time. To demo this I used Volatility to examine the internal data structures of Win32k.sys and extract the locations and sizes of all visible windows, and then used &lt;a href="http://www.pygame.org/news.html"&gt;PyGame&lt;/a&gt; to draw them on screen. The script keeps looping and re-drawing, allowing a near real-time view of what's going on inside the guest VM.&lt;br /&gt;&lt;br /&gt;Here's a video of it in action. Notice how the reconstructed view updates to match what's actually going on on screen:&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/c6OMlSoDXrw&amp;amp;hl=en&amp;amp;fs=1&amp;amp;fmt=22"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/c6OMlSoDXrw&amp;amp;hl=en&amp;amp;fs=1&amp;amp;fmt=22" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Cool, huh? :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-7009441317273330405?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/7009441317273330405/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=7009441317273330405" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7009441317273330405?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7009441317273330405?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/03/using-volatility-for-introspection.html" title="Using Volatility for Introspection" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total></entry><entry gd:etag="W/&quot;A0ENR3wzeip7ImA9WxVVGEU.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-1598429660467126466</id><published>2009-03-12T13:50:00.005-05:00</published><updated>2009-03-12T15:28:16.282-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-12T15:28:16.282-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="guidance" /><category scheme="http://www.blogger.com/atom/ns#" term="rebuttal" /><category scheme="http://www.blogger.com/atom/ns#" term="encase" /><category scheme="http://www.blogger.com/atom/ns#" term="FUD" /><title>Quick Response to Guidance</title><content type="html">Everyone's been (rightfully) beating up on Guidance for their recent FUD-laden e-mail about F-Response; you should check out the excellent rebuttals by &lt;a href="http://windowsir.blogspot.com/2009/03/bashing-competitionfail.html"&gt;Harlan Carvey&lt;/a&gt; and &lt;a href="http://forensicir.blogspot.com/2009/03/f-bomb.html"&gt;hogfly&lt;/a&gt;. I'm not going to address most of the e-mail, but I thought I should tackle some things that are simply factually wrong about Volatility. I'm hardly an unbiased party (being a developer on Volatility), but unlike Guidance, I'm going to provide verifiable information to back up my claims.&lt;br /&gt;&lt;br /&gt;From the Guidance mail:&lt;br /&gt;&lt;blockquote&gt;While these utilities [included in the Volatility Framework] can identify running processes, open files and registry handles for running processes and open network sockets and connections, they cannot identify hidden processes, injected DLLs and NIC information.&lt;/blockquote&gt;There are three factual inaccuracies in this statement:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Volatility cannot identify hidden processes.&lt;/span&gt;&lt;br /&gt;In fact, Volatility can list processes using multiple methods. The pslist module walks the list of active processess, and will find any processes that have not been hidden with DKOM. The psscan2 module scans memory looking for signatures of process data structures; it will find even those processes that have been hidden using DKOM-like techniques. Together, these can be used to find any hidden processes on the machine.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Volatility cannot find injected DLLs.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://mnin.blogspot.com/"&gt;Michael Hale Ligh&lt;/a&gt; recently released a plugin called &lt;a href="http://mnin.blogspot.com/2009/01/malfind-volatility-plug-in.html"&gt;malfind&lt;/a&gt; that automates the work of doing exactly this. In fact, it is advanced enough that it can detect many types of generic code injection as well as simple DLL injection. I'm not familiar with Guidance's offering in this area, but I strongly suspect that they do not handle as many types of code injection.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Volatility cannot get NIC information.&lt;/span&gt;&lt;br /&gt;Again, this is false. My own &lt;a href="http://moyix.blogspot.com/2009/01/memory-registry-tools.html"&gt;registry tools&lt;/a&gt; can examine the registry keys that describe the network interfaces on the machine. If this is too much work for an investigator, the recent &lt;a href="http://moyix.blogspot.com/2009/03/regripper-and-volatility-prototype.html"&gt;integration with RegRipper&lt;/a&gt; will make this task even easier. In the &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/regripper_system_example.txt"&gt;example RegRipper log&lt;/a&gt; I posted, you can see the network card information has been gathered from the memory image.&lt;/li&gt;&lt;/ul&gt;So, the moral of the story is, don't believe everything you read, even when it comes from a large security vendor.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-1598429660467126466?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/1598429660467126466/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=1598429660467126466" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/1598429660467126466?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/1598429660467126466?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/03/quick-response-to-guidance.html" title="Quick Response to Guidance" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;Ak4NSH0_cCp7ImA9WxVVEU8.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-7472914382043947112</id><published>2009-03-03T17:14:00.008-05:00</published><updated>2009-03-03T20:09:59.348-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-03T20:09:59.348-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="volshell" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="updates" /><title>Updates and a New Home for Plugins</title><content type="html">As I've now released a number of plugins for Volatility, and some have gone through a couple revisions, I thought I'd put them all up on &lt;a href="http://www.cc.gatech.edu/%7Ebrendan/volatility/"&gt;a single page&lt;/a&gt;, which can point to the latest versions and act as a sort of one-stop shop.&lt;br /&gt;&lt;br /&gt;I've also updated the registry tools yet again, to fix some bugs and add new functionality, and also made some enhancements to volshell. You can read about the changes below:&lt;br /&gt;&lt;br /&gt;Changes to &lt;span style="font-weight: bold;"&gt;VolReg&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;New command &lt;span style="font-weight: bold;"&gt;hivedump&lt;/span&gt;: dump keys and timestamps (and optionally value data) from all hives to a CSV file.&lt;/li&gt;&lt;li&gt;Many improvements to robustness and error handling when reading key and value data.&lt;/li&gt;&lt;li&gt;When checking the registry hive names, catch exceptions and try to continue anyway (reported by chris).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Changes to &lt;span style="font-weight: bold;"&gt;volshell&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A new command, &lt;span style="font-weight: bold;"&gt;dis&lt;/span&gt;, is available. If distorm is installed, it will disassemble bytes from a given memory address as x86 code.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;db&lt;/span&gt; no longer rounds length to a multiple of 4.&lt;/li&gt;&lt;li&gt;Use a single profile object throughout all commands (speed improvement)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;dt&lt;/span&gt; can now overlay an arbitrary structure at an address, for example: dt('_EPROCESS', 0x81234567)&lt;/li&gt;&lt;/ul&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-7472914382043947112?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/7472914382043947112/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=7472914382043947112" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7472914382043947112?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7472914382043947112?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/03/updates-and-new-home-for-plugins.html" title="Updates and a New Home for Plugins" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total></entry><entry gd:etag="W/&quot;CEQDQXw_cCp7ImA9WxVWGUs.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-8896753152884934430</id><published>2009-03-01T16:40:00.039-05:00</published><updated>2009-03-01T21:52:50.248-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-01T21:52:50.248-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="regripper" /><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><category scheme="http://www.blogger.com/atom/ns#" term="memory" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>RegRipper and Volatility Prototype</title><content type="html">When I first released the &lt;a href="http://moyix.blogspot.com/2009/01/memory-registry-tools.html"&gt;registry tools for Volatility&lt;/a&gt;, I discussed the possibility of interoperating with Harlan Carvey's excellent &lt;a href="http://regripper.net/"&gt;RegRipper&lt;/a&gt;. Now, thanks to &lt;a href="http://search.cpan.org/%7Enine/Inline-Python/Python.pod"&gt;Inline::Python&lt;/a&gt; and a bit of hackery, you can now run RegRipper against a memory image! Unfortunately, since Inline::Python only seems to work on Linux, you'll need to have a working Linux box around to use this (if anyone knows of a &lt;span style="font-style: italic;"&gt;cross-platform&lt;/span&gt; way to use Python code from Perl, please let me know!).&lt;br /&gt;&lt;br /&gt;I'll get to the details of how this works later, but for now let's talk about how you actually use this stuff. First of all, since we depend on Inline::Python to manage the unholy union of Perl and Python, you'll need to get it from &lt;a href="http://www.cpan.org/"&gt;CPAN&lt;/a&gt; or your distribution's package manager. No need to install &lt;a href="http://search.cpan.org/%7Ejmacfarla/Parse-Win32Registry/lib/Parse/Win32Registry.pm"&gt;Parse::Win32Registry&lt;/a&gt;; I've replaced it with my own registry code that will run against memory.&lt;br /&gt;&lt;br /&gt;Next, you should download the latest version of the registry tools [&lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volreg-0.3.tar.gz"&gt;tarball&lt;/a&gt;, &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volreg-0.3.zip"&gt;zip&lt;/a&gt;] (side note: I updated them yet again, fixing a couple bugs and adding some basic checking to make sure you've got the right hives when using the credential dumping plugins), as well as the VolRip package [&lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volrip-0.1.tar.gz"&gt;tarball&lt;/a&gt;, &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volrip-0.1.zip"&gt;zip&lt;/a&gt;]. Unpack both into your Volatility directory.&lt;br /&gt;&lt;br /&gt;Finally, you'll need a list of the virtual addresses of each registry hive in the image you want to examine. You can generate this list by first running the &lt;span style="font-family:courier new;"&gt;hivescan&lt;/span&gt; plugin to find the physical address of any hive, and then passing that to the &lt;span style="font-family:courier new;"&gt;hivelist&lt;/span&gt; plugin. You can see the results for the &lt;a href="http://www.cfreds.nist.gov/mem/Basic_Memory_Images.html"&gt;xp-laptop-2005-07-04&lt;/a&gt; image &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/xp-laptop-2005-07-04_hives.txt"&gt;here&lt;/a&gt;. For this example, we'll be using the SYSTEM hive, which is at address &lt;span style="font-family:courier new;"&gt;0xe1035b60&lt;/span&gt; in that image.&lt;br /&gt;&lt;br /&gt;Now, let's run RegRipper! We're going to run the system plugins against the &lt;a href="http://www.cfreds.nist.gov/mem/Basic_Memory_Images.html"&gt;xp-laptop-2005-07-04&lt;/a&gt; image, like so:&lt;a href="http://www.cfreds.nist.gov/mem/Basic_Memory_Images.html"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;perl rip.pl -r xp-laptop-2005-07-04-1430.img@0xe1035b60 -f system&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can see &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/regripper_system_example.txt"&gt;the results here&lt;/a&gt;, if you can't follow along directly at home. If you're familiar with RegRipper, you'll notice that where we usually give the path to the registry hive, we've instead given the path to the memory image, and the virtual address of the hive we want to examine (here, the SYSTEM hive).&lt;br /&gt;&lt;br /&gt;That's really about all there is to it! You use rip.pl just as you always would, but instead of giving it the hive filename, you instead pass the image and address of the hive, separated by an "@" sign. You can still run individual plugins using -p, use the "hive guessing" feature with -g, or run a whole batch of plugins using -f. Now, if you want to know more about how this works, read on...&lt;br /&gt;&lt;br /&gt;The basic idea was to create a set of Python objects that emulated the interface provided by &lt;a href="http://search.cpan.org/%7Ejmacfarla/Parse-Win32Registry-0.41/"&gt;James Macfarlane's Parse::Win32Registry&lt;/a&gt; as closely as possible. This is what regwrap.py does: provides a translation layer between my own registry API and the one exposed by Parse::Win32Registry. Once we've done that, we can drop this emulated object into rip.pl, and the Perl code will run happily, thinking it's operating on normal hive files.&lt;br /&gt;&lt;br /&gt;I had to make the following changes to rip.pl to get this to work:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Instead of importing Parse::Win32Registry, use Inline::Python to import my own wrapper class and bind it to the name "Parse::Win32Registry".&lt;/li&gt;&lt;li&gt;Comment out the lines that check to make sure the hive file exists -- since we're smushing the memory image and hive address into a single "filename", those checks will now fail.&lt;/li&gt;&lt;li&gt;Minor changes so that rip.pl works on Linux.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;As you can see, not many changes were required. With just these modifications, &lt;span style="font-style: italic;"&gt;most&lt;/span&gt; RegRipper plugins run perfectly.&lt;br /&gt;&lt;br /&gt;However, there was still one small wart that I couldn't get rid of just by emulating the library. See, in Perl, you can call a function in two &lt;span style="font-style: italic;"&gt;contexts&lt;/span&gt;: "scalar" and "array". This basically means, "is the function result being stored in an array, or in a scalar variable"--and functions can decide to do different things depending on what context they're called from. An example of this is the get_data method of Value objects in Parse::Win32Registry.&lt;br /&gt;&lt;br /&gt;The get_data method, when called on a REG_MULTI_SZ value, will return an array of strings if called from array context, but returns a string with all the strings separated by spaces if called in a scalar context. Unfortuantely, the Python code has no way of telling what Perl context it's being called from, so my wrapper always returns a list. This means that a couple of plugins (shares.pl and nic_mst2.pl) would print "ARRAY(0x12345)" instead of the actual data in some cases.&lt;br /&gt;&lt;br /&gt;Instead of trying to come up with a convoluted way around this, I opted to just change the two plugins in question to remove any ambiguity as to how the function was called. I'm still not sure I've identified all the plugins that do this (I tried to run them all to check, but may have missed something), but the results look good to me now.&lt;br /&gt;&lt;br /&gt;So, to summarize: it's now possible to run RegRipper against memory images! The modifications required were pretty minimal, so it should be easy to keep things updated as new versions of RegRipper come out. In particular, aside from the two plugins I mentioned, upgrading the plugins should be as easy as just dropping them into the rrplugins directory.&lt;br /&gt;&lt;br /&gt;Enjoy, and as always, let me know if you find any bugs :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-8896753152884934430?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/8896753152884934430/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=8896753152884934430" title="21 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8896753152884934430?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8896753152884934430?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/03/regripper-and-volatility-prototype.html" title="RegRipper and Volatility Prototype" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>21</thr:total></entry><entry gd:etag="W/&quot;Ak4BSHc6fSp7ImA9WxVXFEo.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-8128821924504753205</id><published>2009-02-12T17:37:00.004-05:00</published><updated>2009-02-12T17:49:19.915-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-12T17:49:19.915-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="win32k" /><category scheme="http://www.blogger.com/atom/ns#" term="screenshots" /><category scheme="http://www.blogger.com/atom/ns#" term="GDI" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Teaser</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://amnesia.gtisc.gatech.edu/~moyix/jessek_screen/7_4_desktop.png"&gt;&lt;/a&gt;I don't have time for a full post right now, but I thought I'd offer a fun product of some things I've been working on recently. The work involves getting information about the windows on screen at the time a memory image was taken. One of the things you can extract is the position and size of each widget (called a "window", though I find this terminology a little confusing).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since I don't have time to go into the data structures and so on involved, I thought I'd give you all two "screenshots" that I reconstructed from the NIST XP SP2 memory images. Basically it's a white canvas as large as the screen resolution, with rectangles drawn on for each window on the screen. Without further ado:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;From the 6/25 image:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); "&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/jessek_screen/6_25_desktop.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/jessek_screen/6_25_desktop_thumb.png" border="0" alt="" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 240px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;From the 7/4 image:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); font-weight: normal; "&gt;&lt;a href="http://amnesia.gtisc.gatech.edu/~moyix/jessek_screen/7_4_desktop.png"&gt;&lt;img src="http://amnesia.gtisc.gatech.edu/~moyix/jessek_screen/7_4_desktop_thumb.png" border="0" alt="" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 240px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;More details to come :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-8128821924504753205?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/8128821924504753205/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=8128821924504753205" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8128821924504753205?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/8128821924504753205?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/02/teaser.html" title="Teaser" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;C08GR3c4fCp7ImA9WxVRF04.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-7739884113454213755</id><published>2009-01-23T12:17:00.004-05:00</published><updated>2009-01-23T12:30:26.934-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-23T12:30:26.934-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="hive" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Registry Code Updates</title><content type="html">I've found a couple bugs in the registry code I released recently, and at least one is significant enough that a new release is warranted. Teach me to release code I wrote in a couple hours on a plane ;)&lt;br /&gt;&lt;br /&gt;The list of fixes is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Fix a bug that prevented any volatile subkeys from appearing when using the subkeys() function.&lt;/li&gt;&lt;li&gt;Add a check for None when using lsadump (reported by Paul Bobby, thanks!)&lt;/li&gt;&lt;li&gt;Add appropriate license statements at the top of each file (thanks AAron!). For the record, the license is the GNU General Public License (GPL).&lt;/li&gt;&lt;/ul&gt;You can download the new version as a &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volreg-0.2.zip"&gt;zip&lt;/a&gt; or &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volreg-0.2.tar.gz"&gt;tarball&lt;/a&gt;, and install it exactly as the previous version, by extracting it into your Volatility directory. If you have a previous version installed, this should just overwrite it (though you may have to tell your unzip program that's okay). As before, &lt;a href="http://www.dlitz.net/software/pycrypto/"&gt;PyCrypto&lt;/a&gt; is required for the credential extraction modules.&lt;br /&gt;&lt;br /&gt;One final note: I have seen some crashes when people attempt to use the hash extraction code, but pass the wrong address for the hive in memory. I'd like to fix this, but I don't yet have a good way of checking to make sure that a given hive is the SYSTEM or SAM or SECURITY hive. I'll try to find something that works, though, and release it with the next update.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-7739884113454213755?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/7739884113454213755/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=7739884113454213755" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7739884113454213755?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7739884113454213755?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/01/registry-code-updates.html" title="Registry Code Updates" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>8</thr:total></entry><entry gd:etag="W/&quot;CEECSXo-fCp7ImA9WxVREUk.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-7612353544128913177</id><published>2009-01-16T14:44:00.009-05:00</published><updated>2009-01-16T16:51:08.454-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-16T16:51:08.454-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="regripper" /><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="registry" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Memory Registry Tools!</title><content type="html">Hi everyone! I know it's a bit late, but I made you all a Christmas present: tools for accessing registry data in Windows memory dumps. This the work that I presented at &lt;a href="http://dfrws.org/2008/"&gt;DFRWS 2008&lt;/a&gt;; it took a while to release because I had to find time to port it to Volatility 1.3.&lt;br /&gt;&lt;br /&gt;To use them, grab either the &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volreg.zip"&gt;zip&lt;/a&gt; or the &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volreg.tar.gz"&gt;tarball&lt;/a&gt; and extract it to your Volatility directory. You'll get the following new plugins (along with some supporting files):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;hivescan&lt;/span&gt;: finds the physical address of CMHIVE structures, which represent a registry hives in memory&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;hivelist&lt;/span&gt;: takes a physical address of one CMHIVE, returns the virtual address of all hives, and their names&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;printkey&lt;/span&gt;: takes a virtual address of a hive and a key name (e.g., 'ControlSet001\Control'), and display the key's timestamp, values and subkeys&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;hashdump&lt;/span&gt;: dump the LanMan and NT hashes from the registry (deobfuscated). See &lt;a href="http://moyix.blogspot.com/2008/02/syskey-and-sam.html"&gt;this post&lt;/a&gt; for more details on how this is accomplished.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;lsadump&lt;/span&gt;: dump the LSA secrets (decrypted) from the registry. See &lt;a href="http://moyix.blogspot.com/2008/02/decrypting-lsa-secrets.html"&gt;this post&lt;/a&gt; for more information.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;cachedump&lt;/span&gt;: dump any cached domain password hashes from the registry. This will obviously only work if the memory image comes from a machine that was part of a domain. See &lt;a href="http://moyix.blogspot.com/2008/02/cached-domain-credentials.html"&gt;this post&lt;/a&gt; for more details.&lt;/li&gt;&lt;/ul&gt;In general, when you start working with an image you should:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Use &lt;span style="font-weight: bold;"&gt;hivescan&lt;/span&gt; to find the physical address of a hive.&lt;/li&gt;&lt;li&gt;Pass one of those (any of them should do) to &lt;span style="font-weight: bold;"&gt;hivelist&lt;/span&gt; using the &lt;span style="font-family:courier new;"&gt;-o&lt;/span&gt; option. This will give you the virtual address of each of the hives in memory.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;With this list in hand, you can now examine individual keys within a hive using &lt;span style="font-weight: bold;"&gt;printkey&lt;/span&gt;, or use &lt;span style="font-weight: bold;"&gt;hashdump&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;lsadump&lt;/span&gt;, or &lt;span style="font-weight: bold;"&gt;cachedump&lt;/span&gt; to extract credentials from the memory image. The latter three need the virtual addresses of specific hives (SYSTEM and SAM for &lt;span style="font-weight: bold;"&gt;hashdump&lt;/span&gt;, SYSTEM and SECURITY for &lt;span style="font-weight: bold;"&gt;lsadump&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;cachedump&lt;/span&gt;).&lt;/li&gt;&lt;/ol&gt;The full list of options available for each command can be obtained with --help. &lt;span style="font-weight: bold;"&gt;Note that hashdump, lsadump, and cachedump require &lt;a href="http://www.dlitz.net/software/pycrypto/"&gt;PyCrypto&lt;/a&gt; in order to de-obfuscate the various credentials!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you're curious how registry access works under the hood, you can read my DFRWS &lt;a href="http://dfrws.org/2008/proceedings/p26-dolan-gavitt.pdf"&gt;paper&lt;/a&gt; or &lt;a href="http://dfrws.org/2008/proceedings/p26-dolan-gavitt_pres.pdf"&gt;presentation&lt;/a&gt;, or check out the blog posts I wrote while doing that research: &lt;a href="http://moyix.blogspot.com/2008/02/enumerating-registry-hives.html"&gt;Enumerating Registry Hives&lt;/a&gt;, &lt;a href="http://moyix.blogspot.com/2008/02/reading-open-keys.html"&gt;Reading Open Keys&lt;/a&gt;, and &lt;a href="http://moyix.blogspot.com/2008/02/cell-index-translation.html"&gt;Cell Index Translation&lt;/a&gt;. And, of course, you can always just look at the source code :)&lt;br /&gt;&lt;br /&gt;Some final, closing thoughts. Harlan Carvey's &lt;a href="http://www.regripper.net/"&gt;RegRipper&lt;/a&gt; has been a huge sucess, and has shown a lot of people how much forensic information is stored in the registry. It would be awesome if this great tool could be applied to memory forensics, but unfortunately I have not yet figured out a way to integrate the two. However, this &lt;a href="http://search.cpan.org/%7Eneilw/Inline-Python-0.20/Python.pod"&gt;perl module&lt;/a&gt; looks promising; perhaps someone could write a Python wrapper around my registry code that would expose an interface compatible with &lt;a href="http://search.cpan.org/%7Ejmacfarla/Parse-Win32Registry-0.40/"&gt;Parse::Win32Registry&lt;/a&gt;, allowing RegRipper to run against a memory image with only slight modifications.&lt;br /&gt;&lt;br /&gt;Of course, since RegRipper plugins are all written in Perl, you could also just see what they're doing and reimplement it as a Volatility plugin! To make that easier, here's a quick guide to using the new registry API in Volatility:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start by opening a hive and assigning it to an address space. The HiveAddressSpace represents a hive in memory, and takes a virtual address space and offset to a hive as a base. Also, because the registry types are not part of Volatility's standard types, you need to add them in.&lt;br /&gt;&lt;pre&gt;from forensics.win32.hive2 import HiveAddressSpace&lt;br /&gt;from forensics.win32.regtypes import regtypes&lt;br /&gt;types.update(regtypes)&lt;br /&gt;syshive = HiveAddressSpace(addr_space, types, syshive_address)&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:times new roman;"&gt;Next, use the get_root() function to find the root key of the hive. You need to pass in the current profile.&lt;br /&gt;&lt;pre&gt;from forensics.win32.rawreg import *&lt;br /&gt;from forensics.object2 import Profile&lt;br /&gt;theProfile = Profile()&lt;br /&gt;root = get_root(syshive, theProfile)&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:times new roman;"&gt;To open a key, use open_key():&lt;br /&gt;&lt;pre&gt;key = open_key(root, ["ControlSet001", "Control", "Lsa"])&lt;br /&gt;print key.Name&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:times new roman;"&gt;To get a list of subkeys of a key, use subkeys():&lt;br /&gt;&lt;pre&gt;for sk in subkeys(key):&lt;br /&gt;    print sk.Name&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:times new roman;"&gt;To get the values of a key, use values():&lt;br /&gt;&lt;pre&gt;for v in values(key):&lt;br /&gt;    print v.Name&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:times new roman;"&gt;To parse the value data and return it in a more meaningful representation, use value_data():&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;for v in values(key):&lt;br /&gt;   val_type, val_data = value_data(v)&lt;br /&gt;   print v.Name, val_type, val_data&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;That's pretty much all you need to know! You can access other attributes of keys and values as members of the Python objects returned. The attributes available can be found in regtypes.py; keys are _CM_KEY_NODE objects and values are _CM_KEY_VALUE objects.&lt;br /&gt;&lt;br /&gt;I don't have time to write any more, unfortunately, but I hope these will be useful to people! I'll try to post an example of a RegRipper plugin converted to a Volatility one soon so there's a concrete example to work with. Until then, enjoy and feel free to &lt;a href="mailto:brendandg@gatech.edu"&gt;e-mail me&lt;/a&gt; (or leave comments) with any questions!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-7612353544128913177?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/7612353544128913177/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=7612353544128913177" title="10 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7612353544128913177?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/7612353544128913177?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2009/01/memory-registry-tools.html" title="Memory Registry Tools!" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>10</thr:total></entry><entry gd:etag="W/&quot;CkAMQXo8eip7ImA9WxVSEk8.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-5122751042948796298</id><published>2009-01-06T00:45:00.000-05:00</published><updated>2009-01-06T00:46:20.472-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-06T00:46:20.472-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="rootkits" /><category scheme="http://www.blogger.com/atom/ns#" term="PE" /><category scheme="http://www.blogger.com/atom/ns#" term="executable" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="kernel" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="driver" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Plugin Post: Moddump</title><content type="html">&lt;p&gt;By now, you all probably know that you can dump running programs from memory using the &lt;tt&gt;procdump&lt;/tt&gt; module in Volatility. But not all malware runs as a user-mode process. What about malicious kernel modules?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As it turns out, dumping these is also quite straightforward, and it's easy to write a plugin to do it. In fact, it's downright trivial -- kernel modules are just &lt;a href="http://en.wikipedia.org/wiki/Portable_Executable"&gt;PE files&lt;/a&gt; mapped into kernel memory (in exactly the same way as normal programs are PE files mapped into user memory). So to dump a particular kernel module, we can use Volatility's built-in PE dumper (the source is in &lt;tt&gt;forensics/win32/executable.py&lt;/tt&gt;, and point it at the memory address of a kernel module.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Naturally, I've made a plugin that implements this: grab &lt;a href="http://kurtz.cs.wesleyan.edu/~bdolangavitt/memory/moddump.py"&gt;moddump.py&lt;/a&gt; and put it in your &lt;tt&gt;memory_plugins&lt;/tt&gt; directory, and you'll be good to go. Here's what it looks like in action:&lt;small&gt;&lt;br /&gt;&lt;pre&gt;$ python volatility moddump --help&lt;br /&gt;Usage: moddump [options] (see --help)&lt;br /&gt;&lt;br /&gt;Options:&lt;br /&gt;  -h, --help            show this help message and exit&lt;br /&gt;  -f FILENAME, --file=FILENAME&lt;br /&gt;                        (required) XP SP2 Image file&lt;br /&gt;  -b BASE, --base=BASE  (optional, otherwise best guess is made)&lt;br /&gt;                        Physical offset (in hex) of directory&lt;br /&gt;                        table base&lt;br /&gt;  -t TYPE, --type=TYPE  (optional, default="auto") Identify the&lt;br /&gt;                        image type (pae, nopae, auto)&lt;br /&gt;  -m MODE, --mode=MODE  strategy to use when saving executable.&lt;br /&gt;                        Use "disk" to save using disk-based section&lt;br /&gt;                        sizes, "mem" for memory-based sections.&lt;br /&gt;                        (default: "mem")&lt;br /&gt;  -u, --unsafe          do not perform sanity checks on sections&lt;br /&gt;                        when dumping&lt;br /&gt;  -o OFFSET, --offset=OFFSET&lt;br /&gt;                        dump module whose base address is OFFSET (hex)&lt;br /&gt;  -p REGEX, --pattern=REGEX&lt;br /&gt;                        dump modules matching REGEX&lt;br /&gt;  -i, --ignore-case     ignore case in pattern match&lt;/pre&gt;&lt;/small&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The "mode" and "unsafe" options do the same thing as in the &lt;tt&gt;procdump&lt;/tt&gt; module. The other options are new though, so I'll go through them briefly here.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The &lt;tt&gt;-p&lt;/tt&gt; option allows you to give a regular expression to specify which modules to dump. The &lt;tt&gt;-i&lt;/tt&gt; option allows you to make this match case insensitive. If you don't give any way of specifying a module, it will simply dump all modules in the kernel's loaded module list.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Of course, if a driver is being stealthy, it could unlink itself from the kernel's list of loaded modules (just as processes can be hidden by removing from the systemwide process list). Often, these hidden drivers can be found by scanning memory for the data structure that represents a kernel module; Volatility's &lt;tt&gt;modscan&lt;/tt&gt; and &lt;tt&gt;modscan2&lt;/tt&gt; are good for this. Once you've found the hidden module, you can pass its base address to &lt;tt&gt;moddump&lt;/tt&gt; using the &lt;tt&gt;-o&lt;/tt&gt; option.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Regardless of how you choose the modules to dump, they will be saved in a file called &lt;tt&gt;driver.BASE_ADDRESS.sys&lt;/tt&gt;, where &lt;tt&gt;BASE_ADDRESS&lt;/tt&gt; is the module's address im memory.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Anyway, I hope you'll get some good use out of this. It's also possible to create a similar plugin that dumps DLLs loaded in a process, but I haven't gotten around to writing it yet, so if anyone's looking to get their feet wet with writing plugins for Volatility it could be a fun first project.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Cheers and Happy New Year until next time!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-5122751042948796298?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/5122751042948796298/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=5122751042948796298" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/5122751042948796298?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/5122751042948796298?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/10/plugin-post-moddump.html" title="Plugin Post: Moddump" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total></entry><entry gd:etag="W/&quot;DkYCQHg5eCp7ImA9WxRREE4.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-3253436235205227398</id><published>2008-09-21T13:17:00.073-05:00</published><updated>2008-09-21T16:56:01.620-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-21T16:56:01.620-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="win32k" /><category scheme="http://www.blogger.com/atom/ns#" term="forensics" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="GDI" /><category scheme="http://www.blogger.com/atom/ns#" term="threads" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="message" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Window Messages as a Forensic Resource</title><content type="html">&lt;span style="font-style: italic;"&gt;In which window messages are explored, a &lt;/span&gt;&lt;a style="font-style: italic;" href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/threadqueues.py"&gt;new plugin&lt;/a&gt;&lt;span style="font-style: italic;"&gt; is created, and we learn the importance of reading messages sent to you regularly.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Windows, the GUI system is &lt;span style="font-style: italic;"&gt;event-driven&lt;/span&gt;–actions occur in response to various events generated by the system. When you press a key on the keyboard, Windows generates a &lt;span style="font-style: italic;"&gt;window message&lt;/span&gt; (specifically, &lt;a href="http://msdn.microsoft.com/en-us/library/ms646280%28VS.85%29.aspx"&gt;WM_KEYDOWN&lt;/a&gt;) and sends it to the thread that owns the window that's in focus. That thread then call's the window's event handling procedure (the so-called &lt;a href="http://msdn.microsoft.com/en-us/library/ms633573%28VS.85%29.aspx"&gt;WindowProc&lt;/a&gt;) to process the message. There are &lt;a href="http://msdn.microsoft.com/en-us/library/ms644927.aspx#types"&gt;many such messages&lt;/a&gt;, covering input events such as &lt;a href="http://msdn.microsoft.com/en-us/library/ms646280%28VS.85%29.aspx"&gt;keyboard&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms674824%28VS.85%29.aspx"&gt;mouse&lt;/a&gt; actions, system-level events such as notification of a &lt;a href="http://msdn.microsoft.com/en-us/library/ms725498.aspx"&gt;time change&lt;/a&gt; or a &lt;a href="http://msdn.microsoft.com/en-us/library/aa373247%28VS.85%29.aspx"&gt;change in the system's power state&lt;/a&gt;, and events related to the windowing system, such as &lt;a href="http://msdn.microsoft.com/en-us/library/ms632647%28VS.85%29.aspx"&gt;resizing&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/ms632632%28VS.85%29.aspx"&gt;moving&lt;/a&gt; a window.&lt;br /&gt;&lt;br /&gt;How can these be forensically relevant? Well, as it turns out, some threads in buggy applications aren't always good at processing their messages, and messages they receive pile up in the queue. This means that by looking at the message queues on a system, we can get some information about its past state. To make this more concrete, let's look at the message queue for a thread belonging to a certain full-disk encryption vendor on one of the images in my collection:&lt;br /&gt;&lt;pre&gt;0:03:42.812,WM_WTSSESSION_CHANGE,WTS_CONSOLE_CONNECT&lt;br /&gt;0:03:42,WM_WTSSESSION_CHANGE,WTS_SESSION_LOGON&lt;br /&gt;1:45:05,WM_WTSSESSION_CHANGE,WTS_CONSOLE_DISCONNECT&lt;br /&gt;1:45:06,WM_WTSSESSION_CHANGE,WTS_REMOTE_CONNECT&lt;br /&gt;1:45:34,WM_WTSSESSION_CHANGE,WTS_REMOTE_DISCONNECT&lt;br /&gt;1:46:19,WM_WTSSESSION_CHANGE,WTS_CONSOLE_CONNECT&lt;br /&gt;2:28:50,WM_WTSSESSION_CHANGE,WTS_SESSION_LOCK&lt;br /&gt;18:18:07,WM_WTSSESSION_CHANGE,WTS_SESSION_UNLOCK&lt;br /&gt;22:05:51,WM_WTSSESSION_CHANGE,WTS_SESSION_LOCK&lt;br /&gt;22:23:47,WM_WTSSESSION_CHANGE,WTS_SESSION_UNLOCK&lt;br /&gt;23:32:34,WM_WTSSESSION_CHANGE,WTS_SESSION_LOCK&lt;br /&gt;23:34:22,WM_WTSSESSION_CHANGE,WTS_SESSION_UNLOCK&lt;br /&gt;1 day,  0:07:54.468,WM_WTSSESSION_CHANGE,WTS_SESSION_LOCK&lt;br /&gt;[...]&lt;br /&gt;8 days, 0:18:13.046,WM_WTSSESSION_CHANGE,WTS_SESSION_UNLOCK&lt;br /&gt;8 days, 0:32:02.640,WM_WTSSESSION_CHANGE,WTS_SESSION_LOCK&lt;br /&gt;8 days, 0:36:01.500,WM_WTSSESSION_CHANGE,WTS_SESSION_UNLOCK&lt;/pre&gt;(I've omitted many of the details here to save space. Window messages also include things like the handle of the window the message is for and cursor position at the time the message was sent.)&lt;br /&gt;&lt;br /&gt;If we look up &lt;a href="http://msdn.microsoft.com/en-us/library/aa383828%28VS.85%29.aspx"&gt;WM_WTSSESSION_CHANGE on MSDN&lt;/a&gt;, we find that it's a message related to fast user switching; one of these is sent whenever someone logs in, locks the screen, or connects remotely (i.e. via remote desktop). The message is sent to all applications that have called &lt;a id="ctl00_rs1_mainContentContainer_ctl04" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl04',this);" href="http://msdn.microsoft.com/en-us/library/aa383841%28VS.85%29.aspx"&gt;WTSRegisterSessionNotification&lt;/a&gt;. However, in this case, despite the fact that the application asked to be notified of such changes, it didn't bother to process the messages it received! This means that we can now look through its queue and find out when the user logged in and out, when the screen was locked, and so on. (The times given are relative to the time the system was booted, and are only good up to 49.7 days–this is because the timestamp comes from the &lt;a href="http://msdn.microsoft.com/en-us/library/ms724408%28VS.85%29.aspx"&gt;GetTickCount&lt;/a&gt; function). It should be clear why such information might be useful in a forensic investigation.&lt;br /&gt;&lt;br /&gt;I want to stress that we simply got lucky in this case by finding such a wealth of information in the message queue. It would be unwise to rely on every system having a misbehaving application like the one in this example; on the NIST images, for example, and on my own (clean) test VMs, there were no messages found on the system at all–the applications involved had processed them, and so they were no longer queued. Still, on real-world systems, buggy applications may be more common, so this trick could come in handy.&lt;br /&gt;&lt;br /&gt;To look at the message queues in a memory dump, you can use a small plugin for Volatility that I've created. It enumerates all threads on the system and lists any messages it finds. It has an internal table mapping numeric IDs to names for a large number of standard window messages; however, it is very likely that the list is not complete. In addition, applications can define their own message types; in these cases, interpreting the message is impossible without analyzing the program. Caveats aside, I'm happy to offer &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/threadqueues.py"&gt;threadqueues.py&lt;/a&gt;. As usual, drop it into your "memory_plugins/" directory, and then run it with:&lt;br /&gt;&lt;pre&gt;$ python volatility thread_queues -f [IMAGE]&lt;/pre&gt;As with the &lt;a href="http://moyix.blogspot.com/2008/08/auditing-system-call-table.html"&gt;SSDT plugin&lt;/a&gt;, thread_queues requires my &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/lists.py"&gt;list-walking library&lt;/a&gt;, which should be placed in the "forensics/win32/" directory.&lt;br /&gt;&lt;br /&gt;If you want to know how the plugin works internally, read on!&lt;br /&gt;&lt;br /&gt;Each thread in Windows (represented by the _ETHREAD strucutre) has a field in its Thread Control Block (or Tcb, which is a _KTHREAD) called Win32Thread. This field points to a data structure, _W32THREAD, which is defined in the kernel-mode portion of the Windows graphical subsystem, win32k.sys. You can actually examine the _W32THREAD structure by issuing "dt win32k!_W32THREAD" in WinDbg; however, if you start reverse engineering win32k.sys, you'll quickly find that the information given there is far from complete. In fact, _W32THREAD is a much larger data structure, which includes information about the current desktop, keyboard layout, installed window hooks, and, most importantly for us, the input message queue. You can read more about the internals of win32k in &lt;a href="http://www.alex-ionescu.com/BH08-AlexIonescu.pdf"&gt;Alex Ionescu's BlackHat talk&lt;/a&gt; from this year; however, most of the details are still unknown, and the best way to find out about them is to reverse engineer win32k.sys.&lt;br /&gt;&lt;br /&gt;In my case, I found the answers I wanted in the PostMessage() function. To make a (very) long story short, PostMessage is defined as:&lt;br /&gt;&lt;br /&gt;PostMessage(PWND window, ulong msg, ulong wParam, ulong lParam)&lt;br /&gt;&lt;br /&gt;When called, it eventually allocates a new entry in the thread queue using AllocQEntry, places the message information into it with StoreQMessage (which also adds the timestamp and current cursor position), and finally tells the thread that it should wake up because there's a message pending (using SetWakeBit). In Windows XP SP2, the message queue is found at offset 0xD0 of _W32THREAD, and looks like:&lt;br /&gt;&lt;pre&gt;typedef struct _MSG_QUEUE {&lt;br /&gt;PMSG_QUEUE_ENTRY Head;&lt;br /&gt;PMSG_QUEUE_ENTRY Tail;&lt;br /&gt;unsigned long NumberOfMessages;&lt;br /&gt;} MSG_QUEUE;&lt;/pre&gt;Each queue entry, in turn, looks like:&lt;br /&gt;&lt;pre&gt;typedef struct _MSG_QUEUE_ENTRY {&lt;br /&gt;PMSG_QUEUE_ENTRY pNext;&lt;br /&gt;PMSG_QUEUE_ENTRY pPrev;&lt;br /&gt;struct _MSG {&lt;br /&gt; unsigned long hWnd;&lt;br /&gt; unsigned long ulMsg;&lt;br /&gt; unsigned long wParam;&lt;br /&gt; unsigned long lParam;&lt;br /&gt; unsigned long time; // In milliseconds&lt;br /&gt; POINT pt; // Mouse cursor position&lt;br /&gt; unsigned long dwUnknown;&lt;br /&gt; unsigned long dwExtraInfo;&lt;br /&gt; } Msg;&lt;br /&gt;} MSG_QUEUE_ENTRY, * PMSG_QUEUE_ENTRY;&lt;/pre&gt;So for each thread, we can just start at the head of the queue, and keep following pNext until we get to the end, at which point pNext will be NULL.&lt;br /&gt;&lt;br /&gt;One quick note of warning, though: when you're exploring these structures, you may initially think that all of the information is paged out, because none of the memory addresses seem valid. As it turns out, although Win32Thread and its friends all live in kernel space, this portion of kernel space is not visible from all threads. This flies in the face of a very common assumption in Windows memory analysis–that the kernel portion of memory looks the same to every process. In fact, the portions related to the GUI subsystem are only visible from processes that have at least one GUI thread! So, in particular, the System process, which is what's most commonly used in Volatility to access kernel memory, can't see any of the structures we're interested in. In my plugin, I make sure to use the address space of the process that owns the threads we're examining, so that the GUI structures will be accessible if the thread is a GUI thread.&lt;br /&gt;&lt;br /&gt;There's a lot more cool stuff you can do once you start digging into the kernel mode portion of the Windows graphics system.  In a future post, I'll describe how we can enumerate all the windows on the system, and list their titles and position, and (if I can figure out how) possibly even how to extract a screenshot at the time the memory was captured. Though this last bit doesn't have much forensic value, it would be pretty slick to be able to see exactly what was on the desktop for public images like the &lt;a href="http://www.dfrws.org/2005/challenge/"&gt;DFRWS challenge images&lt;/a&gt; or the &lt;a href="http://www.cfreds.nist.gov/mem/Basic_Memory_Images.html"&gt;NIST reference images&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-3253436235205227398?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/3253436235205227398/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=3253436235205227398" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/3253436235205227398?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/3253436235205227398?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/09/window-messages-as-forensic-resource.html" title="Window Messages as a Forensic Resource" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;Dk4DRX46eip7ImA9WxdaE08.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-861772931249788275</id><published>2008-08-20T17:48:00.009-05:00</published><updated>2008-08-21T08:22:54.012-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-21T08:22:54.012-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rootkits" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="system calls" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="ssdt" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="hooking" /><title>Auditing the System Call Table</title><content type="html">When malicious, kernel-level code is installed on the system, one action it may take is to &lt;span style="font-style: italic;"&gt;hook&lt;/span&gt; various system services. What this means is that it takes some standard piece of operating system functionality and replaces it with its own code, allowing it to alter the way all other programs use the OS. For example, it may hook functions involved in opening registry keys, and modify their output so as to hide registry keys the rootkit uses. As system calls are the primary interface between user and kernel mode, the system call table is a popular place to do such hooking.&lt;br /&gt;&lt;br /&gt;It's worth noting that many security products also make heavy use of hooking. One common example is antivirus software; among the many functions it hooks is NtCreateProcess (used, as the name suggests, to start a new process) so that it can do its on-demand scanning of any newly launched programs. For this reason, it's not safe to assume that any hooking of system calls is malicious; in fact, some of the most suspicious-looking things initially often turn out to be security software.&lt;br /&gt;&lt;br /&gt;Still, it may be quite useful to be able to examine the system call table of a memory image during an investigation, in order to detect any hooks that shouldn't be there. To do this, we'll first look at how system calls work in Windows and lay out the data structures that are involved. I'll then describe a Volatility plugin that examines each entry in the system call table, gives its symbolic name, and then tells what kernel module owns the function it points to. If you want to skip the learning experience and get straight to the plugin, you can &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/ssdt.py"&gt;download it here&lt;/a&gt; and place it in your memory_plugins directory. You'll also need to get my &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/lists.py"&gt;library for list walking&lt;/a&gt; and place it in "forensics/win32".&lt;br /&gt;&lt;br /&gt;If you look at any of the native API functions, like ZwCreateFile, you'll notice that they all look almost identical:&lt;br /&gt;&lt;pre&gt;lkd&gt; u nt!ZwCreateFile&lt;br /&gt;nt!ZwCreateFile:&lt;br /&gt;804fd724 b825000000      mov     eax,25h&lt;br /&gt;804fd729 8d542404        lea     edx,[esp+4]&lt;br /&gt;804fd72d 9c              pushfd&lt;br /&gt;804fd72e 6a08            push    8&lt;br /&gt;804fd730 e83cf10300      call    nt!KiSystemService (8053c871)&lt;br /&gt;804fd735 c22c00          ret     2Ch&lt;/pre&gt;We see that the function just places the value 0x25 into eax, points edx at the stack, and calls nt!KiSystemService. It turns out that this value, 0x25, is the system call number that corresponds to the CreateFile function.&lt;br /&gt;&lt;br /&gt;Without going into too much detail about how KiSystemService works, the function essentially takes the value in the eax register, and then looks up that entry in a global system call table. The table contains function pointers to the actual kernel-land functions that implement that system call.&lt;br /&gt;&lt;br /&gt;But, of course, the situation isn't quite as simple as that. In fact, Windows is designed to allow third party developers to add their own system calls. To support this, each &lt;span style="font-family:courier new;"&gt;_KTHREAD&lt;/span&gt; contains a member named &lt;span style="font-family:courier new;"&gt;ServiceTable&lt;/span&gt; which is a pointer to a data structure that looks like this:&lt;br /&gt;&lt;pre&gt;typedef struct _SERVICE_DESCRIPTOR_TABLE {&lt;br /&gt;SERVICE_DESCRIPTOR_ENTRY Descriptors[4];&lt;br /&gt;} SERVICE_DESCRIPTOR_TABLE;&lt;br /&gt;&lt;br /&gt;typedef struct _SERVICE_DESCRIPTOR_ENTRY {&lt;br /&gt;PVOID KiServiceTable;&lt;br /&gt;PULONG CounterBaseTable;&lt;br /&gt;LONG ServiceLimit;&lt;br /&gt;PUCHAR ArgumentTable;&lt;br /&gt;} SERVICE_DESCRIPTOR_ENTRY;&lt;/pre&gt;As you can see, we can actually have up to four separate system service tables per thread! In practice, however, we only see the first two entries in this array filled in: the first one points to nt!KiServiceTable, which contains the functions that deal with standard OS functionality, and the second points to win32k!W32pServiceTable, which contains the functions for the GDI subsystem (managing windows, basic graphics functions, and so on). For system call numbers up to 0x1000, the first table is used, while for the range 0x1000-0x2000 the second table is consulted (this may generalize for 0x2000-0x3000 and 0x3000-0x4000, but I haven't tested it).&lt;br /&gt;&lt;br /&gt;To take a look at the contents of these two tables, we can use the &lt;span style="font-family:courier new;"&gt;dps&lt;/span&gt; command in WinDbg, which takes a memory address and then attempts to look up the symbolic name of each DWORD starting at that address. To examine the full table, you should pass &lt;span style="font-family:courier new;"&gt;dps&lt;/span&gt; the number of DWORDS you want to examine -- the exact number will be the value found in the &lt;span style="font-family:courier new;"&gt;ServiceLimit&lt;/span&gt; member for the table you're interested in. For example:&lt;br /&gt;&lt;pre&gt;lkd&gt; dps nt!KiServiceTable L11c&lt;br /&gt;805011fc  80598746 nt!NtAcceptConnectPort&lt;br /&gt;80501200  805e5914 nt!NtAccessCheck&lt;br /&gt;80501204  805e915a nt!NtAccessCheckAndAuditAlarm&lt;br /&gt;80501208  805e5946 nt!NtAccessCheckByType&lt;br /&gt;[...]&lt;br /&gt;8050128c  8060be48 nt!NtCreateEventPair&lt;br /&gt;80501290  8056d3ca nt!NtCreateFile&lt;br /&gt;80501294  8056bc5c nt!NtCreateIoCompletion&lt;br /&gt;[...]&lt;/pre&gt;Note that NtCreateFile is the 0x25th entry in the table, as we expected. On a system with no hooks installed, all functions in nt!KiServiceTable will point into the kernel (ntoskrnl.exe), and all functions in win32k!W32pServiceTable will be be inside win32k.sys. If they don't, it means the function has been hooked.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/ssdt.py"&gt;plugin for Volatility&lt;/a&gt;, then, works as follows. First, we go over each thread in each process, and gather up all distinct pointers to service tables. We examine all of them in case one thread has had its &lt;span style="font-family:courier new;"&gt;ServiceTable&lt;/span&gt; changed while the others remain untouched. Then we display each entry in each (unique) table, along with the name it usually has (in an unhooked installation), and what driver the function belongs to. Here's some sample output:&lt;br /&gt;&lt;pre&gt;$ python volatility ssdt -f xp-laptop-2005-07-04-1430.img&lt;br /&gt;Gathering all referenced SSDTs from KTHREADs...&lt;br /&gt;Finding appropriate address space for tables...&lt;br /&gt;SSDT[0] at 804e26a8 with 284 entries&lt;br /&gt;Entry 0x0000: 0x805862de (NtAcceptConnectPort) owned by ntoskrnl.exe&lt;br /&gt;Entry 0x0001: 0x8056fded (NtAccessCheck) owned by ntoskrnl.exe&lt;br /&gt;Entry 0x0002: 0x8058945b (NtAccessCheckAndAuditAlarm) owned by ntoskrnl.exe&lt;br /&gt;[...]&lt;br /&gt;Entry 0x0035: 0xf87436f0 (NtCreateThread) owned by wpsdrvnt.sys&lt;br /&gt;[...]&lt;br /&gt;SSDT[1] at bf997780 with 667 entries&lt;br /&gt;Entry 0x1000: 0xbf93517d (NtGdiAbortDoc) owned by win32k.sys&lt;br /&gt;Entry 0x1001: 0xbf946c1f (NtGdiAbortPath) owned by win32k.sys&lt;br /&gt;[...]&lt;/pre&gt;Here we can see that the NtCreateThread function has been hooked by wpsdrvnt.sys. A little Googling shows that this driver is a part of Sygate Personal Firewall -- as mentioned before, security products are the most common non-malicious software that hooks kernel functions.&lt;br /&gt;&lt;br /&gt;In closing, I should mention one caveat to using this tool: at the moment, the names of the system calls are hardcoded with the values derived from WinDbg on Windows XP SP2.  As demonstrated by the &lt;a href="http://metasploit.com/users/opcode/syscalls.html"&gt;Metasploit System Call Table&lt;/a&gt; page, the order and number of entries in the system call table change between different versions of Windows, so make sure that you only analyze SP2 images with this plugin! As always, patches are welcome if you want to adapt this to deal with other versions of Windows.&lt;br /&gt;&lt;br /&gt;Now go forth, and catch those rootkits!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-861772931249788275?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/861772931249788275/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=861772931249788275" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/861772931249788275?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/861772931249788275?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/08/auditing-system-call-table.html" title="Auditing the System Call Table" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;DU8MRnYycCp7ImA9WxVVEU0.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-4340737074760731452</id><published>2008-08-17T16:48:00.004-05:00</published><updated>2009-03-03T14:18:07.898-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-03T14:18:07.898-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="volshell" /><title>Introducing Volshell</title><content type="html">This one's for all the command line lovers out there: I'm happy to release &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volshell.py"&gt;volshell&lt;/a&gt;, an interactive shell built on &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; and designed with memory analysis research in mind. I gave a demo of this at my &lt;a href="https://www.volatilesystems.com/default/omfw"&gt;OMFW&lt;/a&gt; talk, "Interactive Memory Exploration with Volatility"; since it was more of a live demo, I don't have slides from that, but you can find &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/omfw-notes.txt"&gt;my notes here&lt;/a&gt;. You should be able to follow the notes as a sort of walkthrough that will get you up and running with volshell, and introduce some of the more advanced features.&lt;br /&gt;&lt;br /&gt;Briefly, here are some of the features of volshell:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Shell is a full Python interpreter, so all the power of Python can be leveraged.&lt;/li&gt;&lt;li&gt;Uses Volatility 1.3 object model for easy access to data structures in memory.&lt;/li&gt;&lt;li&gt;Can use &lt;a href="http://ipython.scipy.org/moin/"&gt;iPython&lt;/a&gt; for the underlying shell if available, which enables some nice features.&lt;/li&gt;&lt;li&gt;Commands modelled after WinDbg.&lt;/li&gt;&lt;li&gt;Works with any memory image format that Volatility supports (dd, crash, vmem, hibernation file)&lt;/li&gt;&lt;/ul&gt;To use it, just &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/volshell.py"&gt;download volshell.py&lt;/a&gt; and drop it in your memory_plugins directory in Volatility 1.3. Then start the shell with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ python volatility volshell -f $IMAGE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-4340737074760731452?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/4340737074760731452/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=4340737074760731452" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/4340737074760731452?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/4340737074760731452?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/08/indroducing-volshell.html" title="Introducing Volshell" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;C0EERns_fSp7ImA9WxdbGU8.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-1541278694994857798</id><published>2008-08-16T17:20:00.000-05:00</published><updated>2008-08-16T16:20:07.545-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-16T16:20:07.545-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="token" /><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="process" /><category scheme="http://www.blogger.com/atom/ns#" term="SID" /><category scheme="http://www.blogger.com/atom/ns#" term="attribution" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="memory analysis" /><title>Linking Processes to Users</title><content type="html">In the course of an investigation, it may be critical to be able to link up a process that's running to a particular user account. Particularly in a multi-user environment such as Windows Terminal Server, this isn't always as easy as checking who was logged in at the time.&lt;br /&gt;&lt;br /&gt;Luckily, each process in Windows has an associated &lt;span style="font-style: italic;"&gt;token&lt;/span&gt;, a chunk of metadata that describes what&lt;span style="font-style: italic;"&gt;  &lt;/span&gt;Security Identifier (SID) owns the process and what privileges have been granted to it. As &lt;a href="http://blogs.msdn.com/larryosterman/archive/2004/09/01/224051.aspx"&gt;Larry Osterman explains&lt;/a&gt;, A SID is essentially a unique ID that is assigned to a user or group, and is broken into several parts: the &lt;span style="font-style: italic;"&gt;revision&lt;/span&gt; (currently always set to 1), the &lt;span style="font-style: italic;"&gt;identifier authority&lt;/span&gt; (describing what authority created the SID, and hence how to interpret the subauthoriries), and finally a list of &lt;span style="font-style: italic;"&gt;subauthorities&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In general, when users see SIDs (which they rarely do), they are in what's called the Security Descriptor Definition Language (SDDL) form. This is a string that looks like:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;S-1-5-21-1957994488-484763869-854245398-513&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;Here, "1" is the revision, "5" is the identifier authority, and the remaining portions are the subauthorities. The exact data structure for a SID is:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;typedef struct _SID {&lt;br /&gt;   BYTE  Revision;&lt;br /&gt;   BYTE  SubAuthorityCount;&lt;br /&gt;   SID_IDENTIFIER_AUTHORITY IdentifierAuthority;&lt;br /&gt;   DWORD SubAuthority[ANYSIZE_ARRAY];&lt;br /&gt;} SID, *PISID;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;The &lt;span style="font-family:courier new;"&gt;SID_IDENTIFIER_AUTHORITY&lt;/span&gt; here is actually an array of 6 characters. However, at the moment only the final character is used. Osterman's article enumerates all the possible identifier authorities; for our purposes we will be focusing on the NT authority, which is &lt;span style="font-family:courier new;"&gt;{0,0,0,0,0,5}&lt;/span&gt;. This is the authority which describes accounts managed by the NT security subsystem.&lt;br /&gt;&lt;br /&gt;So how can we get this information from a memory image? We start, as usual, by looking at the &lt;span style="font-family:courier new;"&gt;_EPROCESS&lt;/span&gt; structure. Inside it, we find the &lt;span style="font-style: italic;"&gt;Token&lt;/span&gt; member at offset &lt;span style="font-family:courier new;"&gt;0xc8&lt;span style="font-family:georgia;"&gt;. However, the member doesn't directly point to an object of type &lt;span style="font-family:courier new;"&gt;_TOKEN&lt;/span&gt;, as we might expect. Instead, it is described as an &lt;span style="font-family:courier new;"&gt;_EX_FAST_REF&lt;/span&gt;. These types of objects are basically an optimization used by Windows to store both a pointer to and object and the object's reference &lt;/span&gt;&lt;/span&gt;count, all in a single DWORD. In an _EX_FAST_REF, the last 3 bits are co-opted to encode the reference count of the object. To get the actual pointer, you can mask off the last 3 bits, like so:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;token_address = proc.Token.Value &amp;amp; ~0x7&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;Now, on to the token itself. Each token contains a list of user and group SIDs. The relevant members of the &lt;span style="font-family:courier new;"&gt;_TOKEN&lt;/span&gt; structure (for our immediate purpose) are &lt;span style="font-family:courier new;"&gt;UserAndGroupCount&lt;/span&gt; (unsigned long) and &lt;span style="font-family:courier new;"&gt;UserAndGroups&lt;/span&gt; (pointer to array of &lt;span style="font-family:courier new;"&gt;_SID_AND_ATTRIBUTES&lt;/span&gt;), at offsets 0x4c and 0x68, respectively. _SID_AND_ATTRIBUES, in turn, contains a pointer to the SID itself and a DWORD of flags giving the SID's attributes (the meaning of which are dependent on the type of SID; for group SIDs, the flags can be found in &lt;span style="font-family:courier new;"&gt;winnt.h&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;Unfortunately, just having the SIDs by themselves may not be so meaningful to you. Actual account names would be better; luckily, these can be found by looking in the registry. The key &lt;span style="font-family:courier new;"&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList&lt;/span&gt; contains all the local user account SIDs on the machine, along with the location of their profile on disk. The username can usually be inferred from this; e.g. a profile directory of &lt;span style="font-family:courier new;"&gt;%SystemDrive%\Documents and Settings\Bob&lt;/span&gt; would imply that the username is Bob.&lt;br /&gt;&lt;br /&gt;Aside from the individual account SIDs, there are also a number of well-known group SIDs. These are SIDs that Microsoft has set aside for specific purposes, and will be the same on any Windows machine. A full list is available in KB&lt;/span&gt;&lt;/span&gt;243330, "&lt;span style="font-size:100%;"&gt;Well-known security identifiers in Windows operating systems".&lt;br /&gt;&lt;br /&gt;As a reward for sitting through all that dry description, here's a nice juicy tool that you can use to get started looking at the SIDs associated with a process in a memory image, written as a plugin for the just-released Volatility 1.3. You can download &lt;a href="http://kurtz.cs.wesleyan.edu/%7Ebdolangavitt/memory/getsids.py"&gt;getsids.py here&lt;/a&gt;. To use it, just drop it in your plugins directory (memory_plugins) and run:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;$ python volatility getsids -f xp-laptop-2005-07-04-1430.img&lt;br /&gt;[...]&lt;br /&gt;dd.exe (3300): S-1-5-21-1957994488-484763869-854245398-1006&lt;br /&gt;dd.exe (3300): S-1-5-21-1957994488-484763869-854245398-513 (Domain Users)&lt;br /&gt;dd.exe (3300): S-1-1-0 (Everyone)&lt;br /&gt;dd.exe (3300): S-1-5-32-544 (Administrators)&lt;br /&gt;dd.exe (3300): S-1-5-32-545 (Users)&lt;br /&gt;dd.exe (3300): S-1-5-4 (Interactive)&lt;br /&gt;dd.exe (3300): S-1-5-11 (Authenticated Users)&lt;br /&gt;dd.exe (3300): S-1-5-5-0-49673 (Logon Session)&lt;br /&gt;dd.exe (3300): S-1-2-0 (Users with the ability to log in locally)&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-1541278694994857798?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/1541278694994857798/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=1541278694994857798" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/1541278694994857798?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/1541278694994857798?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/08/linking-processes-to-users.html" title="Linking Processes to Users" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C0YAQHgzeCp7ImA9WxdbGU8.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-2957824351339288379</id><published>2008-08-16T15:50:00.002-05:00</published><updated>2008-08-16T16:12:21.680-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-16T16:12:21.680-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="object model" /><category scheme="http://www.blogger.com/atom/ns#" term="release" /><title>Volatility 1.3 is out!</title><content type="html">After tons of hard work by a lot of people (including me), Volatility 1.3 has been released to the world at large. AAron has a &lt;a href="http://volatilesystems.blogspot.com/2008/08/volatility-13-advanced-memory-forensics.html"&gt;blog post&lt;/a&gt; up with all the juicy details, including a list of new features. For my part, I want to take this opportunity focus on a couple new things that I think are really cool. They're mostly developer-focused, so if you have no interest in adding new capabilities to Volatility, you can skip the rest of this entry and just head over to AAron's post to see all the new modules and functionality.&lt;br /&gt;&lt;br /&gt;The first feature I want to point out is the new plugin system. Basically, rather than creating a new module and then editing vmodules.py to add new commands to Volatility, you can now just create a class extending &lt;span style="font-family: courier new;"&gt;forensics.commands.command&lt;/span&gt; with the code you want to run, drop it into a file, and put that file into the memory_plugins directory, and Volatility will pick it up and see it as a new command that can be run. This means that anyone can just give out a single file and allow anyone to use it in Volatility with minimal effort.&lt;br /&gt;&lt;br /&gt;In addition, it removes the need to manually integrate new modules from contributors into the source tree; instead, plugins can be developed and distributed independently, without relying on the Volatility devs at all. I'm hoping that this capability will allow a cool little cottage industry of plugin development to form around Volatility, in much the same way that users of EnCase currently trade EnScripts.&lt;br /&gt;&lt;br /&gt;Second, I want to describe the new object model. Volatility 1.3 contains a new way of working with data structures in memory dumps. Each data structure found in &lt;span style="font-family: courier new;"&gt;vtypes.py&lt;/span&gt; can now be instantiated at a given memory address as a full-fledged Python object, and the data inside it can be accessed using standard Python syntax. No need to use &lt;span style="font-family: courier new;"&gt;read_obj&lt;/span&gt; again! For example, to print the size of a process located at address 0x823c87c0, we can do:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;eprocess = Object('_EPROCESS', 0x823c87c0,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                  addr_space, None, profile=Profile())&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;print eprocess.VirtualSize&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In addition, each structure can be given object-specific behaviors by subclassing the main &lt;span style="font-family: courier new;"&gt;Object&lt;/span&gt; class. For example, the &lt;span style="font-family: courier new;"&gt;_UNICODE_STRING&lt;/span&gt; type's &lt;span style="font-family: courier new;"&gt;Buffer&lt;/span&gt; member is a pointer to an unsigned short. By creating a specific &lt;span style="font-family: courier new;"&gt;_UNICODE_STRING&lt;/span&gt; class (as is done in &lt;span style="font-family: courier new;"&gt;memory_objects/Windows/xp_sp2.py&lt;/span&gt;), we can cause the &lt;span style="font-family: courier new;"&gt;Buffer&lt;/span&gt; member to be returned to the user as a Python string with the correct string data, automatically translated from Unicode.&lt;br /&gt;&lt;br /&gt;Hopefully, with these new features, developing cool stuff for Volatility will be easier than ever. I know that for myself, I've found that it's now orders of magnitude faster to go from "Wouldn't it be neat if ..." to a full, working plugin. In the coming weeks, I'll be writing some posts introducing the new development features in more depth, so that as many people as possible can get involved. Remember, the power of Volatility is in its community!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-2957824351339288379?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/2957824351339288379/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=2957824351339288379" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/2957824351339288379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/2957824351339288379?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/08/volatility-13-is-out.html" title="Volatility 1.3 is out!" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;Ak8CR3c6eyp7ImA9WxdbGE4.&quot;"><id>tag:blogger.com,1999:blog-6787362638788314904.post-6498335652646001147</id><published>2008-08-15T16:30:00.008-05:00</published><updated>2008-08-15T17:21:06.913-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-15T17:21:06.913-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Georgia Tech" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatility" /><category scheme="http://www.blogger.com/atom/ns#" term="moving" /><category scheme="http://www.blogger.com/atom/ns#" term="GTISC" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="pyflag" /><title>Sorry for the Hiatus!</title><content type="html">&lt;p&gt;It's been quite a while since I wrote any new blog posts. This isn't entirely because I've been lazy; rather, I've picked up and relocated to sunny (and often hot and humid) Atlanta, Georgia to start the PhD program at &lt;a href="http://www.gatech.edu/"&gt;Georgia Tech&lt;/a&gt;. I'm going to be working on lots of cool stuff with the &lt;a href="http://www.gtisc.gatech.edu/"&gt;Georgia Tech Information Security Center&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now that I'm here and starting to get settled in, you can expect the blog posts to start up again. Particularly with the forthcoming release of Volatility 1.3, I'm going to have a lot of new plugins and functionality to blog about.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As a teaser, here are some of the things I've got in the works:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;getsids.py&lt;/span&gt; -- get the SID (kind of like a user ID in unix) that owns each process&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;moddump.py&lt;/span&gt; -- extract loaded kernel modules from memory&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;unloaded_modules.py&lt;/span&gt; -- list recently unloaded kernel modules&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;ssdt.py&lt;/span&gt; -- show the System Service Descriptor Table, along with the kernel module that owns the memory. This can be used to detect hooking, legitimate and otherwise.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;volshell.py&lt;/span&gt; -- an interactive shell designed for exploration of memory images (presented at &lt;a href="https://www.volatilesystems.com/default/omfw"&gt;OMFW&lt;/a&gt;; note that this is aimed mainly at memory forensics researchers)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight:bold;"&gt;windowlist.py&lt;/span&gt; -- extracts a list of window handles and titles by using some reverse-engineered GDI structures in the kernel&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I'm planning on accompanying these with posts describing the technical details of how they work. Also, as soon as I get the code ported to 1.3, I'll be releasing the code I wrote to extract registry information (as presented in &lt;a href="http://dfrws.org/2008/proceedings/p26-dolan-gavitt.pdf"&gt;my DFRWS paper&lt;/a&gt;).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I also spoke with Michael Cohen, the creator of &lt;a href="http://www.pyflag.net/cgi-bin/moin.cgi"&gt;PyFlag&lt;/a&gt; at &lt;a href="http://dfrws.org/2008/"&gt;DFRWS&lt;/a&gt;, and it sounds like he's interested in integrating in-memory registry support into PyFlag through Volatility. This will let users access the  registry data in a memory dump through the PyFlag VFS, and perform queries and correlation on the registry data. This will be, I believe, "wicked awesome" (technical term).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Hopefully this has given you a taste of things to come, and gotten you good and excited about 1.3 (the amazing features of which I'll also be writing about soon). Stay tuned!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787362638788314904-6498335652646001147?l=moyix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://moyix.blogspot.com/feeds/6498335652646001147/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6787362638788314904&amp;postID=6498335652646001147" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/6498335652646001147?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787362638788314904/posts/default/6498335652646001147?v=2" /><link rel="alternate" type="text/html" href="http://moyix.blogspot.com/2008/08/sorry-for-hiatus.html" title="Sorry for the Hiatus!" /><author><name>moyix</name><uri>http://www.blogger.com/profile/17143824408632888880</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry></feed>

