{"id":10212,"date":"2025-11-16T00:08:47","date_gmt":"2025-11-16T00:08:47","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=10212"},"modified":"2025-12-07T00:03:16","modified_gmt":"2025-12-07T00:03:16","slug":"1-or-more-little-secrets-of-disksnapshot-exe","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2025\/11\/16\/1-or-more-little-secrets-of-disksnapshot-exe\/","title":{"rendered":"1 or more little secrets of disksnapshot.exe"},"content":{"rendered":"\n<p>This native tool is not very well known, but it may be useful in some cases.<\/p>\n\n\n\n<p>The tool seems to be parsing volumes directly, bypassing the Windows APIs &#8212; hence, it kinda works like a <code>dir<\/code> command, but parses the $MFT of volumes directly (but still via API).<\/p>\n\n\n\n<p>The program accepts a number of command line arguments:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DiskSnapshot.exe [options]\n        -c write detail data to console\n        -i write detail data to console (same as -c)\n        -s (deprecated) summary data to console\n        -u process large volumes (no limit)\n        -j [config] specifies an alternate config file\n        -v [volume][path] specifies volume(+path) to process, e.g. \"d:\" or \"d:\\foo\"\n        -d [input-file] print encoded versions of the strings in the input file, for decoding purposes\n        -e prints out escalation keywords\n        -k calculate checksums for files, used to investigate duplicated on-disk content (c arg required).\n        -o [output-file] write detail data to a file<\/pre>\n\n\n\n<p>It turns out that the &#8216;checksum&#8217; is actually a SHA256 algorithm, so running:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">disksnapshot -c -k -v c:\\test<\/pre>\n\n\n\n<p>will list all the files in the c:\\test directory, and will calculate the SHA256 of each file.<\/p>\n\n\n\n<p>The other curious command line argument is <code>-e<\/code>. Running:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">disksnapshot -e > escalation_keywords.txt<\/pre>\n\n\n\n<p>gives us this <a href=\"https:\/\/\/www.hexacorn.com\/d\/win11_25H2_escalation_keywords.txt\">list of keywords<\/a> (on Windows 11 25H2). It turns out that this list is based on the content of <code>c:\\WINDOWS\\system32\\DiskSnapshot.conf<\/code> file. <\/p>\n\n\n\n<p>There is an undocumented command line argument <code>-z<\/code> that kinda tries to collect telemetry, but it doesn&#8217;t really work. If the call to a function <em>TelIsTelemetryTypeAllowed(2) <\/em>returns 1 it just exits with a message:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Telemetry run: telemetry is disabled, exiting<\/pre>\n\n\n\n<p>Otherwise, it checks if the OS is a retail version (guessing by the function name that is called here), and if it is, it &#8216;rolls a dice&#8217; and prints the below message:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    curtime = _time64(0);\n    _o_srand(curtime);\n    rand = ::rand();\n    if ( rand != 7 * (rand \/ 7) )\n    {\n      v4 = o___acrt_iob_func_0(2u);\n      fwprintf(v4, L\"Telemetry run: failed the dice roll, exiting\\n\");\n      return 0;\n    }\n<\/pre>\n\n\n\n<p>There is a command line argument <code>-j<\/code> that we can use to change the default config file from <code>c:\\WINDOWS\\system32\\DiskSnapshot.conf<\/code> file to our own, but I am not sure how to use it. The <code>disksnapshot -j c:\\test\\test.conf -e<\/code> command prints out the content of the custom config, but when I tried to apply it to the volume, it somehow didn&#8217;t work. I guess I just don&#8217;t fully understand the logic behind this tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This native tool is not very well known, but it may be useful in some cases. The tool seems to be parsing volumes directly, bypassing the Windows APIs &#8212; hence, it kinda works like a dir command, but parses the &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2025\/11\/16\/1-or-more-little-secrets-of-disksnapshot-exe\/\">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":[53,126],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10212"}],"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=10212"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10212\/revisions"}],"predecessor-version":[{"id":10213,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10212\/revisions\/10213"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=10212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=10212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=10212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}