diskshadow.exe

  • File Path: C:\windows\system32\diskshadow.exe
  • Description: DiskShadow

Hashes

Type Hash
MD5 85D520607D0DA6577E94600F2BC78AC7
SHA1 B5E401239E51EA20C583980A2034EEADAD1DDE3C
SHA256 E10CE1898A2817ACD53EB35EB097E8B4043684CA768B45686E6AA6EBE2F674A8
SHA384 F474AE3473C843761677A1F126166B59344C0D6B93AC813D991C1CE12CAC9CA7A408D451AC18BEDD200EE5DEE3BA329F
SHA512 DCAE8310FEA7CF8407C14231270E67BCA5CCE7836A4C574FE48D4A4C6CF7F64562B442C0E4A50D056D7E56104AEC2F07F8596F79A133F0C7749284AE9C6CD7F3
SSDEEP 6144:554+IPTyvXipu2C4pOZjf6O9MMXtEdiFR2tWUtLz6QOx4X+H:554+11X8uR2cXiO

Signature

  • Status: The file C:\windows\system32\diskshadow.exe is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170
  • Serial: ``
  • Thumbprint: ``
  • Issuer:
  • Subject:

File Metadata

  • Original Filename: diskshadow.exe.mui
  • Product Name: Microsoft Windows Operating System
  • Company Name: Microsoft Corporation
  • File Version: 6.3.9600.16384 (winblue_rtm.130821-1623)
  • Product Version: 6.3.9600.16384
  • Language: English (United States)
  • Legal Copyright: Microsoft Corporation. All rights reserved.

Possible Misuse

The following table contains possible examples of diskshadow.exe being misused. While diskshadow.exe is not inherently malicious, its legitimate functionality can be abused for malicious purposes.

Source Source File Example License
sigma proc_creation_win_shadow_copies_deletion.yml - '\diskshadow.exe' DRL 1.0
sigma proc_creation_win_susp_diskshadow.yml title: Execution via Diskshadow.exe DRL 1.0
sigma proc_creation_win_susp_diskshadow.yml description: Detects using Diskshadow.exe to execute arbitrary code in text file DRL 1.0
sigma proc_creation_win_susp_diskshadow.yml - https://bohops.com/2018/03/26/diskshadow-the-return-of-vss-evasion-persistence-and-active-directory-database-extraction/ DRL 1.0
sigma proc_creation_win_susp_diskshadow.yml Image\|endswith: '\diskshadow.exe' DRL 1.0
sigma proc_creation_win_susp_diskshadow.yml - False postitve can be if administrators use diskshadow tool in their infrastructure as a main backup tool with scripts. DRL 1.0
LOLBAS Diskshadow.yml Name: Diskshadow.exe  
LOLBAS Diskshadow.yml Description: Diskshadow.exe is a tool that exposes the functionality offered by the volume shadow copy Service (VSS).  
LOLBAS Diskshadow.yml - Command: diskshadow.exe /s c:\test\diskshadow.txt  
LOLBAS Diskshadow.yml Description: Execute commands using diskshadow.exe from a prepared diskshadow script.  
LOLBAS Diskshadow.yml Usecase: Use diskshadow to exfiltrate data from VSS such as NTDS.dit  
LOLBAS Diskshadow.yml - Command: diskshadow> exec calc.exe  
LOLBAS Diskshadow.yml Description: Execute commands using diskshadow.exe to spawn child process  
LOLBAS Diskshadow.yml Usecase: Use diskshadow to bypass defensive counter measures  
LOLBAS Diskshadow.yml - Path: C:\Windows\System32\diskshadow.exe  
LOLBAS Diskshadow.yml - Path: C:\Windows\SysWOW64\diskshadow.exe  
LOLBAS Diskshadow.yml - IOC: Child process from diskshadow.exe  
LOLBAS Diskshadow.yml - Link: https://bohops.com/2018/03/26/diskshadow-the-return-of-vss-evasion-persistence-and-active-directory-database-extraction/  
atomic-red-team index.md - Atomic Test #9: DiskShadow Command Execution [windows] MIT License. © 2018 Red Canary
atomic-red-team windows-index.md - Atomic Test #9: DiskShadow Command Execution [windows] MIT License. © 2018 Red Canary
atomic-red-team T1218.md - Atomic Test #9 - DiskShadow Command Execution MIT License. © 2018 Red Canary
atomic-red-team T1218.md ## Atomic Test #9 - DiskShadow Command Execution MIT License. © 2018 Red Canary
atomic-red-team T1218.md Emulates attack with a DiskShadow.exe (LOLBIN installed by default on Windows) being used to execute arbitrary commands Reference: https://bohops.com/2018/03/26/diskshadow-the-return-of-vss-evasion-persistence-and-active-directory-database-extraction/ MIT License. © 2018 Red Canary
atomic-red-team T1218.md | dspath | Default location of DiskShadow.exe | Path | C:\Windows\System32\diskshadow.exe| MIT License. © 2018 Red Canary
atomic-red-team T1218.md ##### Description: DiskShadow.exe must exist on disk at specified location (#{dspath}) MIT License. © 2018 Red Canary
atomic-red-team T1218.md echo “DiskShadow.exe not found on disk at expected location” MIT License. © 2018 Red Canary

Additional Info*

*The information below is copied from MicrosoftDocs, which is maintained by Microsoft. Available under CC BY 4.0 license.


Diskshadow

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Diskshadow.exe is a tool that exposes the functionality offered by the volume shadow copy Service (VSS). By default, Diskshadow uses an interactive command interpreter similar to that of Diskraid or Diskpart. Diskshadow also includes a scriptable mode.

[!NOTE] Membership in the local Administrators group, or equivalent, is the minimum required to run Diskshadow.

Syntax

For interactive mode, type the following at the command prompt to start the Diskshadow command interpreter:

diskshadow

For script mode, type the following, where script.txt is a script file containing Diskshadow commands:

diskshadow -s script.txt

Parameters

You can run the following commands in the Diskshadow command interpreter or through a script file. At a minimum, only add and create are necessary to create a shadow copy. However, this forfeits the context and option settings, will be a copy backup, and creates a shadow copy with no backup execution script.

Command Description
set command Sets the context, options, verbose mode, and metadata file for creating shadow copies.
load metadata command Loads a metadata .cab file prior to importing a transportable shadow copy or loads the writer metadata in the case of a restore.
writer command verifies that a writer or component is included or excludes a writer or component from the backup or restore procedure.
add command Adds volumes to the set of volumes that are to be shadow copied, or adds aliases to the alias environment.
create command Starts the shadow copy creation process, using the current context and option settings.
exec command Executes a file on the local computer.
begin backup command Starts a full backup session.
end backup command Ends a full backup session and issues a backupcomplete event with the appropriate writer state, if needed.
begin restore command Starts a restore session and issues a prerestore event to involved writers.
end restore command Ends a restore session and issues a postrestore event to involved writers.
reset command Resets Diskshadow to the default state.
list command Lists writers, shadow copies, or currently registered shadow copy providers that are on the system.
delete shadows command Deletes shadow copies.
import command Imports a transportable shadow copy from a loaded metadata file into the system.
mask command Removes hardware shadow copies that were imported by using the import command.
expose command Exposes a persistent shadow copy as a drive letter, share, or mount point.
unexpose command Unexposes a shadow copy that was exposed by using the expose command.
break command Disassociates a shadow copy volume from VSS.
revert command Reverts a volume back to a specified shadow copy.
exit command Exits the command interpreter or script.

Examples

This is a sample sequence of commands that will create a shadow copy for backup. It can be saved to file as script.dsh, and executed using diskshadow /s script.dsh.

Assume the following:

  • You have an existing directory called c:\diskshadowdata.

  • Your system volume is C: and your data volume is D:.

  • You have a backupscript.cmd file in c:\diskshadowdata.

  • Your backupscript.cmd file will perform the copy of shadow data p: and q: to your backup drive.

You can enter these commands manually or script them:

##Diskshadow script file
set context persistent nowriters
set metadata c:\diskshadowdata\example.cab
set verbose on
begin backup
add volume c: alias systemvolumeshadow
add volume d: alias datavolumeshadow

create

expose %systemvolumeshadow% p:
expose %datavolumeshadow% q:
exec c:\diskshadowdata\backupscript.cmd
end backup
##End of script

Additional References


MIT License. Copyright (c) 2020-2021 Strontic.