<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by martin korman on Medium]]></title>
        <description><![CDATA[Stories by martin korman on Medium]]></description>
        <link>https://medium.com/@MartinKorman?source=rss-5668a2be172d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4vhh9N3N7_GPz9yGouGhzw.jpeg</url>
            <title>Stories by martin korman on Medium</title>
            <link>https://medium.com/@MartinKorman?source=rss-5668a2be172d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:13:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@MartinKorman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[regipy-rs: Parsing a SOFTWARE Hive in 0.3 Seconds Instead of 12 Minutes]]></title>
            <link>https://medium.com/dfir-dudes/regipy-rs-parsing-a-software-hive-in-0-3-seconds-instead-of-12-minutes-13e8453fa10b?source=rss-5668a2be172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/13e8453fa10b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[windows-forensics]]></category>
            <category><![CDATA[computer-forensics]]></category>
            <dc:creator><![CDATA[martin korman]]></dc:creator>
            <pubDate>Sat, 18 Jul 2026 14:36:53 GMT</pubDate>
            <atom:updated>2026-07-18T14:52:13.885Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Porting regipy’s core to Rust and proving, byte for byte, that nothing else changed.</em></strong></p><p><a href="https://medium.com/dfir-dudes/regipy-automating-registry-forensics-with-python-b170a1e2b474">Seven</a> years ago I started writing Regipy because I wanted a registry parser that worked the way investigators work. Somewhere along the road, one item settled onto the wishlist and refused to leave: port the core parser to Rust. Every time a SOFTWARE hive took lots of time to dump, I thought about it. Last week I finally did it.</p><p>The headline number first. A full traversal of a real-world SOFTWARE hive: 117,488 keys, every value decoded went from 12 minutes and 25 seconds to 0.29 seconds. That’s the exact workload `regipy-dump` and every triage pipeline built on regipy runs all day.</p><p>But speed was never the hard part of this project. If you work in DFIR, you already know the question that matters more: is the fast parser still telling me the truth? A registry parser that’s a thousand times faster but occasionally decodes a value differently isn’t an upgrade. So most of the work and most of this post is about proving that the output didn’t change. Not promising. Proving.</p><p>`regipy-rs` is an opt-in backend, published as a separate alpha package. The pure-Python parser remains the default, untouched:</p><pre>pip install regipy[rust]</pre><pre>from regipy.registry_rs import RegistryHive # instead of regipy.registry<br>reg = RegistryHive(&#39;/evidence/SOFTWARE&#39;)<br>key = reg.get_key(r&#39;\Microsoft\Windows\CurrentVersion\Run&#39;)<br>for value in key.iter_values(as_json=True):<br>print(value.name, value.value)</pre><p>Same API, same `Value` and `Subkey` dataclasses, same exceptions. Every regipy plugin: all 75+ of them , runs unchanged on either backend. If you’ve built tooling on regipy, adopting this is a one-line import change.</p><p>The numbers, from the benchmark report committed to the repo (full traversal with values, best of 3):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*ryHGdEQ8pd8cgUCKwZIG0g.png" /></figure><p>Why so dramatic? `cProfile` tells the story in two lines. Traversing a UsrClass.dat hive costs the Python backend 2.54 million function calls: struct parsing, stream reads, per-value decoding. The Rust backend does the same traversal in about 25 thousand calls, and the profile shows the parser has simply vanished. What’s left is the cost of handing you the results.</p><pre># Python backend cProfile:<br>         2540885 function calls (2450810 primitive calls) in 1.623 seconds<br>   Ordered by: cumulative time<br>   List reduced from 121 to 10 due to restriction &lt;10&gt;<br>   ncalls  tottime  percall  cumtime  percall filename:lineno(function)<br>        2    0.001    0.001    1.643    0.822 {built-in method builtins.sum}<br>     6206    0.004    0.000    1.642    0.000 benchmark.py:51(&lt;genexpr&gt;)<br>45543/6206    0.042    0.000    1.638    0.000 registry.py:164(recurse_subkeys)<br>     4396    0.011    0.000    1.274    0.000 registry.py:210(&lt;listcomp&gt;)<br>    16765    0.123    0.000    0.999    0.000 registry.py:481(iter_values)<br>    12369    0.046    0.000    0.531    0.000 registry.py:441(read_value)<br>   284770    0.490    0.000    0.490    0.000 {method &#39;read&#39; of &#39;_io.BytesIO&#39; objects}<br>    43635    0.049    0.000    0.443    0.000 core.py:290(parse_stream)<br>44555/43635    0.019    0.000    0.364    0.000 core.py:311(_parsereport)<br>    21625    0.009    0.000    0.300    0.000 core.py:786(_parse)</pre><pre># Rust backend cProfile:<br>         24835 function calls in 0.024 seconds<br>   Ordered by: cumulative time<br>   List reduced from 14 to 10 due to restriction &lt;10&gt;<br>   ncalls  tottime  percall  cumtime  percall filename:lineno(function)<br>        1    0.001    0.001    0.023    0.023 {built-in method builtins.sum}<br>     6206    0.002    0.000    0.023    0.000 benchmark.py:51(&lt;genexpr&gt;)<br>     6206    0.017    0.000    0.021    0.000 registry_rs.py:202(recurse_subkeys)<br>     6205    0.003    0.000    0.003    0.000 registry_rs.py:234(&lt;listcomp&gt;)<br>     6205    0.001    0.000    0.001    0.000 &lt;string&gt;:2(__init__)<br>        1    0.000    0.000    0.000    0.000 registry_rs.py:166(__init__)<br>        1    0.000    0.000    0.000    0.000 {method &#39;recurse&#39; of &#39;regipy_rs.RegistryHive&#39; objects}<br>        1    0.000    0.000    0.000    0.000 utils.py:156(identify_hive_type)<br>        1    0.000    0.000    0.000    0.000 {method &#39;root&#39; of &#39;regipy_rs.RegistryHive&#39; objects}<br>        4    0.000    0.000    0.000    0.000 {method &#39;endswith&#39; of &#39;str&#39; objects}</pre><p>I didn’t want parity to be a sentence in the PR. I wanted it to be a test suite that would alert me loudly if I got anything wrong. It ended up with four layers.</p><p><strong>Full traversal comparison:</strong> Both backends walk every test hive in regipy’s corpus, and every key path, timestamp, value name, value type and value content must match, including iteration order. Corrupted hives too: both backends must yield the same partial output before failing the same way.</p><p><strong>Plugin-level parity:</strong> Every validated plugin runs end-to-end on both backends and must produce identical results. This is the layer your casework actually consumes, so it gets tested directly.</p><p><strong>A 60,000-sample timestamp fuzz:</strong> Windows FILETIME conversion involves a float division and Python’s round-half-even microsecond rounding, and the Rust port replicates that arithmetic bit for bit. The fuzz test earned its keep on day one: it caught a double-rounding bug in my first implementation that was off by a single microsecond on certain timestamps. I noticed it only because the test existed. That’s the point of the test.</p><p><strong>“Notarized” digests:</strong> The benchmark computes a SHA-256 over the canonicalized traversal output of each hive, roughly 201,000 keys and 392,000 values from each backend, and publishes the digests side by side. Anyone can recompute them with one command. If a single byte diverged, the hashes would say so.</p><p>There are a few intentional divergences: exception types on some corrupted-hive paths, and a cycle guard where Python would hit its recursion limit. They’re documented in the report, and none of them affect parsed output. I’d rather list them myself than have you find them.</p><p><strong>The part I didn’t expect: the old parser was wrong (a little)</strong></p><p>Here’s my favorite finding of the whole project. When you build a byte-exact comparison between two parsers, every historical quirk becomes a loud test failure. Those failures turned out to be bugs in the Python parser that had been shipping for years:</p><p><strong>The `NUMBER_OF_PROCESSORS: 49` bug:</strong> Small registry values, four bytes or less are stored inline, inside the VK record’s offset field. regipy returned that field as a raw integer instead of decoding it. So `NUMBER_OF_PROCESSORS` on a SYSTEM hive came back as `49`.</p><p>Why 49? Because the real value is the string `”1&quot;`, and 49 is the ASCII code for `’1&#39;`. Every inline `REG_SZ` in every hive regipy ever parsed had this problem. One plugin had even quietly grown an `isinstance(value, int)` workaround around it, which should have told me something sooner.</p><p><strong>Garbage multi-strings:</strong> `REG_MULTI_SZ` values larger than 16 KB are stored in “big data” segments. regipy never reassembled them, it decoded the raw segment-pointer record as UTF-16 and returned noise. The WBEM `Autorecover MOFs` value on a SOFTWARE hive now correctly returns its 277 MOF paths.</p><p>All were fixed in the Python parser as well, which meant also fixing regipy’s own test expectations, some of which had the buggy values baked in as “expected.”</p><p><strong>Try it!</strong></p><p>regipy-rs is alpha. The parity evidence is strong, but it’s new code, and hives from the wild have infinite edge cases. The pure-Python parser stays the default until the Rust backend has real mileage on it.</p><pre>pip install regipy[rust]<br><br># Confirm installation:<br>python -c &quot;import regipy_rs; print(regipy_rs.__version__, regipy_rs.__file__)&quot;<br><br># Excpect: 0.1.0a1 <br><br># Copy the SOFTWARE hive from tests:<br>cp regipy_tests/data/SOFTWARE.xz /tmp/<br>unxz /tmp/SOFTWARE.xz<br><br># Iterate over the hive with the new library:<br>time python - &lt;&lt;&#39;EOF&#39;<br>from regipy.registry_rs import RegistryHive<br>reg = RegistryHive(&quot;/tmp/SOFTWARE&quot;)<br>print(reg.hive_type, [x for x in reg.recurse_subkeys(fetch_values=True)], &quot;keys&quot;)<br>EOF</pre><p>Example time output on my laptop:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*Y6EFeHUaWubzNoCN416NYg.png" /></figure><p>Everything in this post is reproducible from the repo: the benchmark report, the profiles, and the parity digests regenerate with a single command (`python regipy-rs/benchmark.py`). Run it on your own evidence sets.</p><p><a href="https://pypi.org/project/regipy-rs/">https://pypi.org/project/regipy-rs/</a></p><p><a href="https://github.com/mkorman90/regipy">GitHub - mkorman90/regipy: Regipy is an os independent python library for parsing offline registry hives</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13e8453fa10b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dfir-dudes/regipy-rs-parsing-a-software-hive-in-0-3-seconds-instead-of-12-minutes-13e8453fa10b">regipy-rs: Parsing a SOFTWARE Hive in 0.3 Seconds Instead of 12 Minutes</a> was originally published in <a href="https://medium.com/dfir-dudes">DFIR Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regipy MCP: Natural Language Registry Forensics with Claude]]></title>
            <link>https://medium.com/dfir-dudes/regipy-mcp-natural-language-registry-forensics-with-claude-984d378784d6?source=rss-5668a2be172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/984d378784d6</guid>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[windows-registry]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[martin korman]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 19:58:08 GMT</pubDate>
            <atom:updated>2026-01-04T19:58:08.732Z</atom:updated>
            <content:encoded><![CDATA[<p>Six years ago, I wrote a <a href="https://medium.com/dfir-dudes/regipy-automating-registry-forensics-with-python-b170a1e2b474">blog post</a> introducing <a href="https://github.com/mkorman90/regipy">regipy</a>, a Python library I built because I was frustrated with existing registry forensic tools. I needed a tool that could parse registry hives at scale, apply transaction logs automatically, and had an intuitive plugin system that would encourage contribution. The DFIR community adopted it, contributors added plugins, and regipy grew to support 75+ forensic artifacts across all major Windows registry hives.</p><p>But reflecting on my years of incident response work, I noticed a recurring friction point. Even with all those plugins available, investigators (including myself) still need to:</p><ul><li>Remember which plugin extracts which artifact, and this might vary between operation system versions</li><li>Know the exact command-line syntax for the tool</li><li>Mentally map forensic questions to technical tool invocations</li><li>Run multiple plugins and correlate the results manually or in some analytics tool like Pandas or Google sheets</li></ul><p>I found myself thinking: I just want to ask<em> “What persistence mechanisms exist on this machine?” </em>and get an answer.</p><p>With LLMs becoming capable enough to reason about forensic workflows, I decided to build exactly that.</p><p><strong>Leveraging Model Context Protocol</strong></p><p>Anthropic released the <a href="https://modelcontextprotocol.io/">Model Context Protocol</a> (MCP), a standard for connecting AI assistants like Claude to external tools and data sources. It clicked immediately: I could expose regipy’s entire plugin ecosystem to Claude and let it figure out which plugins to run based on natural language questions.</p><p><strong>Regipy MCP server</strong> bridges between Claude Desktop and regipy enabling conversational forensic analysis of Windows registry hives.</p><p><strong>What I Wanted</strong></p><p>Before building this, I outlined my requirements (just like I did six years ago):</p><ul><li><strong>Ask forensic questions in plain English: </strong>“What’s the hostname?”, not `registry-run-plugins -plugins computer_name`</li><li><strong>Automatic hive detection:</strong> Point at a directory of collected registry files and have it figure out which is SYSTEM, which is SOFTWARE, etc</li><li><strong>Leverage existing plugins: </strong>All 75+ regipy plugins should just work, no rewrites and no need to update the prompt when introducing new plugins</li><li><strong>Smart plugin selection:</strong> Ask about persistence, and it should know to run both `software_plugin` and `ntuser_persistence`</li><li><strong>Easy setup:</strong> Configure Claude Desktop → point at evidence → start investigating</li></ul><p><strong>Introducing </strong><a href="https://github.com/mkorman90/regipy/tree/master/regipy_mcp_server"><strong>regipy-mcp</strong></a><strong>:</strong></p><p>The MCP server exposes seven tools that Claude can use during a conversation:</p><ul><li><strong>list_available_hives</strong> — Show all detected registry hives by type</li><li><strong>list_available_plugins</strong> — Display all plugins with hive compatibility</li><li><strong>run_plugin</strong> — Execute a specific plugin by name</li><li><strong>run_all_plugins_for_hive</strong> — Run every compatible plugin for a hive type</li><li><strong>answer_forensic_question</strong> — Natural language → plugin mapping</li><li><strong>get_registry_key</strong> — Direct access to any registry key path</li><li><strong>set_hive_directory</strong> — Load hives from a new directory at runtime, this is in order to work in subdirectories grouping artifacts per machine.</li></ul><p>The magic is in answer_forensic_question. It maps common forensic queries to the right combination of plugins. For example:</p><ul><li>“What is the hostname?” → runs <a href="https://github.com/mkorman90/regipy/blob/master/regipy/plugins/system/computer_name.py">computer_name</a></li><li>“What is the time zone?” → runs <a href="https://github.com/mkorman90/regipy/blob/master/regipy/plugins/system/timezone_data.py">timezone_data</a></li><li>“What are the persistence mechanisms?” → runs <a href="https://github.com/mkorman90/regipy/blob/master/regipy/plugins/software/persistence.py">software_persistence</a>, <a href="https://github.com/mkorman90/regipy/blob/master/regipy/plugins/ntuser/persistence.py">ntuser_persistence</a></li><li>“What USB devices were connected?” → runs <a href="https://github.com/mkorman90/regipy/blob/d50d636832ab82fc6aae815e1d0f76ec15fe025f/regipy/plugins/system/usbstor.py#L21">usbstor_plugin</a>, <a href="https://github.com/mkorman90/regipy/blob/d50d636832ab82fc6aae815e1d0f76ec15fe025f/regipy/plugins/system/usb_devices.py#L26">usb_devices</a></li><li>“What programs are installed?” → runs installed_programs_software, installed_programs_ntuser</li><li>“Show me user activity” → runs typed_urls, recent_docs, user_assist</li><li>“What services are configured?” → runs services</li><li>“Show me program execution evidence” → runs shimcache, amcache, bam</li></ul><h4><em>Plugin Coverage</em></h4><p>The 75 plugins span eight hive types (<a href="https://github.com/mkorman90/regipy/pull/310">New plugins</a> were recently added leveraging Claude code!):</p><ul><li><strong>SYSTEM (28 plugins)</strong>: Computer name, timezone, services, USB storage, network interfaces, shimcache, BAM/DAM, control sets, and more</li><li><strong>SOFTWARE (21 plugins)</strong>: Windows version, persistence mechanisms, UAC settings, Windows Defender config, PowerShell logging, installed programs</li><li><strong>NTUSER.DAT (21 plugins)</strong>: User persistence (Run keys), typed URLs, recent documents, UserAssist, run MRU, word wheel query</li><li><strong>SAM (2 plugins)</strong>: Local user accounts</li><li><strong>SECURITY (1 plugin)</strong>: Domain cached credentials info</li><li><strong>AMCACHE (1 plugin)</strong>: Application execution history</li><li><strong>UsrClass.dat (1 plugin)</strong>: Shell bags (folder access history)</li><li><strong>BCD (1 plugin)</strong>: Boot configuration</li></ul><h4>Demo</h4><p>Here’s what a typical session looks like. I’ve collected registry hives from a potentially compromised Windows machine and wanted to understand what happened.</p><p><em>“What registry hives are currently available in the system?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*q5bUhQVsnxUIWMUd.png" /></figure><p>Claude (using regipy) quickly provided me an overview of the collection of registry hives available for investigation. Claude automatically:</p><ul><li>Called the list_available_hives MCP tool</li><li>Categorized 8 hives by type (SYSTEM, SOFTWARE, NTUSER, SAM, etc.)</li><li>Explained what each hive contains</li></ul><p><em>“What are the persistence mechanisms?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/0*NFmj2k_GDwAvgy9Z.png" /></figure><p>Claude called the answer_forensic_question tool, ran both SOFTWARE and NTUSER persistence plugins, found VMware Tools, Adobe ARM, McAfee components and even flagged an interestingly suspicious entry: svchost in an unusual location.</p><p><em>“What is the most recent software installed on the machine and when was it last booted?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/0*yZO-gWZXSv0PIx4m.png" /></figure><p>Claude automatically ran the installed_programs_software plugin and the shutdown plugin. It found Adobe Reader X (10.1.0) was most recently installed (Aug 28, 2011), gave a full software installation timeline, and reported on the last shutdown.</p><p>What would have taken 15–20 minutes of running individual plugins and correlating output, took about two minutes of conversation. More importantly, I could follow my investigative instincts, asking follow-up questions as findings emerged rather than context-switching between command-line invocations.</p><h4><strong>What I Learned</strong></h4><p>Six years ago, I wrote that working on regipy taught me a lot about registry structure, the complexity of the binary format, resident vs. non-resident data and the importance of transaction logs.</p><p>Building the MCP server taught me something different: <strong>the value of meeting investigators where they think, not where the tools are.</strong></p><p>Every forensic tool has a learning curve. Command-line syntax, output formats, knowing which tool extracts which artifact… It’s all unnecessary friction that slows down investigations. The registry hasn’t gotten any simpler, but the barrier to extracting forensic value from it just got a lot lower.</p><p>The MCP server is available now in regipy. See setup instructions <a href="https://github.com/mkorman90/regipy/tree/master/regipy_mcp_server">here</a>.</p><p><strong>Links:</strong></p><p>- Original regipy <a href="https://medium.com/dfir-dudes/regipy-automating-registry-forensics-with-python-b170a1e2b474">introduction </a>(2019)</p><p>- Regipy on <a href="https://github.com/mkorman90/regipy">GitHub</a></p><p>- MCP Server <a href="https://github.com/mkorman90/regipy/pull/314">Pull Request</a></p><p>- <a href="https://modelcontextprotocol.io/">About</a> Model Context Protocol</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=984d378784d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dfir-dudes/regipy-mcp-natural-language-registry-forensics-with-claude-984d378784d6">Regipy MCP: Natural Language Registry Forensics with Claude</a> was originally published in <a href="https://medium.com/dfir-dudes">DFIR Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AmCache is not alone; Using .WER files to hunt evil]]></title>
            <link>https://medium.com/dfir-dudes/amcache-is-not-alone-using-wer-files-to-hunt-evil-86bdfdb216d7?source=rss-5668a2be172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/86bdfdb216d7</guid>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows-10]]></category>
            <dc:creator><![CDATA[martin korman]]></dc:creator>
            <pubDate>Wed, 26 Jun 2019 09:12:27 GMT</pubDate>
            <atom:updated>2019-06-26T09:12:27.895Z</atom:updated>
            <content:encoded><![CDATA[<h3>AmCache is not alone; Using .WER files to hunt evil</h3><p>TL;DR — Starting Windows 10, most of *.WER files include the process’ hash, which can be used for hunting in the same way that AmCache is being used.</p><h4>How it all started</h4><p>Lately, I have been poking around with the concept of dump files. I was trying to see if we can find dumped process files which were left on disk and then leverage them in order to hunt for suspicious activity. This is not something new, and people have discussed it in the past. For example:</p><p><a href="https://twitter.com/Lee_Holmes">@Lee Holmes</a> wrote on his blog about how one can extract activity history from PowerShell process dumps (<a href="https://www.leeholmes.com/blog/2019/01/04/extracting-activity-history-from-powershell-process-dumps/">here</a>).</p><p><a href="https://twitter.com/JamesHabben">@James Habben</a> also wrote about a case he had that involved a dump file. In that case he found a crash dump that lead him to the initial infection vector, which was a flash exploit.</p><h4>WER &amp; DFIR</h4><p>While I was going through dump files and trying to research further, I recalled that in some cases, when a program crashes on Windows, an error report file is being generated. That report file is part of the <strong>Windows Error Reporting</strong> feature which automatically submits user-mode process crashes to Microsoft.</p><p>The use of WER files for DFIR purposes is not new either. Kim Jinkook (<a href="https://twitter.com/pr0neer">@pr0neer</a>) <a href="http://forensic-proof.com/archives/4358?ckattempt=1">wrote about it</a> back in 2012, and so did <a href="https://twitter.com/corey_harrell">@Corey Harrell</a> back in 2014, in his great blog — Journey Into Incident Response (<a href="http://journeyintoir.blogspot.com/2014/02/exploring-windows-error-reporting.html">here</a>).</p><p>The blog posts are great and they detail how the evidence is being created, what is included in the evidence and how it can be used during investigations. Additionally, both of them mention that this evidence can be used as a <strong>process execution evidence</strong> and as part of a <strong>forensics timeline</strong>.</p><h4>So, what’s new?</h4><p>Well, from the tests we did, it turns out that starting<strong><em> </em></strong>Windows 10 — some report files now include the actual hash (SHA1) of the executed process. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KU8vpcsfCLCjQvH03Z4TTQ.png" /><figcaption>chrome.exe SHA1 hash, found in a crash report</figcaption></figure><p>As you can see in the image, the hash resides in the value of the “TargetAppId” field, with 4 zeros preceding (exactly like how SHA1 is stored in AmCache).</p><p>Unfortunately, not all reports contain the SHA1 of the file, and we haven’t found (yet) what will determine if the report will includes the hash or not. From our small testing environment, it seems like the reports that do not contain the hash are Microsoft Store applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*TMV_mCLh-9FRpO_IBC4Vcw.png" /><figcaption>Example entries in which the “TargetAppId” field does not contain the hash</figcaption></figure><p>We did not find anything else besides this valuable piece of information, but our dataset is quite small, so there might be some other useful things!</p><h4>How can we use it?</h4><p>Now that the evidence also include a hash of the executed process, we can extend the ways its being used in DFIR. <br><a href="https://medium.com/u/d6c2728ecb8b">Hadar Yudovich</a> and I once heard<strong><em> </em></strong>Matias Bevilacqua<strong><em> </em></strong>from Mandiant, talking about how they use AmCache and ShimCache on a large scale in order to find suspicious executables. He also wrote about it <a href="https://www.fireeye.com/blog/threat-research/2017/04/appcompatprocessor.html">here</a>. We believe you can add this evidence to the stack and search for suspicious crashes in the same manner that is described in the blog (based on prevalent, for example).</p><h4>Final Words</h4><p>While doing this small research and talking about it with Hadar, we had some interesting thoughts:</p><ol><li>The DFIR community is insane, and the amount of shared knowledge is huge. If you know where and how to search what you look for, someone probably wrote something about it in the past. There’s no need to reinvent the wheel every single time.</li><li>Revisiting existing evidence which were already discussed and analyzed is super important, especially today when Microsoft changes things in their operating systems pretty often.</li><li>We, as a community, must have a dataset of forensic evidence and automated tests that will automatically discover broken evidence and assist in finding their replacement / alternatives.</li></ol><p>Would love to hear any feedback, and thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86bdfdb216d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dfir-dudes/amcache-is-not-alone-using-wer-files-to-hunt-evil-86bdfdb216d7">AmCache is not alone; Using .WER files to hunt evil</a> was originally published in <a href="https://medium.com/dfir-dudes">DFIR Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regipy: Automating registry forensics with python]]></title>
            <link>https://medium.com/dfir-dudes/regipy-automating-registry-forensics-with-python-b170a1e2b474?source=rss-5668a2be172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b170a1e2b474</guid>
            <category><![CDATA[computer-forensics]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[dfir]]></category>
            <dc:creator><![CDATA[martin korman]]></dc:creator>
            <pubDate>Wed, 06 Mar 2019 18:40:50 GMT</pubDate>
            <atom:updated>2019-03-06T18:40:50.695Z</atom:updated>
            <content:encoded><![CDATA[<p>Lately I’ve been doing a lot of forensic investigations and tool development that involve registry hives. I tried a lot of tools, and none of them could satisfy all of my requirements:</p><ul><li>Has JSON output</li><li>Can be used as a python library <strong>with python 3 support</strong> and the following features:</li><li>Recurse over a registry hive from a given path and yield all subkeys and respective values</li><li>Get a subkey by path</li><li>Expose some of the binary structures (NK &amp; VK entries for example)</li><li>Apply transaction logs automatically, and in scale (over hunderds of collected hives and transaction logs)</li><li>Has a plugin system, with an easy and intuitive way to add more plugins</li><li>Can run on any operating system</li><li>Open source</li></ul><p>So I decided to create my own tool.</p><p><strong>Regipy: an OS independent python library for parsing offline registry hives</strong></p><h3>Features:</h3><h4>Multiple command line tools:</h4><ul><li>registry-dump — Dump the entire content of the hive to ndjson. if the -t flag is specified, the output file will be a timeline instead</li><li>registry-parse-header — Parse the REGF header of the file and validate checksum</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oW54eXms-aij1G26.png" /></figure><ul><li>registry-run-plugins — Identify the hive type and run all supported plugins. Output the results as a JSON file.</li><li>Execute the registry-plugins-list command to get a list of supported plugins, for example:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cG7ZAqY6WZQKv3CA.png" /></figure><ul><li>registry-diff — Compare two registry hives (Like regshot tool), and get the output to CSV or to screen:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NLTsrwRqGTASG5ku.png" /></figure><ul><li>registry-transaction-logs — Recover a registry hive, using transaction logs. The restored hive can be then compared to the original hive to see the differences</li></ul><h4>Plugins:</h4><p>It’s really easy to write new plugins, because of all the utils present in regipy. A short example on how to create new plugins can be found <a href="https://github.com/mkorman90/regipy/blob/master/docs/PLUGINS.md"><strong>here</strong></a><strong>. </strong>These are the currently existing plugins:</p><ul><li>Installed services (from system hive)</li><li>Amcache (both win7 and win8+ formats)</li><li>Network routes</li><li>Computer name</li><li>Ntuser hive persistence</li><li>Software hive persistence</li><li>User Assist</li><li>Shimcache (Mandiant’s Shimcache parser)</li><li>Installed software</li><li>Image file execution options</li></ul><h4>Use as a library:</h4><ul><li>Get a specific registry key by path, get all subkeys and values for that key</li><li>Recurse over the registry hive from a given path (or root) and yield all subkeys</li><li>Execute specific plugins</li><li>Apply registry transactions from a log file on a specific hive</li></ul><p>Hopefully, the DFIR community will find this library/tool useful as well.</p><p>I learned a lot about registry structure from working on this project:</p><ul><li>The registry is a complex binary structure with a lot of extreme cases:</li><li>Data can be resident inside the VK record itself, if the data is small enough</li><li>Sometimes the data is small enough and yet it is not resident</li><li>Data bigger than 16344 bytes will be in a different type of structure (i.e: shimcache)</li><li>The transaction logs are really important and can make a great difference between having findings in a case or not.</li></ul><h3>A practical example of analysis using regipy and pandas</h3><p><strong>Load the hive timeline to group by timeframes and detect interesting registry modifications:</strong></p><p>Load the output of registry-dump NTUSER_modified.DAT -t -o ./timeline.csv to pandas:</p><pre>import pandas as pd</pre><pre>pd.set_option(&#39;max_colwidth&#39;, 800)</pre><pre>df = pd.read_csv(&#39;/tmp/testdata/timeline.csv&#39;)</pre><pre>df[&#39;timestamp&#39;] = pd.to_datetime(df[&#39;timestamp&#39;])</pre><pre>df.index = df[&#39;timestamp&#39;]</pre><pre>df.drop(columns=&#39;timestamp&#39;, inplace=True)</pre><pre>df = df.sort_index(ascending=True)</pre><p>We get a dataframe that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/0*3MakhS51-Sntk5gN.png" /></figure><p>We want to group events by a specific time span, for example 1 hour:</p><pre>df_grouped = df.groupby(pd.Grouper(freq=&#39;60Min&#39;, base=30, label=&#39;right&#39;)).sum()</pre><pre>df_grouped[df_grouped[&#39;values_count&#39;] &gt; 0][df_grouped[&#39;values_count&#39;] &lt; 5]</pre><p>Now we have a small data frame with a couple of interesting timeframes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/0*HnE7xXEWYfoXN8pW.png" /></figure><p>Let’s take a look at a specific timeframe:</p><p>df[df.index &gt;= &#39;2012-04-04 02:30:00+00:00&#39;]</p><p>We get the following result (the result is sorted by date, and only the latest entries are shown):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0wuIzpvvXR6SKhv6.png" /></figure><p>We see that<em> \Software\Microsoft\Windows\CurrentVersion\Run</em> was modified, and also <em>\Software\Microsoft\legitimate_subkey\legitimate_subkey</em>… Interesting :)</p><h4>What’s next?</h4><p>There’s a lot of work to be done:</p><ul><li>Recovering data from unallocated cells</li><li>Improve performance even more (someone said rust?)</li><li>Write more plugins — also expecting some pull requests from the community</li></ul><h3>How to install</h3><p>Regipy supports only python 3.7</p><p>Regipy releases can be found at pypi: <a href="https://pypi.org/project/regipy/">https://pypi.org/project/regipy/</a></p><p>to get the latest stable release just use:</p><pre>pip install regipy</pre><p>The source code is on github: <a href="https://github.com/mkorman90/regipy">https://github.com/mkorman90/regipy</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b170a1e2b474" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dfir-dudes/regipy-automating-registry-forensics-with-python-b170a1e2b474">Regipy: Automating registry forensics with python</a> was originally published in <a href="https://medium.com/dfir-dudes">DFIR Dudes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>