nexxai / CryptoBlocker

A script to deploy File Server Resource Manager and associated scripts to block infected users
GNU General Public License v2.0
200 stars 73 forks source link

Exclusions on 2008 deployment #32

Open darkmilz opened 6 years ago

darkmilz commented 6 years ago

I'm using the DeployCryptoBlocker.ps1 on a Win2008 server and I'm new to PowerShell.

Line 143 of the script begins

If

 (Test-Path .\SkipList.txt)
{
    $Exclusions = Get-Content .\SkipList.txt | ForEach-Object { $_.Trim() }
    $monitoredExtensions = $monitoredExtensions | Where-Object { $Exclusions -notcontains $_ }

}
Else 
{
    $emptyFile = @'
#
# Add one filescreen per line that you want to ignore
#
# For example, if *.doc files are being blocked by the list but you want 
# to allow them, simply add a new line in this file that exactly matches 
# the filescreen:
#
# *.doc
#
# The script will check this file every time it runs and remove these 
# entries before applying the list to your FSRM implementation.
#
'@
    Set-Content -Path .\SkipList.txt -Value $emptyFile
}

I want to add the exclusion in here, and not in the skiplist.txt Where exactly does the extension go? I tried outside the @ symbol but that did not work:

Else 
{
    $emptyFile = 
*.adr
     @'
#
nexxai commented 6 years ago

As of right this second, the SkipList.txt file is created and stored usually in either the same directory as the script, or (more likely) in c:\Windows\System32. A pull request has been submitted to force it to use the script's directory, but we are making a few changes before that PR becomes public. Please keep an eye on this repo over the next few days as the change should be merged by then.