{"uuid": "36ed6a30-3021-476b-8309-e67ef3103635", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "9f56dd64-161d-43a6-b9c3-555944290a09", "vulnerability": "CVE-2020-16898", "type": "seen", "source": "https://gist.github.com/ryan-mclean-edf/8b6a4fff415f6fbba24d92cd6acd3482", "content": ":: Windows 10 Hardening Script\n:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering. \n:: Obligatory 'views are my own'. :) \n:: Thank you @jaredhaight for the Win Firewall config recommendations!\n:: Thank you @ricardojba for the DLL Safe Order Search reg key! \n:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!\n:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater\n::\n::#######################################################################\n::\n:: Change file associations to protect against common ransomware attacks\n:: Note that if you legitimately use these extensions, like .bat, you will now need to execute them manually from cmd or powershel\n:: Alternatively, you can right-click on them and hit 'Run as Administrator' but ensure it's a script you want to run :) \n:: https://support.microsoft.com/en-us/help/883260/information-about-the-attachment-manager-in-microsoft-windows\n:: ---------------------\nftype htafile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype wshfile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype wsffile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype batfile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype jsfile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype jsefile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype vbefile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\nftype vbsfile=\"%SystemRoot%\\system32\\NOTEPAD.EXE\" \"%1\"\n::\n::#######################################################################\n:: Enable and configure Windows Defender and advanced settings\n::#######################################################################\n::\n:: Reset Defender to defaults. Commented out but available for reference\n::\"%programfiles%\"\\\"Windows Defender\"\\MpCmdRun.exe -RestoreDefaults\n:: https://docs.microsoft.com/en-us/windows/client-management/mdm/policy-csp-defender#defender-submitsamplesconsent\n:: https://docs.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=win10-ps\n::\n:: Start Defender Service\nsc start WinDefend\n::Enable Windows Defender sandboxing\nsetx /M MP_FORCE_USE_SANDBOX 1\n:: Update signatures\n\"%ProgramFiles%\"\\\"Windows Defender\"\\MpCmdRun.exe -SignatureUpdate\n:: Enable Defender signatures for Potentially Unwanted Applications (PUA)\npowershell.exe Set-MpPreference -PUAProtection enable\n:: Enable Defender periodic scanning\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows Defender\" /v PassiveMode /t REG_DWORD /d 2 /f\n:: Enable Cloud functionality of Windows Defender\npowershell.exe Set-MpPreference -MAPSReporting Advanced\npowershell.exe Set-MpPreference -SubmitSamplesConsent 0\n::\n:: Enable early launch antimalware driver for scan of boot-start drivers\n:: 3 is the default which allows good, unknown and 'bad but critical'. Recommend trying 1 for 'good and unknown' or 8 which is 'good only'\nreg add \"HKCU\\SYSTEM\\CurrentControlSet\\Policies\\EarlyLaunch\" /v DriverLoadPolicy /t REG_DWORD /d 3 /f\n::\n:: Enable ASR rules in Win10 1903 ExploitGuard to mitigate Office malspam\n:: Blocks Office childprocs, Office proc injection, Office win32 api calls &amp; executable content creation\n:: Note these only work when Defender is your primary AV\n::\n:: Block Office Child Process Creation \npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EFC-AADC-AD5F3C50688A -AttackSurfaceReductionRules_Actions Enabled\n:: Block Process Injection\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -AttackSurfaceReductionRules_Actions Enabled\n:: Block Win32 API calls in macros\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -AttackSurfaceReductionRules_Actions Enabled\n:: Block Office from creating executables\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 3B576869-A4EC-4529-8536-B80A7769E899 -AttackSurfaceReductionRules_Actions Enabled\n:: Block execution of potentially obfuscated scripts\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -AttackSurfaceReductionRules_Actions Enabled\n:: Block executable content from email client and webmail\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -AttackSurfaceReductionRules_Actions Enabled\n:: Block JavaScript or VBScript from launching downloaded executable content\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids D3E037E1-3EB8-44C8-A917-57927947596D -AttackSurfaceReductionRules_Actions Enabled\n:: Block lsass cred theft\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Enabled\n:: Block untrusted and unsigned processes that run from USB\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 -AttackSurfaceReductionRules_Actions Enabled\n:: Block Adobe Reader from creating child processes\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c -AttackSurfaceReductionRules_Actions Enabled\n:: Block persistence through WMI event subscription\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids e6db77e5-3df2-4cf1-b95a-636979351e5b -AttackSurfaceReductionRules_Actions Enabled\n:: Block process creations originating from PSExec and WMI commands\npowershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids d1e49aac-8f56-4280-b9ba-993a6d77406c -AttackSurfaceReductionRules_Actions Enabled\n::\n:: Enable Defender exploit system-wide protection\n:: The commented line includes CFG which can cause issues with apps like Discord &amp; Mouse Without Borders\n:: powershell.exe Set-Processmitigation -System -Enable DEP,EmulateAtlThunks,BottomUp,HighEntropy,SEHOP,SEHOPTelemetry,TerminateOnError,CFG\npowershell.exe Set-Processmitigation -System -Enable DEP,EmulateAtlThunks,BottomUp,HighEntropy,SEHOP,SEHOPTelemetry,TerminateOnError\n::\n::#######################################################################\n:: Enable and Configure Internet Browser Settings\n::#######################################################################\n::\n:: Enable SmartScreen for Edge\nreg add \"HKCU\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\PhishingFilter\" /v EnabledV9 /t REG_DWORD /d 1 /f\n:: Enable Notifications in IE when a site attempts to install software\nreg add \"HKCU\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer\" /v SafeForScripting /t REG_DWORD /d 0 /f\n:: Disable Edge password manager to encourage use of proper password manager\nreg add \"HKCU\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\Main\" /v \"FormSuggest Passwords\" /t REG_SZ /d no /f\n::\n::#######################################################################\n:: Enable and Configure Google Chrome Internet Browser Settings\n::#######################################################################\n::\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"AdvancedProtectionAllowed\" /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"AllowCrossOriginAuthPrompt\" /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"AlwaysOpenPdfExternally\" /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"AmbientAuthenticationInPrivateModesEnabled\" /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"AudioCaptureAllowed\" /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"AudioSandboxEnabled\" /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"BlockExternalExtensions\" /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"DnsOverHttpsMode\" /t REG_SZ /d on /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"SSLVersionMin\" /t REG_SZ /d tls1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"ScreenCaptureAllowed\" /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"SitePerProcess\" /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"TLS13HardeningForLocalAnchorsEnabled\" /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Google\\Chrome\" /v \"VideoCaptureAllowed\" /t REG_DWORD /d 0 /f\n::\n::#######################################################################\n:: Enable and Configure Microsoft Office Security Settings\n::#######################################################################\n::\n:: Harden all version of MS Office itself against common malspam attacks\n:: Disables Macros, enables ProtectedView\n:: ---------------------\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\12.0\\Publisher\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\12.0\\Word\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\14.0\\Publisher\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\14.0\\Word\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\15.0\\Outlook\\Security\" /v markinternalasunsafe /t REG_DWORD /d 0 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\15.0\\Word\\Security\" /v blockcontentexecutionfrominternet /t REG_DWORD /d 1 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\15.0\\Excel\\Security\" /v blockcontentexecutionfrominternet /t REG_DWORD /d 1 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\15.0\\PowerPoint\\Security\" /v blockcontentexecutionfrominternet /t REG_DWORD /d 1 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\15.0\\Word\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\15.0\\Publisher\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\16.0\\Outlook\\Security\" /v markinternalasunsafe /t REG_DWORD /d 0 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\16.0\\Word\\Security\" /v blockcontentexecutionfrominternet /t REG_DWORD /d 1 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\16.0\\Excel\\Security\" /v blockcontentexecutionfrominternet /t REG_DWORD /d 1 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\16.0\\PowerPoint\\Security\" /v blockcontentexecutionfrominternet /t REG_DWORD /d 1 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\16.0\\Word\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\nreg add \"HKCU\\Software\\Policies\\Microsoft\\Office\\16.0\\Publisher\\Security\" /v vbawarnings /t REG_DWORD /d 4 /f\n::\n:: Harden all version of MS Office itself against DDE malspam attacks\n:: Disables Macros, enables ProtectedView\n:: ---------------------\n::\nreg add \"HKCU\\Software\\Microsoft\\Office\\14.0\\Word\\Options\" /v DontUpdateLinks /t REG_DWORD /d 00000001 /f\nreg add \"HKCU\\Software\\Microsoft\\Office\\14.0\\Word\\Options\\WordMail\" /v DontUpdateLinks /t REG_DWORD /d 00000001 /f\nreg add \"HKCU\\Software\\Microsoft\\Office\\15.0\\Word\\Options\" /v DontUpdateLinks /t REG_DWORD /d 00000001 /f\nreg add \"HKCU\\Software\\Microsoft\\Office\\15.0\\Word\\Options\\WordMail\" /v DontUpdateLinks /t REG_DWORD /d 00000001 /f\nreg add \"HKCU\\Software\\Microsoft\\Office\\16.0\\Word\\Options\" /v DontUpdateLinks /t REG_DWORD /d 00000001 /f\nreg add \"HKCU\\Software\\Microsoft\\Office\\16.0\\Word\\Options\\WordMail\" /v DontUpdateLinks /t REG_DWORD /d 00000001 /f\n::\n::#######################################################################\n:: Enable and Configure General Windows Security Settings\n::#######################################################################\n:: Disables DNS multicast, smart mutli-homed resolution, netbios, powershellv2, printer driver download and printing over http, icmp redirect\n:: Enables UAC and sets to always notify, Safe DLL loading (DLL Hijacking prevention), saving zone information, explorer DEP, explorer shell protocol protected mode\n:: ---------------------\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient\" /v EnableMulticast /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient\" /v DisableSmartNameResolution /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Dnscache\\Parameters\" /v DisableParallelAandAAAA /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\" /v SMB1 /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" /v IGMPLevel /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" /v DisableIPSourceRouting /t REG_DWORD /d 2 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\" /v EnableICMPRedirect /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters\" /v DisableIPSourceRouting /t REG_DWORD /d 2 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" /v EnableLUA /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" /v EnableVirtualization /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 2 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\" /v SafeDLLSearchMode /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\" /v ProtectionMode /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Attachments\" /v SaveZoneInformation /t REG_DWORD /d 2 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" /v NoDataExecutionPrevention /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" /v NoHeapTerminationOnCorruption /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" /v PreXPSP2ShellProtocolBehavior /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers\" /v DisableWebPnPDownload /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Printers\" /v DisableHTTPPrinting /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\" /v AutoConnectAllowedOEM /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WcmSvc\\GroupPolicy\" /v fMinimizeConnections /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netbt\\Parameters\" /v NoNameReleaseOnDemand /t REG_DWORD /d 1 /f\nwmic /interactive:off nicconfig where (TcpipNetbiosOptions=0 OR TcpipNetbiosOptions=1) call SetTcpipNetbios 2\npowershell.exe Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2 -norestart\npowershell.exe Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root -norestart\n::\n:: Prioritize ECC Curves with longer keys\n::reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Cryptography\\Configuration\\SSL\\00010002\" /v EccCurves /t REG_MULTI_SZ /d NistP384,NistP256 /f\n:: Prevent Kerberos from using DES or RC4\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Kerberos\\Parameters\" /v SupportedEncryptionTypes /t REG_DWORD /d 2147483640 /f\n:: Encrypt and sign outgoing secure channel traffic when possible\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\" /v SealSecureChannel /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\" /v SignSecureChannel /t REG_DWORD /d 1 /f\n::\n:: Enable SmartScreen\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" /v EnableSmartScreen /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" /v ShellSmartScreenLevel /t REG_SZ /d Block /f\n::\n:: Enforce device driver signing\nBCDEDIT /set nointegritychecks OFF\n::\n:: Windows Update Settings\n:: Prevent Delivery Optimization from downloading Updates from other computers across the internet\n:: 1 will restrict to LAN only. 0 will disable the feature entirely\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeliveryOptimization\" /v DODownloadMode /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config\\\" /v DODownloadMode /t REG_DWORD /d 1 /f\n::\n:: Set screen saver inactivity timeout to 15 minutes\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" /v InactivityTimeoutSecs /t REG_DWORD /d 900 /f\n:: Enable password prompt on sleep resume while plugged in and on battery\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Power\\PowerSettings\\0e796bdb-100d-47d6-a2d5-f7d2daa51f51\" /v ACSettingIndex /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Power\\PowerSettings\\0e796bdb-100d-47d6-a2d5-f7d2daa51f51\" /v DCSettingIndex /t REG_DWORD /d 1 /f\n::\n:: Windows Remote Access Settings\n:: Disable solicited remote assistance\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\" /v fAllowToGetHelp /t REG_DWORD /d 0 /f\n:: Require encrypted RPC connections to Remote Desktop\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\" /v fEncryptRPCTraffic /t REG_DWORD /d 1 /f\n:: Prevent sharing of local drives via Remote Desktop Session Hosts\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services\" /v fDisableCdm /t REG_DWORD /d 1 /f\n:: \n:: Removal Media Settings\n:: Disable autorun/autoplay on all drives\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" /v NoAutoplayfornonVolume /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\Explorer\" /v NoDriveTypeAutoRun /t REG_DWORD /d 255 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" /v NoAutorun /t REG_DWORD /d 1 /f\n::\n:: Windows Sharing/SMB Settings\n:: Disable smb1, anonymous access to named pipes/shared, anonymous enumeration of SAM accounts, non-admin remote access to SAM\n:: Enable optional SMB client signing\npowershell.exe Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -norestart\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\mrxsmb10\" /v Start /t REG_DWORD /d 4 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\" /v SMB1 /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\" /v RestrictNullSessAccess /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v RestrictAnonymousSAM /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v RestrictAnonymous /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v EveryoneIncludesAnonymous /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v RestrictRemoteSAM /t REG_SZ /d \"O:BAG:BAD:(A;;RC;;;BA)\" /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v UseMachineId /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v LimitBlankPasswordUse /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\LSA\\MSV1_0\" /v allownullsessionfallback /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\" /v EnableSecuritySignature /t REG_DWORD /d 1 /f\n:: Force SMB server signing\n:: This could cause impact if the Windows computer this is run on is hosting a file share and the other computers connecting to it do not have SMB client signing enabled.\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\" /v RequireSecuritySignature /t REG_DWORD /d 1 /f\n::\n:: Harden lsass to help protect against credential dumping (mimikatz) and audit lsass access requests\n:: Configures lsass.exe as a protected process and disables wdigest\n:: Enables delegation of non-exported credentials which enables support for Restricted Admin Mode or Remote Credential Guard\n:: ---------------------\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\LSASS.exe\" /v AuditLevel /t REG_DWORD /d 00000008 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v RunAsPPL /t REG_DWORD /d 00000001 /f\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\WDigest\" /v UseLogonCredential /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\CredentialsDelegation\" /v AllowProtectedCreds /t REG_DWORD /d 1 /f\n::\n:: Windows RPC and WinRM settings\n:: Stop WinRM\nnet stop WinRM\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Service\" /v AllowUnencryptedTraffic /t REG_DWORD /d 0 /f\n:: Disable WinRM Client Digiest authentication\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WinRM\\Client\" /v AllowDigest /t REG_DWORD /d 0 /f\n:: Disabling RPC usage from a remote asset interacting with scheduled tasks\nreg add \"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\" /v DisableRpcOverTcp /t REG_DWORD /d 1 /f\n:: Disabling RPC usage from a remote asset interacting with services\nreg add \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\" /v DisableRemoteScmEndpoints /t REG_DWORD /d 1 /f\n::\n:: Biometrics\n:: Enable anti-spoofing for facial recognition\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Biometrics\\FacialFeatures\" /v EnhancedAntiSpoofing /t REG_DWORD /d 1 /f\n:: Disable other camera use while screen is locked\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\" /v NoLockScreenCamera /t REG_DWORD /d 1 /f\n:: Prevent Windows app voice activation while locked\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\AppPrivacy\" /v LetAppsActivateWithVoiceAboveLock /t REG_DWORD /d 2 /f\n:: Prevent Windows app voice activation entirely (be mindful of those with accesibility needs)\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\AppPrivacy\" /v LetAppsActivateWithVoice /t REG_DWORD /d 2 /f\n::\n::#######################################################################\n:: Enable and configure Windows Firewall\n::#######################################################################\n::\nNetSh Advfirewall set allprofiles state on\n::\n:: Enable Firewall Logging\nnetsh advfirewall set currentprofile logging filename %systemroot%\\system32\\LogFiles\\Firewall\\pfirewall.log\nnetsh advfirewall set currentprofile logging maxfilesize 4096\nnetsh advfirewall set currentprofile logging droppedconnections enable\n::\n:: Block all inbound connections on Public profile\nnetsh advfirewall set publicprofile firewallpolicy blockinboundalways,allowoutbound\n:: Enable Windows Defender Network Protection\npowershell.exe Set-MpPreference -EnableNetworkProtection Enabled\n::\n:: Block Win32 binaries from making netconns when they shouldn't - specifically targeting native processes known to be abused by bad actors\n:: ---------------------\nNetsh.exe advfirewall firewall add rule name=\"Block Notepad.exe netconns\" program=\"%systemroot%\\system32\\notepad.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block regsvr32.exe netconns\" program=\"%systemroot%\\system32\\regsvr32.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block calc.exe netconns\" program=\"%systemroot%\\system32\\calc.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block mshta.exe netconns\" program=\"%systemroot%\\system32\\mshta.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block wscript.exe netconns\" program=\"%systemroot%\\system32\\wscript.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block cscript.exe netconns\" program=\"%systemroot%\\system32\\cscript.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block runscripthelper.exe netconns\" program=\"%systemroot%\\system32\\runscripthelper.exe\" protocol=tcp dir=out enable=yes action=block profile=any\nNetsh.exe advfirewall firewall add rule name=\"Block hh.exe netconns\" program=\"%systemroot%\\system32\\hh.exe\" protocol=tcp dir=out enable=yes action=block profile=any\n::\n::Netsh.exe int ipv6 set int *INTERFACENUMBER* rabaseddnsconfig=disable\n::https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-16898\n::#######################################################################\n:: Windows 10 Privacy Settings\n::#######################################################################\n::\n:: Set Windows Analytics to limited enhanced if enhanced is enabled\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" /v LimitEnhancedDiagnosticDataWindowsAnalytics /t REG_DWORD /d 1 /f\n:: Set Windows Telemetry to security only\n:: If you intend to use Enhanced for Windows Analytics then set this to \"2\" instead\n:: Note my understanding is W10 Home edition will do a minimum of \"Basic\"\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" /v AllowTelemetry /t REG_DWORD /d 0 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" /v MaxTelemetryAllowed /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Diagnostics\\DiagTrack\" /v ShowedToastAtLevel /t REG_DWORD /d 1 /f\n:: Disable location data\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\" /v Location /t REG_SZ /d Deny /f\n:: Prevent the Start Menu Search from providing internet results and using your location\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" /v BingSearchEnabled /t REG_DWORD /d 0 /f\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" /v AllowSearchToUseLocation /t REG_DWORD /d 0 /f\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" /v CortanaConsent /t REG_DWORD /d 0 /f\n:: Disable publishing of Win10 user activity \nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" /v PublishUserActivities /t REG_DWORD /d 1 /f\n:: Disable Win10 settings sync to cloud\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\SettingSync\" /v DisableSettingSync /t REG_DWORD /d 2 /f\n:: Disable the advertising ID\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo\" /v DisabledByGroupPolicy /t REG_DWORD /d 1 /f\n::\n:: Disable Windows GameDVR (Broadcasting and Recording)\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR\" /v AllowGameDVR /t REG_DWORD /d 0 /f\n:: Disable Microsoft consumer experience which prevent notifications of suggested applications to install\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" /v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" /v SystemPaneSuggestionsEnabled /t REG_DWORD /d 0 /f\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" /v SilentInstalledAppsEnabled /t REG_DWORD /d 0 /f\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" /v PreInstalledAppsEnabled /t REG_DWORD /d 0 /f\nreg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" /v OemPreInstalledAppsEnabled /t REG_DWORD /d 0 /f\n:: Disable websites accessing local language list\nreg add \"HKCU\\Control Panel\\International\\User Profile\" /v HttpAcceptLanguageOptOut /t REG_DWORD /d 1 /f\n:: Prevent toast notifications from appearing on lock screen\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\" /v NoToastApplicationNotificationOnLockScreen /t REG_DWORD /d 1 /f\n::\n::#######################################################################\n:: Enable Advanced Windows Logging\n::#######################################################################\n::\n:: Enlarge Windows Event Security Log Size\nwevtutil sl Security /ms:1024000\nwevtutil sl Application /ms:1024000\nwevtutil sl System /ms:1024000\nwevtutil sl \"Windows Powershell\" /ms:1024000\nwevtutil sl \"Microsoft-Windows-PowerShell/Operational\" /ms:1024000\n:: Record command line data in process creation events eventid 4688\nreg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\\Audit\" /v ProcessCreationIncludeCmdLine_Enabled /t REG_DWORD /d 1 /f\n::\n:: Enabled Advanced Settings\nreg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v SCENoApplyLegacyAuditPolicy /t REG_DWORD /d 1 /f\n:: Enable PowerShell Logging\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\PowerShell\\ModuleLogging\" /v EnableModuleLogging /t REG_DWORD /d 1 /f\nreg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\PowerShell\\ScriptBlockLogging\" /v EnableScriptBlockLogging /t REG_DWORD /d 1 /f\n::\n:: Enable Windows Event Detailed Logging\n:: This is intentionally meant to be a subset of expected enterprise logging as this script may be used on consumer devices.\n:: For more extensive Windows logging, I recommend https://www.malwarearchaeology.com/cheat-sheets\nAuditpol /set /subcategory:\"Security Group Management\" /success:enable /failure:enable\nAuditpol /set /subcategory:\"Process Creation\" /success:enable /failure:enable\nAuditpol /set /subcategory:\"Logoff\" /success:enable /failure:disable\nAuditpol /set /subcategory:\"Logon\" /success:enable /failure:enable \nAuditpol /set /subcategory:\"Filtering Platform Connection\" /success:enable /failure:disable\nAuditpol /set /subcategory:\"Removable Storage\" /success:enable /failure:enable\nAuditpol /set /subcategory:\"SAM\" /success:disable /failure:disable\nAuditpol /set /subcategory:\"Filtering Platform Policy Change\" /success:disable /failure:disable\nAuditpol /set /subcategory:\"IPsec Driver\" /success:enable /failure:enable\nAuditpol /set /subcategory:\"Security State Change\" /success:enable /failure:enable\nAuditpol /set /subcategory:\"Security System Extension\" /success:enable /failure:enable\nAuditpol /set /subcategory:\"System Integrity\" /success:enable /failure:enable\n::\n::#######################################################################\n:: Extra settings commented out but worth considering\n::#######################################################################\n::\n:: Uninstall common extra apps found on a lot of Win10 installs\n:: Obviously do a quick review to ensure it isn't removing any apps you or your user need to use.\n:: https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10\n:: PowerShell command to reinstall all pre-installed apps below\n:: Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\npowershell.exe -command \"Get-AppxPackage *Microsoft.BingWeather* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.DesktopAppInstaller* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.GetHelp* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.Getstarted* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.Messaging* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.OneConnect* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.Print3D* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.SkypeApp* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.Wallet* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.WindowsAlarms* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.WindowsCamera* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *microsoft.windowscommunicationsapps* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.WindowsFeedbackHub* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.WindowsSoundRecorder* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.YourPhone* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.WindowsFeedback* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Windows.ContactSupport* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *PandoraMedia* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *AdobeSystemIncorporated. AdobePhotoshop* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Duolingo* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.BingNews* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.Office.Sway* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *Microsoft.Advertising.Xaml* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *ActiproSoftware* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *EclipseManager* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *SpotifyAB.SpotifyMusic* -AllUsers | Remove-AppxPackage\"\npowershell.exe -command \"Get-AppxPackage *king.com.* -AllUsers | Remove-AppxPackage\"\n:: Removed Provisioned Apps\n:: This will prevent these apps from being reinstalled on new user first logon\n:: Obviously I manually chose this list. If you truly want to nuke all the provisioned apps, you can use the below commented command in PowerShell\n:: Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.BingWeather'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.GetHelp'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.Getstarted'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.SkypeApp'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.WindowsAlarms'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.WindowsCamera'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'microsoft.windowscommunicationsapps'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.WindowsFeedbackHub'} | Remove-AppxProvisionedPackage -Online\"\npowershell.exe -command \"Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq 'Microsoft.YourPhone'} | Remove-AppxProvisionedPackage -Online\"\n::\n::#######################################################################\n:: Extra settings commented out but worth considering\n::#######################################################################\n::\n:: Enforce NTLMv2 and LM authentication\n:: This is commented out by default as it could impact access to consumer-grade file shares but it's a recommended setting\n:: reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa\" /v LmCompatibilityLevel /t REG_DWORD /d 5 /f\n::\n:: Prevent unencrypted passwords being sent to third-party SMB servers\n:: This is commented out by default as it could impact access to consumer-grade file shares but it's a recommended setting\n:: reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanWorkstation\\Parameters\" /v EnablePlainTextPassword /t REG_DWORD /d 0 /f\n::\n:: Prevent guest logons to SMB servers\n:: This is commented out by default as it could impact access to consumer-grade file shares but it's a recommended setting\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\LanmanWorkstation\" /v AllowInsecureGuestAuth /t REG_DWORD /d 0 /f\n::\n:: Force SMB server signing\n:: This is commented out by default as it could impact access to consumer-grade file shares but it's a recommended setting\n:: reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters\" /v RequireSecuritySignature /t REG_DWORD /d 1 /f\n::\n:: Enable Windows Defender Application Guard\n:: This setting is commented out as it enables subset of DC/CG which renders other virtualization products unsuable. Can be enabled if you don't use those\n:: powershell.exe Enable-WindowsOptionalFeature -online -FeatureName Windows-Defender-ApplicationGuard -norestart\n::\n:: Enable Windows Defender Credential Guard\n:: This setting is commented out as it enables subset of DC/CG which renders other virtualization products unsuable. Can be enabled if you don't use those\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\" /v EnableVirtualizationBasedSecurity /t REG_DWORD /d 1 /f\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\" /v RequirePlatformSecurityFeatures /t REG_DWORD /d 3 /f\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DeviceGuard\" /v LsaCfgFlags /t REG_DWORD /d 1 /f\n::\n:: The following variant also enables forced ASLR and CFG but causes issues with several third party apps\n:: powershell.exe Set-Processmitigation -System -Enable DEP,CFG,ForceRelocateImages,BottomUp,SEHOP\n::\n:: Block executable files from running unless they meet a prevalence, age, or trusted list criterion\n:: This one is commented out for now as I need to research and test more to determine potential impact\n:: powershell.exe Add-MpPreference -AttackSurfaceReductionRules_Ids 01443614-cd74-433a-b99e-2ecdc07bfc25 -AttackSurfaceReductionRules_Actions Enabled\n::\n:: Enable Windows Defender real time monitoring\n:: Commented out given consumers often run third party anti-virus. You can run either. \n:: powershell.exe -command \"Set-MpPreference -DisableRealtimeMonitoring $false\"\n:: reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows Defender\\Real-Time Protection\" /v DisableRealtimeMonitoring /t REG_DWORD /d 0 /f\n::\n:: Disable internet connection sharing\n:: Commented out as it's not enabled by default and if it is enabled, may be for a reason\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Network Connections\" /v NC_ShowSharedAccessUI /t REG_DWORD /d 0 /f\n::\n:: Always re-process Group Policy even if no changes\n:: Commented out as consumers don't typically use GPO\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Group Policy\\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}\" /v NoGPOListChanges /t REG_DWORD /d 0 /f\n::\n:: Force logoff if smart card removed\n:: Set to \"2\" for logoff, set to \"1\" for lock\n:: Commented out as consumers don't typically use smart cards\n:: reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\" /v SCRemoveOption /t REG_DWORD /d 2 /f\n::\n:: Restrict privileged local admin tokens being used from network \n:: Commented out as it only works on domain-joined assets\n:: reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 0 /f\n::\n:: Ensure outgoing secure channel traffic is encrytped\n:: Commented out as it only works on domain-joined assets\n:: reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters\" /v RequireSignOrSeal /t REG_DWORD /d 1 /f\n::\n:: Enforce LDAP client signing\n:: Commented out as most consumers don't use LDAP auth\n:: reg add \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LDAP\" /v LDAPClientIntegrity /t REG_DWORD /d 1 /f\n::\n:: Prevent unauthenticated RPC connections\n:: reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Rpc\" /v RestrictRemoteClients /t REG_DWORD /d 1 /f\n::\n::#######################################################################\n:: References\n::#######################################################################\n::\n:: LLMNR\n:: https://www.blackhillsinfosec.com/how-to-disable-llmnr-why-you-want-to/\n:: \n:: Windows Defender References\n:: ASR Rules https://www.darkoperator.com/blog/2017/11/11/windows-defender-exploit-guard-asr-rules-for-office\n:: ASR and Exploit Guard https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/attack-surface-reduction-exploit-guard\n:: ASR Rules https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/attack-surface-reduction\n:: Easy methods to test rules https://demo.wd.microsoft.com/?ocid=cx-wddocs-testground\n:: Resource on the rules and associated event IDs https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/event-views\n:: Defender sandboxing https://cloudblogs.microsoft.com/microsoftsecure/2018/10/26/windows-defender-antivirus-can-now-run-in-a-sandbox/\n:: Defender exploit protection https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/customize-exploit-protection\n:: Application Guard https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-guard/install-wd-app-guard \n:: Defender cmdline https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-antivirus/command-line-arguments-windows-defender-antivirus\n::\n:: General hardening references\n:: LSA Protection https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn408187(v=ws.11)?redirectedfrom=MSDN\n::\n:: Microsoft Office References: \n:: Disable DDE https://gist.github.com/wdormann/732bb88d9b5dd5a66c9f1e1498f31a1b\n:: Disable macros https://decentsecurity.com/block-office-macros/\n::\n:: Debloating\n:: https://blog.danic.net/how-windows-10-pro-installs-unwanted-apps-candy-crush-and-how-you-stop-it/\n\n:: Frameworks and benchmarks\n:: STIG https://www.stigviewer.com/stig/windows_10/\npause", "creation_timestamp": "2026-09-11T15:24:27.825083Z"}