This is a solution to block users infected with different ransomware variants.
The script will install File Server Resource Manager (FSRM), and set up the relevant configuration.
Script Deployment Steps
- Checks for network shares
- Installs FSRM
- Create batch/PowerShell scripts used by FSRM
- Creates a File Group in FSRM containing malicious extensions and filenames
- Creates a File Screen in FSRM utilising this File Group, with an event notification and command notification
- Creates File Screens utilising this template for each drive containing network shares
How it Works
If the user writes a malicious file (as contained in the file group) to a network share, FSRM will run the deployed script which will add a Deny permission for that user against every share.
This has been tested fairly thoroughly, and I find that at most ransomware ends up encrypting one directory before the user is blocked.
NOTE: This will NOT stop variants which use randomised file extensions, don't drop README files, etc
Usage
Just run the script. You can easily use this script to deploy the required FSRM install, configuration and needed blocking scripts across many file servers
An event will be logged by FSRM to the Event Viewer (Source = SRMSVC, Event ID = 8215), showing who tried to write a malicious file and where they tried to write it. Use your monitoring system of choice to raise alarms, tickets, etc for this event and respond accordingly.