Guest User

Untitled

a guest
Dec 28th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. # Ransomware Canary
  2. # Kenton
  3. # December 28, 2018
  4. #
  5. # Creates an FSRM file screen that watches a folder(s) for any file changes,
  6. # immediately shuts down the server if any are detected to slow down ransomware attacks
  7.  
  8. $CanaryPath = "C:UsersAdministratorDesktopAcounting" # Path to monitor, deliberately misspelled
  9. $AnyGroup = "Any" # Name of FSRM file group to catch all files
  10. $ShutdownCmd = "C:WindowsSystem32shutdown.exe" # Location of shutdown command
  11. $ShutdownParameters = "/s /f" # /s = shut down computer immediately; /f = force close applications
  12.  
  13. # Install File Server Resource Manager (FSRM)
  14. Add-WindowsFeature -Name FS-Resource-Manager -IncludeManagementTools
  15.  
  16. # Define file group to catch all possible names, since any changes in this folder should be disallowed
  17. New-FsrmFileGroup -Name $AnyGroup -IncludePattern @("*")
  18.  
  19. # Define action to shut down computer
  20. $ShutdownAction = New-FsrmAction -Type Command -Command $ShutdownCmd -CommandParameters $ShutdownParameters -SecurityLevel LocalSystem
  21.  
  22. # Define file screen
  23. New-FsrmFileScreen -Path $CanaryPath -IncludeGroup $AnyGroup -Notification $ShutdownAction -Active
  24.  
  25. New-FsrmFileScreen : 0x8004530d, The specified property is out of range.
  26. At C:UsersAdministratorDesktopadd-ransomware-canary.ps1:23 char:1
  27. + New-FsrmFileScreen -Path $CanaryPath -IncludeGroup $AnyGroup -Notific ...
  28. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  29. + CategoryInfo : NotSpecified: (MSFT_FSRMFileScreen:Root/Microsoft/..._FSRMFileScreen) [New-FsrmFileScree
  30. n], CimException
  31. + FullyQualifiedErrorId : HRESULT 0x8004530d,New-FsrmFileScreen
Add Comment
Please, Sign In to add comment