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
Applocker on Windows Home.
Message
<blockquote data-quote="Andy Ful" data-source="post: 1011641" data-attributes="member: 32260"><p>Hard_Configurator on Recommended_Settings does not require HomeAppLocker scripts. One can use modified scripts for Windows_10_Basic_Recommended_Settings, for example:</p><p></p><p>[CODE]<#</p><p>.SYNOPSIS</p><p> This function creates new AppLocker settings for SimpleWindowsHardening using MDM WMI Bridge.</p><p> All previous rules will be deleted.</p><p></p><p>.CREDITS</p><p> These scripts are based on the script for EXE files made by Sandy Zeng (Sandy Tsang).</p><p> https://github.com/sandytsang/MSIntune/tree/master/Intune-PowerShell/AppLocker</p><p>#></p><p></p><p>$namespaceName = "root\cimv2\mdm\dmmap" #Do not change this</p><p>$GroupName = "AppLocker001" #Your own groupName</p><p>$parentID = "./Vendor/MSFT/AppLocker/ApplicationLaunchRestrictions/$GroupName"</p><p></p><p>$classNameDLL = "MDM_AppLocker_DLL03" #Do not change this</p><p>Get-CimInstance -Namespace $namespaceName -ClassName $classNameDLL -Filter "ParentID=`'$parentID`' and InstanceID='DLL'" | Remove-CimInstance</p><p></p><p>$classNameEXE = "MDM_AppLocker_ApplicationLaunchRestrictions01_EXE03" #Do not change this</p><p>Get-CimInstance -Namespace $namespaceName -ClassName $classNameEXE -Filter "ParentID=`'$parentID`' and InstanceID='EXE'" | Remove-CimInstance</p><p></p><p>$classNameMSI = "MDM_AppLocker_MSI03" #Do not change this</p><p>Get-CimInstance -Namespace $namespaceName -ClassName $classNameMSI -Filter "ParentID=`'$parentID`' and InstanceID='MSI'" | Remove-CimInstance</p><p></p><p>$classNameScript = "MDM_AppLocker_Script03" #Do not change this</p><p>Get-CimInstance -Namespace $namespaceName -ClassName $classNameScript -Filter "ParentID=`'$parentID`' and InstanceID='Script'" | Remove-CimInstance</p><p></p><p>$classNameStoreApps = "MDM_AppLocker_ApplicationLaunchRestrictions01_StoreApps03"</p><p>Get-CimInstance -Namespace $namespaceName -ClassName $classNameStoreApps -Filter "ParentID=`'$parentID`' and InstanceID='Storeapps'" | Remove-CimInstance</p><p></p><p>Add-Type -AssemblyName System.Web</p><p></p><p>#This is example Rule Collection for EXE</p><p>$obj = [System.Net.WebUtility]::HtmlEncode(@"</p><p> <RuleCollection Type="Exe" EnforcementMode="Enabled"></p><p> <FilePathRule Id="921cc481-6e17-4653-8f75-050b80acca20" Name="All files in the Program Files folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePathCondition Path="%PROGRAMFILES%\*" /></p><p> </Conditions></p><p> </FilePathRule></p><p> <FilePathRule Id="a61c8b2c-a319-4cd0-9690-d2177cad7b51" Name="All files in the Windows folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePathCondition Path="%WINDIR%\*" /></p><p> </Conditions></p><p> </FilePathRule></p><p> <FilePublisherRule Id="9ab086ea-40a8-4b05-875b-f9fdf9962ba8" Name="All signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"></p><p> <BinaryVersionRange LowSection="*" HighSection="*" /></p><p> </FilePublisherCondition></p><p> </Conditions></p><p> </FilePublisherRule></p><p> </RuleCollection></p><p>"@)</p><p>New-CimInstance -Namespace $namespaceName -ClassName $classNameEXE -Property @{ParentID=$parentID;InstanceID="EXE";Policy=$obj}</p><p></p><p></p><p>#This is example Rule Collection for MSI</p><p>$obj = [System.Net.WebUtility]::HtmlEncode(@"</p><p> <RuleCollection Type="Msi" EnforcementMode="Enabled"></p><p> <FilePublisherRule Id="b7af7102-efde-4369-8a89-7a6a392d1473" Name="All signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"></p><p> <BinaryVersionRange LowSection="0.0.0.0" HighSection="*" /></p><p> </FilePublisherCondition></p><p> </Conditions></p><p> </FilePublisherRule></p><p> <FilePathRule Id="5b290184-345a-4453-b184-45305f6d9a54" Name="All files in the folder %systemdrive%\Windows\Installer." Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePathCondition Path="%WINDIR%\Installer\*" /></p><p> </Conditions></p><p> </FilePathRule></p><p> <FilePathRule Id="64ad46ff-0d71-4fa0-a30b-3f3d30c5433d" Name="Allow for Administrators" Description="" UserOrGroupSid="S-1-5-32-544" Action="Allow"></p><p> <Conditions></p><p> <FilePathCondition Path="*.*" /></p><p> </Conditions></p><p> </FilePathRule></p><p> </RuleCollection></p><p>"@)</p><p>New-CimInstance -Namespace $namespaceName -ClassName $classNameMSI -Property @{ParentID=$parentID;InstanceID="MSI";Policy=$obj}</p><p></p><p></p><p>$obj = [System.Net.WebUtility]::HtmlEncode(@"</p><p> <RuleCollection Type="Dll" EnforcementMode="Enabled"></p><p> <FilePathRule Id="bac4b0bf-6f1b-40e8-8627-8545fa89c8b6" Name="All DLLs in Windows folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePathCondition Path="%WINDIR%\*" /></p><p> </Conditions></p><p> </FilePathRule></p><p> <FilePathRule Id="3737732c-99b7-41d4-9037-9cddfb0de0d0" Name="All DLLs in Program Files folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePathCondition Path="%PROGRAMFILES%\*" /></p><p> </Conditions></p><p> </FilePathRule></p><p> <FilePublisherRule Id="1f0d0ec5-8523-4aa0-976a-ad2d2c21eed7" Name="All Signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"></p><p> <BinaryVersionRange LowSection="*" HighSection="*" /></p><p> </FilePublisherCondition></p><p> </Conditions></p><p> </FilePublisherRule></p><p> </RuleCollection></p><p>"@)</p><p>New-CimInstance -Namespace $namespaceName -ClassName $classNameDLL -Property @{ParentID=$parentID;InstanceID="DLL";Policy=$obj}</p><p></p><p></p><p>$obj = [System.Net.WebUtility]::HtmlEncode(@"</p><p> <RuleCollection Type="Appx" EnforcementMode="Enabled"></p><p> <FilePublisherRule Id="a9e18c21-ff8f-43cf-b9fc-db40eed693ba" Name="All signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"></p><p> <Conditions></p><p> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"></p><p> <BinaryVersionRange LowSection="0.0.0.0" HighSection="*" /></p><p> </FilePublisherCondition></p><p> </Conditions></p><p> </FilePublisherRule></p><p> </RuleCollection></p><p>"@)</p><p>New-CimInstance -Namespace $namespaceName -ClassName $classNameStoreApps -Property @{ParentID=$parentID;InstanceID="Storeapps";Policy=$obj}</p><p></p><p>[/CODE]</p><p></p><p>The above script is similar to the previous one, but the Script section is deleted (H_C settings provide better script protection).</p><p></p><p>The script that removes restrictions is like in my previous post.</p><p></p><p><strong><span style="color: rgb(184, 49, 47)">Warning!!!</span></strong></p><p><strong><span style="color: rgb(184, 49, 47)">I strongly recommend making a System Restore Point before applying the Applocker rules.</span></strong></p><p><strong></strong></p><p><strong>Post updated.</strong></p></blockquote><p></p>
[QUOTE="Andy Ful, post: 1011641, member: 32260"] Hard_Configurator on Recommended_Settings does not require HomeAppLocker scripts. One can use modified scripts for Windows_10_Basic_Recommended_Settings, for example: [CODE]<# .SYNOPSIS This function creates new AppLocker settings for SimpleWindowsHardening using MDM WMI Bridge. All previous rules will be deleted. .CREDITS These scripts are based on the script for EXE files made by Sandy Zeng (Sandy Tsang). https://github.com/sandytsang/MSIntune/tree/master/Intune-PowerShell/AppLocker #> $namespaceName = "root\cimv2\mdm\dmmap" #Do not change this $GroupName = "AppLocker001" #Your own groupName $parentID = "./Vendor/MSFT/AppLocker/ApplicationLaunchRestrictions/$GroupName" $classNameDLL = "MDM_AppLocker_DLL03" #Do not change this Get-CimInstance -Namespace $namespaceName -ClassName $classNameDLL -Filter "ParentID=`'$parentID`' and InstanceID='DLL'" | Remove-CimInstance $classNameEXE = "MDM_AppLocker_ApplicationLaunchRestrictions01_EXE03" #Do not change this Get-CimInstance -Namespace $namespaceName -ClassName $classNameEXE -Filter "ParentID=`'$parentID`' and InstanceID='EXE'" | Remove-CimInstance $classNameMSI = "MDM_AppLocker_MSI03" #Do not change this Get-CimInstance -Namespace $namespaceName -ClassName $classNameMSI -Filter "ParentID=`'$parentID`' and InstanceID='MSI'" | Remove-CimInstance $classNameScript = "MDM_AppLocker_Script03" #Do not change this Get-CimInstance -Namespace $namespaceName -ClassName $classNameScript -Filter "ParentID=`'$parentID`' and InstanceID='Script'" | Remove-CimInstance $classNameStoreApps = "MDM_AppLocker_ApplicationLaunchRestrictions01_StoreApps03" Get-CimInstance -Namespace $namespaceName -ClassName $classNameStoreApps -Filter "ParentID=`'$parentID`' and InstanceID='Storeapps'" | Remove-CimInstance Add-Type -AssemblyName System.Web #This is example Rule Collection for EXE $obj = [System.Net.WebUtility]::HtmlEncode(@" <RuleCollection Type="Exe" EnforcementMode="Enabled"> <FilePathRule Id="921cc481-6e17-4653-8f75-050b80acca20" Name="All files in the Program Files folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePathCondition Path="%PROGRAMFILES%\*" /> </Conditions> </FilePathRule> <FilePathRule Id="a61c8b2c-a319-4cd0-9690-d2177cad7b51" Name="All files in the Windows folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePathCondition Path="%WINDIR%\*" /> </Conditions> </FilePathRule> <FilePublisherRule Id="9ab086ea-40a8-4b05-875b-f9fdf9962ba8" Name="All signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"> <BinaryVersionRange LowSection="*" HighSection="*" /> </FilePublisherCondition> </Conditions> </FilePublisherRule> </RuleCollection> "@) New-CimInstance -Namespace $namespaceName -ClassName $classNameEXE -Property @{ParentID=$parentID;InstanceID="EXE";Policy=$obj} #This is example Rule Collection for MSI $obj = [System.Net.WebUtility]::HtmlEncode(@" <RuleCollection Type="Msi" EnforcementMode="Enabled"> <FilePublisherRule Id="b7af7102-efde-4369-8a89-7a6a392d1473" Name="All signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"> <BinaryVersionRange LowSection="0.0.0.0" HighSection="*" /> </FilePublisherCondition> </Conditions> </FilePublisherRule> <FilePathRule Id="5b290184-345a-4453-b184-45305f6d9a54" Name="All files in the folder %systemdrive%\Windows\Installer." Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePathCondition Path="%WINDIR%\Installer\*" /> </Conditions> </FilePathRule> <FilePathRule Id="64ad46ff-0d71-4fa0-a30b-3f3d30c5433d" Name="Allow for Administrators" Description="" UserOrGroupSid="S-1-5-32-544" Action="Allow"> <Conditions> <FilePathCondition Path="*.*" /> </Conditions> </FilePathRule> </RuleCollection> "@) New-CimInstance -Namespace $namespaceName -ClassName $classNameMSI -Property @{ParentID=$parentID;InstanceID="MSI";Policy=$obj} $obj = [System.Net.WebUtility]::HtmlEncode(@" <RuleCollection Type="Dll" EnforcementMode="Enabled"> <FilePathRule Id="bac4b0bf-6f1b-40e8-8627-8545fa89c8b6" Name="All DLLs in Windows folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePathCondition Path="%WINDIR%\*" /> </Conditions> </FilePathRule> <FilePathRule Id="3737732c-99b7-41d4-9037-9cddfb0de0d0" Name="All DLLs in Program Files folder" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePathCondition Path="%PROGRAMFILES%\*" /> </Conditions> </FilePathRule> <FilePublisherRule Id="1f0d0ec5-8523-4aa0-976a-ad2d2c21eed7" Name="All Signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"> <BinaryVersionRange LowSection="*" HighSection="*" /> </FilePublisherCondition> </Conditions> </FilePublisherRule> </RuleCollection> "@) New-CimInstance -Namespace $namespaceName -ClassName $classNameDLL -Property @{ParentID=$parentID;InstanceID="DLL";Policy=$obj} $obj = [System.Net.WebUtility]::HtmlEncode(@" <RuleCollection Type="Appx" EnforcementMode="Enabled"> <FilePublisherRule Id="a9e18c21-ff8f-43cf-b9fc-db40eed693ba" Name="All signed" Description="" UserOrGroupSid="S-1-1-0" Action="Allow"> <Conditions> <FilePublisherCondition PublisherName="*" ProductName="*" BinaryName="*"> <BinaryVersionRange LowSection="0.0.0.0" HighSection="*" /> </FilePublisherCondition> </Conditions> </FilePublisherRule> </RuleCollection> "@) New-CimInstance -Namespace $namespaceName -ClassName $classNameStoreApps -Property @{ParentID=$parentID;InstanceID="Storeapps";Policy=$obj} [/CODE] The above script is similar to the previous one, but the Script section is deleted (H_C settings provide better script protection). The script that removes restrictions is like in my previous post. [B][COLOR=rgb(184, 49, 47)]Warning!!! I strongly recommend making a System Restore Point before applying the Applocker rules.[/COLOR] Post updated.[/B] [/QUOTE]
Insert quotes…
Verification
Post reply
Top