diff --git a/install-raccine.bat b/install-raccine.bat new file mode 100644 index 0000000..08e16fc --- /dev/null +++ b/install-raccine.bat @@ -0,0 +1,115 @@ +@ECHO OFF +SET __COMPAT_LAYER=RunAsInvoker +CLS + +:: BatchGotAdmin +:: Source: https://stackoverflow.com/a/10052222 +:------------------------------------- +:: Check for permissions +IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( +>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" +) ELSE ( +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" +) + +:: Not Admin +:: If error flag set, we do not have admin. +IF '%errorlevel%' NEQ '0' ( + ECHO Requesting administrative privileges... + GOTO UACPrompt +) ELSE ( GOTO gotAdmin ) + +:: UAC Prompt +:UACPrompt + ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + SET params= %* + ECHO UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs" + + "%temp%\getadmin.vbs" + DEL "%temp%\getadmin.vbs" + EXIT /B + +:: Actual Script +:gotAdmin + PUSHD "%CD%" + CD /D "%~dp0" + GOTO MENU + +:MENU +CLS +ECHO. +ECHO .......................................................... +::: ___ _ +::: / _ \___ _________(_)__ ___ +::: / , _/ _ `/ __/ __/ / _ \/ -_) +::: /_/|_|\_,_/\__/\__/_/_//_/\__/ +::: +for /f "delims=: tokens=*" %%A in ('findstr /b ::: "%~f0"') do @echo(%%A +ECHO A Simple Ransomware Vaccine +ECHO Installer by Florian Roth, October 2020 +ECHO. +ECHO ---------------------------------------------------------- +ECHO WARNING! Raccine could break your backup solution +ECHO .......................................................... +ECHO. +ECHO 1 - Install Raccine for all possible methods (radical) +ECHO 2 - Install Raccine for Vssadmin only (relatively safe) +ECHO 3 - Uninstall Raccine +ECHO E - EXIT +ECHO. + +SET /P M=" Select 1, 2, 3, or E then press ENTER: " +IF %M%==1 GOTO FULL +IF %M%==2 GOTO SOFT +IF %M%==3 GOTO UNINSTALL +IF %M%==E GOTO EOF +IF %M%==e GOTO EOF + +:: Installer actions +:SOFT +REGEDIT.EXE /S raccine-reg-patch-vssadmin.reg +IF '%errorlevel%' NEQ '0' ( + ECHO Something went wrong. Sorry. + GOTO MENU +) +COPY Raccine.exe C:\Windows\Raccine.exe +IF '%errorlevel%' NEQ '0' ( + ECHO Something went wrong. Sorry. +) ELSE ( + ECHO. + ECHO Successfully installed! You system has been raccinated. +) +TIMEOUT /t 5 +GOTO MENU + +:FULL +REGEDIT.EXE /S raccine-reg-patch-vssadmin.reg +IF '%errorlevel%' NEQ '0' ( + ECHO Something went wrong. Sorry. + GOTO MENU +) +REGEDIT.EXE /S raccine-reg-patch-wmic.reg +REGEDIT.EXE /S raccine-reg-patch-wbadmin.reg +COPY Raccine.exe C:\Windows\Raccine.exe +IF '%errorlevel%' NEQ '0' ( + ECHO Something went wrong. Sorry. +) ELSE ( + ECHO. + ECHO Successfully installed! You system has been raccinated. +) +TIMEOUT /t 5 +GOTO MENU + +:UNINSTALL +REGEDIT.EXE /S raccine-reg-patch-uninstall.reg +DEL /Q C:\Windows\Raccine.exe +IF '%errorlevel%' NEQ '0' ( + ECHO Something went wrong. Sorry. +) ELSE ( + ECHO. + ECHO Successfully uninstalled! +) +TIMEOUT /t 5 +GOTO MENU + +:EOF \ No newline at end of file