File Block EXE =========== On version 14.1 of Sysmon the capability to log and block when a process is deleting a file by overwriting its file blocks. Events will be loggedusing **EventID 27**. This event type is found under schema version 4.83. ![minifilter](./media/image36.png) The minidriver inspect the action that is being taken to see if it is a file block overwrite and if the header of the file for the MZ DOS Executable header. Some common processes on system that perform actions that may generate some false positives if all instances of the action is blocked. If this approach is follower a exclusion list should be used. An example of these are: ```xml C:\WINDOWS\System32\svchost.exe NT AUTHORITY\LOCAL SERVICE C:\WINDOWS\System32\svchost.exe NT AUTHORITY\SYSTEM C:\WINDOWS\system32\SearchIndexer.exe NT AUTHORITY\SYSTEM C:\WINDOWS\system32\lsass.exe NT AUTHORITY\SYSTEM \MsMpEng.exe NT AUTHORITY\SYSTEM C:\WINDOWS\system32\DllHost.exe \Dropbox\Client\Dropbox.exe C:\WINDOWS\system32\backgroundTaskHost.exe \AppData\Local\Programs\Microsoft VS Code\Code.exe C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe \Microsoft\Edge\Application\msedge.exe \1Password.exe C:\Windows\ImmersiveControlPanel\SystemSettings.exe C:\WINDOWS\system32\taskhostw.exe ``` It is recommended to better block those files that an attacket would like to delete so as to hide their tracks that where part of a compromise at several stages. Now great care should be taken for those applications that update themself and some software management solutions that may trigger false positives for some of the files covered. Since this is a blocking action it is important to test before a configuration is pushed to host, after a deployment it is also important to minitor to prevent disruption in some environments. ```XML .sys .rft .jsp .jspx .asp .aspx .php .war .ace .iqy .slk .docm .pptm .xlsm .xlm .dotm .xltm .potm .ppsm .sldm .xlam .xla .xll .settingcontent-ms .application .appref-ms .kirbi .iso .img .hta .exe .dll .ps1 .ps2 .psm1 .bat .cmd ``` Sysmon will not generate any alert on screen for the user once it takes the action. ### Event information The file delete event fields are: * **RuleName**: Name of rule that triggered the event * **UtcTime**: Time in UTC when event was created * **ProcessGuid**: Process Guid of the process that overwrote the fileblocks for the file * **ProcessId**: Process ID used by the OS to identify the process that overwrote the fileblocks for the file. * **Image**: File path of the process that overwrote the fileblocks for the file * **TargetFilename**: Name of the file that is being deleted. * **Hashes**: Full hash of the file with the algorithms in the HashType field. * **IsExecutable**: If the file has a MZ header saying the file is an executable.