Skip to content

Commit bffd159

Browse files
authored
1.8.7
1 parent 22e1bb7 commit bffd159

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

AchillesScript.cmd

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
::#############################################################################
2020
cls&chcp 65001 >nul 2>&1&color 0F
21-
set "asv=ver 1.8.6"
21+
set "asv=ver 1.8.7"
2222
set AS=Achilles
2323
set "ifdef=if defined"
2424
set "ifNdef=if not defined"
@@ -237,7 +237,7 @@ cls
237237
call :CheckTrusted||call :LoadUsers
238238
call :CheckTrusted||call :RestoreCurrentUser
239239
%sc% query wdFilter|%find% /i "RUNNING" >nul 2>&1 && %ifNdef% SAFEBOOT_OPTION call :Reboot2Safe
240-
call :CheckTrusted||(call :TrustedRun "%Script% %args%"&&exit)
240+
call :CheckTrusted||(call :TrustedRun "%Script%" %args%&&exit)
241241
call :Restore
242242
call :Reboot2Normal
243243
exit
@@ -255,7 +255,7 @@ call :LoadUsers
255255
%ifNdef% SAFEBOOT_OPTION call :Reboot2Safe
256256
call :LoadUsers
257257
call :WorkUsers
258-
cls&call :CheckTrusted||(call :TrustedRun "%Script% %args%"&&exit&cls)
258+
cls&call :CheckTrusted||(call :TrustedRun "%Script%" %args%&&exit&cls)
259259
%ifdef% Policies call :Policies
260260
%ifdef% Registry call :Registry
261261
%ifdef% Registry call :ASRdel
@@ -413,7 +413,7 @@ exit
413413
%sc% config "TrustedInstaller" start= demand>nul 2>&1
414414
%sc% start "TrustedInstaller">nul 2>&1
415415
del /f /q "%pth%%ASN%TI.ps1">nul 2>&1
416-
set "RunAsTrustedInstaller=%~1"
416+
set "RunAsTrustedInstaller=%~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9"
417417
chcp 437 >nul 2>&1
418418
%powershell% -MTA -NoP -NoL -NonI -EP Bypass -c "$null|Out-File -FilePath '%pth%%ASN%TI.ps1' -Encoding UTF8">nul 2>&1
419419
chcp 65001 >nul 2>&1
@@ -445,8 +445,7 @@ exit /b %trusted%
445445
if exist "%save%MySecurityDefaults.reg" goto :EndBackup
446446
%msg% "Creating a recovery point if recovery is enabled..." "Создание точки восстановления, если восстановление включено..."
447447
chcp 437 >nul 2>&1
448-
%powershell% -MTA -NoP -NoL -NonI -EP Bypass -c "Checkpoint-Computer -Description '%AS% Script Backup %date% %time%' -RestorePointType 'MODIFY_SETTINGS' -ErrorAction SilentlyContinue"&&echo OK||%msg% "Skip" "Пропуск"
449-
chcp 65001 >nul 2>&1
448+
%powershell% -MTA -NoP -NoL -NonI -EP Bypass -c "Checkpoint-Computer -Description '%AS% Script Backup %date% %time%' -RestorePointType 'MODIFY_SETTINGS' -ErrorAction SilentlyContinue"&&(chcp 65001 >nul 2>&1&echo OK)||(chcp 65001 >nul 2>&1&%msg% "Skip" "Пропуск")
450449
call :RegSave
451450
md "%save%GroupPolicy">nul 2>&1
452451
md "%save%GroupPolicy\Machine">nul 2>&1
@@ -2027,7 +2026,7 @@ chcp 437 >nul 2>&1
20272026
chcp 65001 >nul 2>&1
20282027
%ifdef% secboot (echo %secb%ON) else (echo %secb%OFF)
20292028
%msg% "System analysis..." "Анализ системы..."
2030-
del /f /q "%pth%%AS%WTDS.txt">nul 2>&1
2029+
del /f /q "%tmp%%AS%WTDS.txt">nul 2>&1
20312030
if exist "%ProgramFiles%\%wd%\MsMpEng.exe" (set DefExist=1) else (set "DefExist=")
20322031
call :isProcess "MsMpEng.exe"&&set DefRun=1||set DefRun=
20332032
chcp 437 >nul 2>&1
@@ -2041,11 +2040,11 @@ chcp 65001 >nul 2>&1
20412040
set MpStatus=1
20422041
:SkipPSCheck
20432042
%ifdef% MpStatus goto :SkipRegCheck
2044-
(%rq% "HKLM\%smwd%" /v "%dl%AntiVirus" 2>nul|%find% "0x1">nul 2>&1)&&set "DefOn="||set DefOn=1
2045-
(%rq% "HKLM\%smwd%" /v "%dl%AntiSpyware" 2>nul|%find% "0x1">nul 2>&1)&&set "DefOn="
2046-
(%rq% "HKLM\%smwd%\Real-Time Protection" /v "%dl%RealtimeMonitoring" 2>nul|%find% "0x1">nul 2>&1)&&set "DefReal="||set DefReal=1
2047-
(%rq% "HKLM\%smwd%\Features" /v "TamperProtection" 2>nul|%find% "0x5">nul 2>&1)&&set "DefTamper=1"||set DefTamper=
2048-
(%rq% "HKLM\%smwd%" /v "VerifiedAndReputableTrustModeEnabled" 2>nul|%find% "0x0">nul 2>&1)&&set "DefSmart="||set DefSmart=1
2043+
(%rq% "HKLM\%smwd%">nul 2>&1)&&((%rq% "HKLM\%smwd%" /v "%dl%AntiVirus" 2>nul|%find% "0x1">nul 2>&1)&&set "DefOn="||set DefOn=1)||set "DefOn="
2044+
(%rq% "HKLM\%smwd%">nul 2>&1)&&((%rq% "HKLM\%smwd%" /v "%dl%AntiSpyware" 2>nul|%find% "0x1">nul 2>&1)&&set "DefOn=")||set "DefOn="
2045+
(%rq% "HKLM\%smwd%">nul 2>&1)&&((%rq% "HKLM\%smwd%\Real-Time Protection" /v "%dl%RealtimeMonitoring" 2>nul|%find% "0x1">nul 2>&1)&&set "DefReal="||set DefReal=1)||set "DefOn="
2046+
(%rq% "HKLM\%smwd%">nul 2>&1)&&((%rq% "HKLM\%smwd%\Features" /v "TamperProtection" 2>nul|%find% "0x5">nul 2>&1)&&set "DefTamper=1"||set DefTamper=)||set "DefOn="
2047+
(%rq% "HKLM\%smwd%" /v "VerifiedAndReputableTrustModeEnabled">nul 2>&1)&&((%rq% "HKLM\%smwd%" /v "VerifiedAndReputableTrustModeEnabled" 2>nul|%find% "0x0">nul 2>&1)&&set "DefSmart="||set DefSmart=1)||set "DefSmart="
20492048
:SkipRegCheck
20502049
%ifdef% DefExist (%ifdef% DefRun (%ifdef% DefOn (echo %defend%%ON%) else (echo %defend%%OFFRUN%)) else (echo %defend%%OFF%)) else (echo %defend%%DEL%)
20512050
%ifdef% DefReal (echo %realtime%%ON%) else (echo %realtime%%OFF%)
@@ -2067,8 +2066,8 @@ chcp 65001 >nul 2>&1
20672066
(%rq% "HKLM\%scc%\Lsa" /v "RunAsPPL" 2>nul|%find% "0x1">nul 2>&1)&&set DefLsaLock=1
20682067
(%rq% "HKLM\%spm%\Windows\System" /v "RunAsPPL" 2>nul|%find% "0x1">nul 2>&1)&&set DefLsaLock=1
20692068
%ifdef% DefLsaLock (echo %lsa%%ONLOCK%) else (%ifdef% DefLsa (echo %lsa%%ON%) else (echo %lsa%%OFF%))
2070-
(%rq% "HKLM\%scc%\CI\State" /v "HVCIEnabled" 2>nul|%find% "0x1">nul 2>&1)&&set DefCred=1||set DefCred=
2071-
(%rq% "HKLM\%sccd%\Scenarios\KeyGuard\Status" /v "CredGuardEnabled" 2>nul|%find% "0x1">nul 2>&1)&&set DefCred=1||set DefCred=
2069+
(%rq% "HKLM\%scc%\CI\State">nul 2>&1)&&((%rq% "HKLM\%scc%\CI\State" /v "HVCIEnabled" 2>nul|%find% "0x1">nul 2>&1)&&set DefCred=1||set DefCred=)||set DefCred=
2070+
(%rq% "HKLM\%sccd%\Scenarios\KeyGuard\Status">nul 2>&1)&&((%rq% "HKLM\%sccd%\Scenarios\KeyGuard\Status" /v "CredGuardEnabled" 2>nul|%find% "0x1">nul 2>&1)&&set DefCred=1||set DefCred=)||set DefCred=
20722071
%ifdef% DefCred (%rq% "HKLM\%sccd%\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Locked" 2>nul|%find% "0x1">nul 2>&1)&&set DefCredLock=1||set DefCredLock=
20732072
%ifdef% DefCredLock (echo %cred%%ONLOCK%) else (%ifdef% DefCred (echo %cred%%ON%) else (echo %cred%%OFF%))
20742073
set /a ASRCount=0
@@ -2110,18 +2109,19 @@ set /a SSCount=0
21102109
%ifdef% DefSmart set /a SSCount+=1&goto :SkipWTDS
21112110
%rq% "HKLM\%smw%\%cv%\WTDS">nul 2>&1||goto :SkipWTDS
21122111
%msg% "System analysis..." "Анализ системы..."
2113-
del /f /q "%pth%%AS%WTDS.txt">nul 2>&1
2114-
start /MIN %cmd% /c %Script% ti "%sys%:\windows\regedit.exe" /e "%pth%%AS%WTDS.txt" "HKEY_LOCAL_MACHINE\%smw%\%cv%\WTDS\Components"
2112+
del /f /q "%tmp%%AS%WTDS.txt">nul 2>&1
2113+
(%rq% "HKLM\%smw%\%cv%\WTDS">nul 2>&1)||goto :SkipWTDS
2114+
start /MIN call "%Script%" ti "%sys%:\windows\regedit.exe" /e "%tmp%%AS%WTDS.txt" "HKEY_LOCAL_MACHINE\%smw%\%cv%\WTDS"
21152115
set /a CheckFileCount=0
21162116
:CheckFileLoop
2117-
if exist "%pth%%AS%WTDS.txt" goto :FileFound
2117+
if exist "%tmp%%AS%WTDS.txt" goto :FileFound
21182118
set /a CheckFileCount+=1
21192119
if %CheckFileCount% geq 10000 goto :EndCheckFile
21202120
goto :CheckFileLoop
21212121
:FileFound
2122-
(type "%pth%%AS%WTDS.txt"|%find% """ServiceEnabled""=dword:00000000">nul 2>&1)||(%rq% "HKLM\%spm%\Windows\WTDS\Components" /v "ServiceEnabled" 2>nul|%find% "0x0">nul 2>&1||set /a SSCount+=1)
2122+
(type "%tmp%%AS%WTDS.txt"|%find% """ServiceEnabled""=dword:00000000">nul 2>&1)||(%rq% "HKLM\%spm%\Windows\WTDS\Components" /v "ServiceEnabled" 2>nul|%find% "0x0">nul 2>&1||set /a SSCount+=1)
21232123
:EndCheckFile
2124-
del /f /q "%pth%%AS%WTDS.txt">nul 2>&1
2124+
del /f /q "%tmp%%AS%WTDS.txt">nul 2>&1
21252125
:SkipWTDS
21262126
(%rq% "HKLM\%spmwd%" /v "PUAProtection" 2>nul|%find% "0x0">nul 2>&1)||(%rq% "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\%wd%" /v "PUAProtection" 2>nul|%find% "0x0">nul 2>&1||set /a SSCount+=1)
21272127
(%rq% "HKCU\%smw%\%cv%\AppHost" /v "EnableWebContentEvaluation" 2>nul|%find% "0x0">nul 2>&1)||set /a SSCount+=1

0 commit comments

Comments
 (0)