Forums
New posts
Search forums
News
Security News
Technology News
Giveaways
Giveaways, Promotions and Contests
Discounts & Deals
Reviews
Users Reviews
Video Reviews
Support
Windows Malware Removal Help & Support
Inactive Support Threads
Mac Malware Removal Help & Support
Mobile Malware Removal Help & Support
Blog
Log in
Register
What's new
Search
Search titles only
By:
Search titles only
By:
Reply to thread
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Software
Security Apps
Hard_Configurator Tools
Hard_Configurator - Windows Hardening Configurator
Message
<blockquote data-quote="Andy Ful" data-source="post: 1121759" data-attributes="member: 32260"><p>Thanks for providing the script, although users can simply run H_C to see if the left panel is active.</p><p>I think that one script might be enough.</p><p></p><p>[CODE]#Script confirms the state of SRP (ON/OFF) settings in Hard_Configurator.</p><p># Define the registry path and value name</p><p>$RegistryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\safer_Hard_Configurator\CodeIdentifiers'</p><p>$ValueName = 'TurnOFFAllSRP'</p><p># Check if the registry key exists</p><p>if (Test-Path $RegistryPath) {</p><p> # Get the registry value</p><p> $RegistryValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue</p><p> # Check if the value exists and equals '1'</p><p> if ($RegistryValue.$ValueName -eq '1') {</p><p> Write-Output 'SRP settings in H_C are turned OFF.'</p><p> } else {</p><p> Write-Output 'SRP settings in H_C are turned ON.'</p><p> }</p><p>} else {</p><p> Write-Output 'SRP settings in H_C are turned OFF.'</p><p>}[/CODE]</p><p></p><p>A similar scripting code can be inserted into the batch script that runs PowerShell with CmdLines. The batch script can be whitelisted in SRP and added to autoruns (whitelisted batch script works even if cmd[.]exe is blocked in SRP). Otherwise, the PowerShell script would be blocked by < Block PowerShell Scripts >.</p><p>The code can be modified to show the alert only if SRP settings are Switched OFF.</p><p></p><p></p><p>Post edited.</p><p>Another possibility is creating a batch file that runs SwitchDefaultDeny (instead of alert), when SRP is Switched OFF. </p><p>If SRP is turned ON or SRP is not installed, the script does nothing:</p><p>[CODE]%Windir%\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -WindowStyle hidden $RegistryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\safer_Hard_Configurator\CodeIdentifiers'; $ValueName = 'TurnOFFAllSRP'; $RegistryValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue; if ($RegistryValue.$ValueName -eq '1'){Start-Process -FilePath $Env:WinDir'\Hard_Configurator\SwitchDefaultDeny(x64).exe'}[/CODE]</p></blockquote><p></p>
[QUOTE="Andy Ful, post: 1121759, member: 32260"] Thanks for providing the script, although users can simply run H_C to see if the left panel is active. I think that one script might be enough. [CODE]#Script confirms the state of SRP (ON/OFF) settings in Hard_Configurator. # Define the registry path and value name $RegistryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\safer_Hard_Configurator\CodeIdentifiers' $ValueName = 'TurnOFFAllSRP' # Check if the registry key exists if (Test-Path $RegistryPath) { # Get the registry value $RegistryValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue # Check if the value exists and equals '1' if ($RegistryValue.$ValueName -eq '1') { Write-Output 'SRP settings in H_C are turned OFF.' } else { Write-Output 'SRP settings in H_C are turned ON.' } } else { Write-Output 'SRP settings in H_C are turned OFF.' }[/CODE] A similar scripting code can be inserted into the batch script that runs PowerShell with CmdLines. The batch script can be whitelisted in SRP and added to autoruns (whitelisted batch script works even if cmd[.]exe is blocked in SRP). Otherwise, the PowerShell script would be blocked by < Block PowerShell Scripts >. The code can be modified to show the alert only if SRP settings are Switched OFF. Post edited. Another possibility is creating a batch file that runs SwitchDefaultDeny (instead of alert), when SRP is Switched OFF. If SRP is turned ON or SRP is not installed, the script does nothing: [CODE]%Windir%\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -WindowStyle hidden $RegistryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\safer_Hard_Configurator\CodeIdentifiers'; $ValueName = 'TurnOFFAllSRP'; $RegistryValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue; if ($RegistryValue.$ValueName -eq '1'){Start-Process -FilePath $Env:WinDir'\Hard_Configurator\SwitchDefaultDeny(x64).exe'}[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Top