{"id":1802,"date":"2013-03-15T13:41:21","date_gmt":"2013-03-15T13:41:21","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=1802"},"modified":"2013-03-18T04:21:23","modified_gmt":"2013-03-18T04:21:23","slug":"3rpg-4-regripper-plugins-in-15-minutes","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2013\/03\/15\/3rpg-4-regripper-plugins-in-15-minutes\/","title":{"rendered":"3RPG \u2013 4 RegRipper Plugins in 15 minutes"},"content":{"rendered":"<p>In this post I show how to quickly develop 4 plugins using <a href=\"https:\/\/hexacorn.com\/tools\/3rpg.html\">3RPG<\/a>. Except for the documentation (this post) it took barely 10-15 minutes.<\/p>\n<p>You can download plugins <a href=\"https:\/\/hexacorn.com\/examples\/2013-03-15_3rpg_plugins.zip\">here<\/a>.<\/p>\n<h4>01. Detecting presence of 7zip on the system<\/h4>\n<p>7Zip has a key in the following location<\/p>\n<pre style=\"padding-left: 30px;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\7-Zip<\/pre>\n<p>This is enough to build the script:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1803\" alt=\"01_7zip1\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip1.png\" width=\"321\" height=\"502\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip1.png 434w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip1-191x300.png 191w\" sizes=\"(max-width: 321px) 100vw, 321px\" \/><\/a><\/p>\n<p>Note that the name of the script is automatically prefixed with an underscore (7zip -&gt; _7zip) for names starting with digits (it&#8217;s because perl doesn&#8217;t &#8216;like&#8217; it).<\/p>\n<p>Also, when you paste the 7zip registry key, and change the focus 3RPG will automatically strip HKEY_LOCAL_MACHINE\\SOFTWARE part:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1804\" alt=\"01_7zip2\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip2.png\" width=\"251\" height=\"52\" \/><\/a>Now click the code &#8211; 3RPG will automatically select it all for your convenience.<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1805\" alt=\"01_7zip3\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip3.png\" width=\"417\" height=\"239\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip3.png 621w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip3-300x172.png 300w\" sizes=\"(max-width: 417px) 100vw, 417px\" \/><\/a><\/p>\n<p>You can now copy this to any editor and save &#8211; use a name highlighted in red and with an extension .pl i.e. _7zip.pl.<\/p>\n<p>Then run:<\/p>\n<pre style=\"padding-left: 30px;\">perl rip.pl -r SOFTWARE.copy0 -p _7zip<\/pre>\n<p>The result:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1807\" alt=\"01_7zip4\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip4.png\" width=\"501\" height=\"275\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip4.png 501w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/01_7zip4-300x164.png 300w\" sizes=\"(max-width: 501px) 100vw, 501px\" \/><\/a><\/p>\n<h4>02 Listing persistent network mappings<\/h4>\n<p>All mapped drives are listed under the following key:<\/p>\n<pre style=\"padding-left: 30px;\">HKEY_CURRENT_USER\\Network<\/pre>\n<p>Again, we run through the same exercise as previously &#8211; this time we include &#8216;Yes, scan subkeys, depth=2&#8217;<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1809\" alt=\"02_netmap1\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap1.png\" width=\"349\" height=\"58\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap1.png 349w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap1-300x49.png 300w\" sizes=\"(max-width: 349px) 100vw, 349px\" \/><\/a><\/p>\n<p>Then run:<\/p>\n<pre style=\"padding-left: 30px;\">perl rip.pl -r NTUSER.DAT -p netmap<\/pre>\n<p>and the result is:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap2b.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1832\" alt=\"02_netmap2b\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap2b.png\" width=\"533\" height=\"367\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap2b.png 533w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/02_netmap2b-300x206.png 300w\" sizes=\"(max-width: 533px) 100vw, 533px\" \/><\/a><\/p>\n<h3>03. Listing all possible CLSID autostart entries<\/h3>\n<p>Amongst various less-known autostart mechanisms that I listed in my older <a title=\"Beyond good ol\u2019 Run key\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/07\/23\/beyond-good-ol-run-key\/\">post<\/a> we can find adding or re-using entries of COM servers. Such technique can be used to introduce a man-in-the-middle code for a legitimate plugins, shell extensions, etc. .<\/p>\n<p>The information about the COM servers is stored under the following key:<\/p>\n<pre style=\"padding-left: 30px;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID<\/pre>\n<p>The names of DLLs, EXEs, etc. are usually listed under <em>{Default}<\/em> value, so the plugin below will list (going recursively through the whole node) all possible <em>{Default} <\/em>values listed under CLSID node.<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1816\" alt=\"03_clsid1\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid1.png\" width=\"434\" height=\"629\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid1.png 434w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid1-206x300.png 206w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/a><\/p>\n<p>We run it as:<\/p>\n<pre style=\"padding-left: 30px;\">perl rip.pl -r Software2 -p clsid<\/pre>\n<p>And the results are:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1817\" alt=\"03_clsid2\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid2.png\" width=\"661\" height=\"407\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid2.png 661w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid2-300x184.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid2-80x50.png 80w\" sizes=\"(max-width: 661px) 100vw, 661px\" \/><\/a><\/p>\n<p>This is not a perfect solution as many <em>{Default}<\/em> values don&#8217;t include a file name, but we could either grep results by specific extension e.g. dll, or patch the script manually and add a better routine (e.g. only list values under <em>InprocServer32<\/em> and <em>LocalServer32<\/em>)<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1819\" alt=\"03_clsid3\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid3.png\" width=\"483\" height=\"297\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid3.png 661w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid3-300x184.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/03_clsid3-80x50.png 80w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><\/a><\/p>\n<p>Last, but not least &#8211; running this plugin often probably doesn&#8217;t make sense as it&#8217;s very slow, but it is a simple example that demonstrates how to search for <em>{Default}<\/em> values.<\/p>\n<h3>\u00a004. Listing keys with binary data<\/h3>\n<p>This is just another simple example showing how REG_BINARY data is presented in the output of plugins generated with 3RGP.<\/p>\n<p>For the example, I will look at the key<\/p>\n<pre style=\"padding-left: 30px;\">HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\\r\nCurrentVersion\\Print\\Printers\\Microsoft XPS Document Writer<\/pre>\n<p>associated with Microsoft XPS Document Writer and its value <em>Default DevMode<\/em>.<\/p>\n<p>I don&#8217;t know what&#8217;s exactly inside this key, but since it contains a binary blob, it will serve the purpose here.<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1820\" alt=\"04_xps1\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps1.png\" width=\"333\" height=\"500\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps1.png 433w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps1-199x300.png 199w\" sizes=\"(max-width: 333px) 100vw, 333px\" \/><\/a><\/p>\n<p>We run it as:<\/p>\n<pre style=\"padding-left: 30px;\">perl rip.pl -r Software2 -p xps<\/pre>\n<p>And the results are:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1821\" alt=\"04_xps2\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps2.png\" width=\"505\" height=\"310\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps2.png 661w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps2-300x184.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/03\/04_xps2-80x50.png 80w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/a><\/p>\n<p>That&#8217;s it! Thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I show how to quickly develop 4 plugins using 3RPG. Except for the documentation (this post) it took barely 10-15 minutes. You can download plugins here. 01. Detecting presence of 7zip on the system 7Zip has a &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2013\/03\/15\/3rpg-4-regripper-plugins-in-15-minutes\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[30,19,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1802"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=1802"}],"version-history":[{"count":15,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1802\/revisions"}],"predecessor-version":[{"id":1835,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1802\/revisions\/1835"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=1802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=1802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=1802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}