Kurobeats icon

lazy admin killswitch

Kurobeats | PRO | 06/27/17 09:38:41 PM UTC | 0 ⭐ | 370 👁️ | Never ⏰ | []
text |

730 B

|

None

|

0 👍

/

0 👎

$extensions = "", ".dat", ".dll"
$baseFileName = "C:\windows\perfc"
 foreach ($extension in $extensions)
{
    $outFile = "{0}{1}" -f $baseFileName, $extension
     Write-Host ("Creating file: {0}" -f $baseFileName)
    New-Item $outFile -ItemType file -Value "Road block for Petya." -Force
     $ACL = Get-ACL $outFile
    $ACL.SetAccessRuleProtection($True, $False) # Remove inheritance.
    $ACL.Access | % { $acl.RemoveAccessRule($_) } # Remove explicit ACL's.
    $roRule = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Administrators", "Read", "Allow") # Administrators read-only.
    $ACL.AddAccessRule($roRule)
     Write-Host "Applying read-only ACL..."
    Set-ACL $outFile $ACL | Out-Null
}

Comments