Giter VIP home page Giter VIP logo

hardeningkitty's Introduction

HardeningKitty

This is the stable version of HardeningKitty from the Windows Hardening Project by Michael Schneider. The stable version of HardeningKitty is signed with the code signing certificate of scip AG. Since this is the stable version, we do not accept pull requests in this repo, please send them to the development repo.

HardeningKitty supports hardening of a Windows system. The configuration of the system is retrieved and assessed using a finding list. In addition, the system can be hardened according to predefined values. HardeningKitty reads settings from the registry and uses other modules to read configurations outside the registry.

The script was developed for English systems. It is possible that in other languages the analysis is incorrect. Please create an issue if this occurs.

How to Run

Run the script with administrative privileges to access machine settings. For the user settings it is better to execute them with a normal user account. Ideally, the user account is used for daily work.

Download HardeningKitty and copy it to the target system (script and lists). Then HardeningKitty can be imported and executed:

PS C:\tmp> Import-Module .\HardeningKitty.psm1
PS C:\tmp> Invoke-HardeningKitty -EmojiSupport


         =^._.^=
        _(      )/  HardeningKitty 0.9.0-1662273740


[*] 9/4/2022 8:54:12 AM - Starting HardeningKitty


[*] 9/4/2022 8:54:12 AM - Getting user information
[*] Hostname: DESKTOP-DG83TOD
[*] Domain: WORKGROUP

...

[*] [*] 9/4/2022 8:54:12 AM - Starting Category Account Policies
[😺] ID 1103, Store passwords using reversible encryption, Result=0, Severity=Passed
[😺] ID 1100, Account lockout threshold, Result=10, Severity=Passed
[😺] ID 1101, Account lockout duration, Result=30, Severity=Passed

...

[*] 9/4/2022 8:54:12 AM - Starting Category User Rights Assignment
[😿] ID 1200, Access this computer from the network, Result=BUILTIN\Administrators;BUILTIN\Users, Recommended=BUILTIN\Administrators, Severity=Medium

...

[*] 9/4/2022 8:54:14 AM - Starting Category Administrative Templates: Printer
[🙀] ID 1764, Point and Print Restrictions: When installing drivers for a new connection (CVE-2021-34527), Result=1, Recommended=0, Severity=High
[🙀] ID 1765, Point and Print Restrictions: When updating drivers for an existing connection (CVE-2021-34527), Result=2, Recommended=0, Severity=High

...

[*] 9/4/2022 8:54:19 AM - Starting Category MS Security Guide
[😿] ID 2200, LSA Protection, Result=, Recommended=1, Severity=Medium
[😼] ID 2201, Lsass.exe audit mode, Result=, Recommended=8, Severity=Low

...

[*] 9/4/2022 8:54:25 AM - HardeningKitty is done
[*] 9/4/2022 8:54:25 AM - Your HardeningKitty score is: 4.82. HardeningKitty Statistics: Total checks: 325 - Passed: 213, Low: 33, Medium: 76, High: 3.

How To Install

First create the directory HardeningKitty and for every version a sub directory like 0.9.2 in a path listed in the PSModulePath environment variable.

Copy the module HardeningKitty.psm1, HardeningKitty.psd1, and the lists directory to this new directory.

PS C:\tmp> $Version = "0.9.2"
PS C:\tmp> New-Item -Path $Env:ProgramFiles\WindowsPowerShell\Modules\HardeningKitty\$Version -ItemType Directory
PS C:\tmp> Copy-Item -Path .\HardeningKitty.psd1,.\HardeningKitty.psm1,.\lists\ -Destination $Env:ProgramFiles\WindowsPowerShell\Modules\HardeningKitty\$Version\ -Recurse

For more information see Microsoft's article Installing a PowerShell Module.

How to Automatically Download and Install the Latest Release

You can use the script below to download and install the latest release of HardeningKitty.

Function InstallHardeningKitty() {
    $Version = (((Invoke-WebRequest "https://api.github.com/repos/scipag/HardeningKitty/releases/latest" -UseBasicParsing) | ConvertFrom-Json).Name).SubString(2)
    $HardeningKittyLatestVersionDownloadLink = ((Invoke-WebRequest "https://api.github.com/repos/scipag/HardeningKitty/releases/latest" -UseBasicParsing) | ConvertFrom-Json).zipball_url
    $ProgressPreference = 'SilentlyContinue'
    Invoke-WebRequest $HardeningKittyLatestVersionDownloadLink -Out HardeningKitty$Version.zip
    Expand-Archive -Path ".\HardeningKitty$Version.zip" -Destination ".\HardeningKitty$Version" -Force
    $Folder = Get-ChildItem .\HardeningKitty$Version | Select-Object Name -ExpandProperty Name
    Move-Item ".\HardeningKitty$Version\$Folder\*" ".\HardeningKitty$Version\"
    Remove-Item ".\HardeningKitty$Version\$Folder\"
    New-Item -Path $Env:ProgramFiles\WindowsPowerShell\Modules\HardeningKitty\$Version -ItemType Directory
    Set-Location .\HardeningKitty$Version
    Copy-Item -Path .\HardeningKitty.psd1,.\HardeningKitty.psm1,.\lists\ -Destination $Env:ProgramFiles\WindowsPowerShell\Modules\HardeningKitty\$Version\ -Recurse
    Import-Module "$Env:ProgramFiles\WindowsPowerShell\Modules\HardeningKitty\$Version\HardeningKitty.psm1"
}
InstallHardeningKitty

Examples

Audit

The default mode is audit. HardeningKitty performs an audit, saves the results to a CSV file and creates a log file. The files are automatically named and receive a timestamp. Using the parameters ReportFile or LogFile, it is also possible to assign your own name and path.

The Filter parameter can be used to filter the hardening list. For this purpose the PowerShell ScriptBlock syntax must be used, for example { $_.ID -eq 4505 }. The following elements are useful for filtering: ID, Category, Name, Method, and Severity.

Invoke-HardeningKitty -Mode Audit -Log -Report

HardeningKitty can be executed with a specific list defined by the parameter FileFindingList. If HardeningKitty is run several times on the same system, it may be useful to hide the machine information. The parameter SkipMachineInformation is used for this purpose.

Invoke-HardeningKitty -FileFindingList .\lists\finding_list_0x6d69636b_user.csv -SkipMachineInformation

HardeningKitty uses the default list, and checks only tests with the severity Medium.

Invoke-HardeningKitty -Filter { $_.Severity -eq "Medium" }

Config

The mode config retrives all current settings of a system. If a setting has not been configured, HardeningKitty will use a default value stored in the finding list. This mode can be combined with other functions, for example to create a backup.

HardeningKitty gets the current settings and stores them in a report:

Invoke-HardeningKitty -Mode Config -Report -ReportFile C:\tmp\my_hardeningkitty_report.csv

Backup

Backups are important. Really important. Therefore, HardeningKitty also has a function to retrieve the current configuration and save it in a form that can be partially restored.

Disclaimer: HardeningKitty tries to restore the original configuration. This works quite well with registry keys and Hardening Kitty really tries its best. But the backup function is not a snapshot and does not replace a real system backup. It is not possible to restore the system 1:1 with HardeningKitty alone after HailMary. If this is a requirement, create an image or system backup and restore it.

The Backup switch specifies that the file is written in form of a finding list and can thus be used for the HailMary mode. The name and path of the backup can be specified with the parameter BackupFile.

Invoke-HardeningKitty -Mode Config -Backup

Please test this function to see if it really works properly on the target system before making any serious changes. A Schrödinger's backup is dangerous.

Non-Default Finding List

Note that if -FileFindingList is not specified, the backup is referred to the default finding list. Before deploying a specific list in HailMary mode, always create a backup referred to that specific list.

Invoke-HardeningKitty -Mode Config -Backup -BackupFile ".\myBackup.csv" -FileFindingList ".\list\{list}.csv"
Restoring a Backup

The Backup switch creates a file in form of a finding list, to restore the backup load it in HailMary mode like any find list:

Invoke-HardeningKitty -Mode HailMary -Log -Report -FileFindingList ".\myBackup.csv"

HailMary

The HailMary method is very powerful. It can be used to deploy a finding list on a system. All findings are set on this system as recommended in the list. With power comes responsibility. Please use this mode only if you know what you are doing. Be sure to have a backup of the system.

Invoke-HardeningKitty -Mode HailMary -Log -Report -FileFindingList .\lists\finding_list_0x6d69636b_machine.csv

Before HailMary is run, a finding list must be picked. It is important to check whether the settings have an influence on the stability and functionality of the system. Before running HailMary, a backup should be made.

Create a Group Policy (experimental)

Thanks to @gderybel, HardeningKitty can convert a finding list into a group policy. At the moment only registry settings can be converted and not everything has been tested yet. A new policy is created, as long as it is not assigned to an object, no change is made to the system. Use it with care.

Invoke-HardeningKitty -Mode GPO -FileFindingList .\lists\finding_list_0x6d69636b_machine.csv -GPOName HardeningKitty-Machine-01

HardeningKitty Score

Each Passed finding gives 4 points, a Low finding gives 2 points, a Medium finding gives 1 point and a High Finding gives 0 points.

The formula for the HardeningKitty Score is (Points achieved / Maximum points) * 5 + 1.

Rating

Score Rating Casual Rating Professional
6 😹 Excellent Excellent
5 😺 Well done Good
4 😼 Sufficient Sufficient
3 😿 You should do better Insufficient
2 🙀 Weak Insufficient
1 😾 Bogus Insufficient

HardeningKitty Interface

ataumo build a web based interface for HardeningKitty. The tool can be used to create your own lists and provides additional information on the hardening settings. The source code is under AGPL license and there is a demo site.

Last Update

HardeningKitty can be used to audit systems against the following baselines / benchmarks:

Name System Version Version
0x6d69636b Windows 10 (Machine) 22H2
0x6d69636b Windows 10 (User) 22H2
BSI SiSyPHuS Windows 10 hoher Schutzbedarf Domänenmitglied (Machine) 1809 1.0
BSI SiSyPHuS Windows 10 hoher Schutzbedarf Domänenmitglied (User) 1809 1.0
BSI SiSyPHuS Windows 10 normaler Schutzbedarf Domänenmitglied (Machine) 1809 1.0
BSI SiSyPHuS Windows 10 normaler Schutzbedarf Domänenmitglied (User) 1809 1.0
BSI SiSyPHuS Windows 10 normaler Schutzbedarf Einzelrechner (Machine) 1809 1.0
BSI SiSyPHuS Windows 10 normaler Schutzbedarf Einzelrechner (User) 1809 1.0
CIS Microsoft Windows 10 Enterprise (Machine) 1809 1.6.1
CIS Microsoft Windows 10 Enterprise (User) 1809 1.6.1
CIS Microsoft Windows 10 Enterprise (Machine) 1903 1.7.1
CIS Microsoft Windows 10 Enterprise (User) 1903 1.7.1
CIS Microsoft Windows 10 Enterprise (Machine) 1909 1.8.1
CIS Microsoft Windows 10 Enterprise (User) 1909 1.8.1
CIS Microsoft Windows 10 Enterprise (Machine) 2004 1.9.1
CIS Microsoft Windows 10 Enterprise (User) 2004 1.9.1
CIS Microsoft Windows 10 Enterprise (Machine) 20H2 1.10.1
CIS Microsoft Windows 10 Enterprise (User) 20H2 1.10.1
CIS Microsoft Windows 10 Enterprise (Machine) 21H1 1.11.0
CIS Microsoft Windows 10 Enterprise (User) 21H1 1.11.0
CIS Microsoft Windows 10 Enterprise (Machine) 21H2 1.12.0
CIS Microsoft Windows 10 Enterprise (User) 21H2 1.12.0
CIS Microsoft Windows 10 Enterprise (Machine) 22H2 2.0.0
CIS Microsoft Windows 10 Enterprise (User) 22H2 2.0.0
CIS Microsoft Windows 11 Enterprise (Machine) 21H2 1.0.0
CIS Microsoft Windows 11 Enterprise (User) 21H2 1.0.0
CIS Microsoft Windows 11 Enterprise (Machine) 22H2 2.0.0
CIS Microsoft Windows 11 Enterprise (User) 22H2 2.0.0
CIS Microsoft Windows Server 2012 R2 (Machine) R2 2.4.0
CIS Microsoft Windows Server 2012 R2 (User) R2 2.4.0
CIS Microsoft Windows Server 2012 R2 (Machine) R2 2.6.0
CIS Microsoft Windows Server 2012 R2 (User) R2 2.6.0
CIS Microsoft Windows Server 2016 (Machine) 1607 1.2.0
CIS Microsoft Windows Server 2016 (User) 1607 1.2.0
CIS Microsoft Windows Server 2016 (Machine) 1607 1.3.0
CIS Microsoft Windows Server 2016 (User) 1607 1.3.0
CIS Microsoft Windows Server 2016 (Machine) 1607 2.0.0
CIS Microsoft Windows Server 2016 (User) 1607 2.0.0
CIS Microsoft Windows Server 2019 (Machine) 1809 1.1.0
CIS Microsoft Windows Server 2019 (User) 1809 1.1.0
CIS Microsoft Windows Server 2019 (Machine) 1809 1.2.1
CIS Microsoft Windows Server 2019 (User) 1809 1.2.1
CIS Microsoft Windows Server 2019 (Machine) 1809 2.0.0
CIS Microsoft Windows Server 2019 (User) 1809 2.0.0
CIS Microsoft Windows Server 2022 (Machine) 21H2 1.0.0
CIS Microsoft Windows Server 2022 (User) 21H2 1.0.0
CIS Microsoft Windows Server 2022 (Machine) 22H2 2.0.0
CIS Microsoft Windows Server 2022 (User) 22H2 2.0.0
DoD Microsoft Windows 10 STIG (Machine) 20H2 v2r1
DoD Microsoft Windows 10 STIG (User) 20H2 v2r1
DoD Windows Server 2019 Domain Controller STIG (Machine) 20H2 v2r1
DoD Windows Server 2019 Domain Controller STIG (User) 20H2 v2r1
DoD Windows Server 2019 Member Server STIG (Machine) 20H2 v2r1
DoD Windows Server 2019 Member Server STIG (User) 20H2 v2r1
DoD Windows Defender Antivirus STIG 20H2 v2r1
DoD Windows Firewall STIG 20H2 v1r7
Microsoft Security baseline for Microsoft Edge 87 Final
Microsoft Security baseline for Microsoft Edge 88, 89, 90, 91 Final
Microsoft Security baseline for Microsoft Edge 92 Final
Microsoft Security baseline for Microsoft Edge 93, 94 Final
Microsoft Security baseline for Microsoft Edge 95 Final
Microsoft Security baseline for Microsoft Edge 96 Final
Microsoft Security baseline for Microsoft Edge 97 Final
Microsoft Security baseline for Microsoft Edge 98, 99, 100, 101, 102, 103, 104, 105, 106 Final
Microsoft Security baseline for Microsoft Edge 107, 108, 109, 110, 111 Final
Microsoft Security baseline for Microsoft Edge 112, 113 Final
Microsoft Security baseline for Microsoft Edge 114, 115, 116 Final
Microsoft Security baseline for Microsoft Edge 117, 118, 119 Final
Microsoft Security baseline for Windows 10 2004 Final
Microsoft Security baseline for Windows 10 20H2, 21H1 Final
Microsoft Security baseline for Windows 10 21H2 Final
Microsoft Security baseline for Windows 10 (Machine) 22H2 Final
Microsoft Security baseline for Windows 10 (User) 22H2 Final
Microsoft Security baseline for Windows 11 21H2 Final
Microsoft Security baseline for Windows 11 (Machine) 22H2 Final
Microsoft Security baseline for Windows 11 (User) 22H2 Final
Microsoft Security baseline for Windows 11 (Machine) 23H2 Final
Microsoft Security baseline for Windows 11 (User) 23H2 Final
Microsoft Security baseline for Windows Server (DC) 2004 Final
Microsoft Security baseline for Windows Server (Member) 2004 Final
Microsoft Security baseline for Windows Server (DC) 20H2 Final
Microsoft Security baseline for Windows Server (Member) 20H2 Final
Microsoft Security baseline for Windows Server 2022 (DC) 21H2 Final
Microsoft Security baseline for Windows Server 2022 (Member) 21H2 Final
Microsoft Security baseline for Office 365 ProPlus (Machine) Sept 2019 Final
Microsoft Security baseline for Office 365 ProPlus (User) Sept 2019 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (Machine) v2104, v2106 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (User) v2104, v2106 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (Machine) v2112 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (User) v2112 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (Machine) v2206 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (User) v2206 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (Machine) v2306 Final
Microsoft Security Baseline for Microsoft 365 Apps for enterprise (User) v2306 Final
Microsoft Windows Server TLS Settings 1809 1.0
Microsoft Windows Server TLS Settings (Future Use with TLSv1.3) 1903 1.0

hardeningkitty's People

Contributors

0x6d69636b avatar ataumo avatar thetechgy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hardeningkitty's Issues

Winning GPO information can help identify conflicts for key settings

Hello @0x6d69636b,

Thanks for the quick chat recently! As mentioned we've made use of RSOP* CIM classes to audit key settings.
I have looked at the list of URA we want to audit at scale and had come up with the following code sample for it. In this case, the effectiveness of AD Tiering GPOs, and control of other sensitive privileges in an environment.

#User Right Assignment of interest
$URA=@('SeDenyServiceLogonRight',
    'SeDenyBatchLogonRight',
    'SeDenyNetworkLogonRight',
    'SeDenyInteractiveLogonRight',
    'SeDenyRemoteInteractiveLogonRight',
    'SeDebugPrivilege',
    'SeEnableDelegationPrivilege',
    'SeImpersonatePrivilege',
    'SeBatchLogonRight',
    'SeServiceLogonRight',
    'SeInteractiveLogonRight',
    'SeNetworkLogonRight',
    'SeRemoteInteractiveLogonRight')

# Inspect RSOP classes
# Having a precedence of 1 indicates the winning GPO
$URA_RSOP = Get-WmiObject RSOP_UserPrivilegeRight -namespace "root\RSOP\Computer" | where UserRight -in $URA | where precedence -eq 1 | select UserRight,AccountList,GPOID

The GPOID is the Distinguished Name of the object in AD, in the policies container. I'll have a look at the overall structure of HK, perhaps the name or GUIDs of GPOs expected to manage these settings can be stored in a config as well? Do you see this check fit in the current execution flow of HK?

A full list of RSOP classes can be found here, somehow this content is "outdated", but there's a ton more settings to review if needed.
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/policy/rsop-wmi-classes

Cheers

Lazy feature

A non existant folder isnt created :( perhaps this could be done automatically incase people automate this script. Ex Sys admin wasnt paying attention when running this across a network, uh oh the folder I gave Kitty was the wrong path and now I lost the default settings
image

Check how to execute the function Create a Group Policy (experimental) added from v0.91

The function Create a Group Policy (experimental) has been added since v0.91. Could you please confirm how to execute it?

Invoke-HardeningKitty -Mode GPO -FileFindingList .\lists\finding_list_0x6d69636b_machine.csv -GPOName HardeningKitty-Machine-01

If you specify an appropriate name in the -GPOName part of the above command, the following error will occur.
Get-GPRegistryValue: I get a message that there is no GPO named xxx in my domain.

Also, if you specify an existing GPO, a message will appear stating that you do not have access rights.

Is it actually a command that creates a domain policy?
How should I specify how to apply it to local policy?

CIS baseline in combination with Intune

Our machines are deployed with Intune. Checking the baseline with hardeningkitty reports that the firewall is OFF.
This is done by checking the registry hive under ..\Policies.
But this is only set when its controlled by GPO. When done with Intune there is no ..\WindowsFirewall..

You can check it by NETSH or other functions.

But the first thing I would like to see is : When a registry key is not readable, don't assume its 0. Report it as not available.

10501,"Windows Firewall","EnableFirewall (Domain Profile, Policy)",Registry,,HKLM:\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile,EnableFirewall,,,,0,1,=,Medium

Hope you are willing to help and improve.

Best regards,
Gert

line 663 has a type in the variable name

    # A CSV finding list is imported. HardeningKitty has one machine and one user list.
    If ($FileFindingList.Length -eq 0) {

        $CurrentLication = Get-Location
        $FileFindingList = "**$CurrentLication**\lists\finding_list_0x6d69636b_machine.csv"
    }

    $FindingList = Import-Csv -Path $FileFindingList -Delimiter ","
    $LastCategory = ""

CSV wrong column

When executing Invoke-HardeningKitty -Mode Audit -Log -Report the generated csv as severity column contains "passed" along with medium and low. Typo?

Backup Parameter Not Found

After importing the module, when executing Invoke-HardeningKitty -Mode Config -Backup as indicated in the Readme.md , PowerShell returns the following error regarding the Backup parameter:

Invoke-HardeningKitty : A parameter cannot be found that matches parameter name 'Backup'.
At line:1 char:36
+ Invoke-HardeningKitty -Mode Config -Backup
+                                    ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-HardeningKitty], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Invoke-HardeningKitty

Mishandling of "Never minutes" in Account Lockout Duration checks

According to my tests when Account Lockout Duration is set to 0, Windows reports the value as "Never", which is also reflected in HardeningKitty's output.

According to documentation:

A value of 0 specifies that the account will be locked out until an administrator explicitly unlocks it.

HardeningKitty specifies a numeric threshold for this value, while
a) the "Never" string can't be handled with such a rule
b) 0 as a special case can't be handled by a "bigger is better" kind of rule

I think the "0" setting is more secure than any expiring value, so it should be accepted, but I don't know how much flexibility the rule format of HardeningKitty provides to handle the above edge case.

unauthenticated guest access

I have been trying to figure out which rule has been giving me issues with network drives. wont let me add drives due to unauthenticated guest access.

CIS 22H2 list availability

Hi there,

Just working on a Windows 11 22H2 machine today. Any chance you have this CIS list for 22H2? Unless you think 21H2 would suffice....

finding_list_cis_microsoft_windows_11_enterprise_21h2_machine.csv

Thanks

question about scripts

hello.

I was wondering if there are any sections specifically that wouldn't allow for batch files to run. it is a net use batch file that we are trying to implement but so far I have not found any script related lines that would stop them from running. I am able to manually add them through file explorer. thnak you

"Window Manager\Window Manager Group" SID not shown in Result

I did a scan of a server against the BSI ND Machine baseline and in the scan result (CSV) for ID 279 (Increase scheduling priority), it shows only BUILTIN\Administrators as a result, despite the Window Manager\Window Manager Group also being configured via its SID (S-1-5-90-0) which I got from here. I would expect that SID to show up in the "Result" column as well, which isn't the case. For other settings I use S-1-0-0 for Nobody and those settings get a pass too, so I'm not sure it is related to the fact I am using a SID here per se.

Caveats: I'm not entirely convinced doing it via the SID is correct and the Windows Server language is German.

Automatic creation of finding lists

HardeningKitty is a great tool and has been very helpful for creating gold images etc.

Do you have a scripted method for creating the finding lists from the STIG xml or pol files? It looks as though it might be possible, but not sure if all the required information is there.

Perhaps you could provide a short description of how you go about generating the finding lists from a STIG, this would be helpful for those looking to add new lists of keep theirs up to date.

thanks in advance.

CIS Windows 10 list bugs

Hello,
just a few remarks regarding the finding_list_cis_microsoft_windows_10_enterprise_machine.csv:

  • 18.8.3.1 - the recommended value should be '0' (disabled)
  • 18.8.4.1 and 18.8.4.2 are swapped, and default credential check is no longer part of this version of CIS benchmark. It should be 'Remote host allows delegation of non-exportable credentials'
  • '18.5.14.1.1' does not exist in CIS, it should be '18.5.14.1'

Category Windows Firewall clarification

Why are the settings in the registry path:
HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile

also checked ? For a compliance check SOFTWARE\Policies\Microsoft\WindowsFirewall should be enough?

Registry type needed to be REG_SZ, not REG_DWORD

The Retention registry setting in "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security", "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application". "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup", and "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System" needs to be REG_SZ. The script creates these as REG_DWORD which do configure the setting correctly.

Not sure if there are other examples here, but I only noticed then when Windows alerted me to the fact that the security log was full, however I knew we enforced the retention setting to prevent this.

Wrong default value for AlwaysInstallElevated

According to the documentation:

"To install a package with elevated (system) privileges, set the AlwaysInstallElevated value to "1" under both of the following registry keys:"

This implies that when these keys are missing, the setting is not the same as if the setting value was 1.

This list (and others) however assume the value to be 1 by default:

https://github.com/scipag/HardeningKitty/blame/7751c3c303ba77f30d9d59362914018800eeb0bb/lists/finding_list_cis_microsoft_windows_10_enterprise_20h2_user.csv#L14

This results in false positive findings.

question

I have this setup on a multitude of computers but we are running issues with certain smb network drives connecting.

Case 19.6.6.1.1 is missing severity

invoke-hardeningKitty .\lists\finding_list_cis_microsoft_windows_11_enterprise_21h2_user.csv -EmojiSupport -Mode Audit

Output:
[*] 8/6/2022 9:25:35 AM - Starting Category Administrative Templates: System
[😺] ID 19.6.6.1.1, Internet Communication Management: Internet Communication Settings: Turn off Help Experience Improvement Program, Result=1, Severity=Passed

Log:
"19.6.6.1.1","Internet Communication Management: Internet Communication Settings: Turn off Help Experience Improvement Program","Passed","1"

Requires Admin Privilege

Hello, while I run the script and I want to save it as CSV file, however I encounter this kind of error to some of our configured policy.

How to bypass ?
image

The finding list was not found

Hi!
just installed HK and cannot run it due to the following error in the output. Can you help please?

PS C:\Users\XXXXXXX\Desktop> Invoke-HardeningKitty -EmojiSupport

  =^._.^=
 _(      )/  HardeningKitty 0.9.0-1670934249

[*] 2023-04-07 20:20:35 - Starting HardeningKitty

[] 2023-04-07 20:20:35 - Getting machine information
[
] Hostname: XXXX
[] Domain: XXXX
[
] Domain role: Member Server
[] Install date: 01/11/2016 07:16:02
[
] Last Boot Time: 04/06/2023 08:17:12
[] Uptime: 1.12:03:23.2387107
[
] Windows: Microsoft Windows Server 2012 R2 Standard
[] Windows version: 6.3.9600
[
] Windows build: 9600
[] System-locale: lt-LT
[
] Powershell Version: 4.0

[*] 2023-04-07 20:20:36 - Language warning
[?] 2023-04-07 20:20:36 - HardeningKitty was developed for the system language 'en-US'. This system uses 'lt-LT' Languag
e-dependent analyses can sometimes produce false results. Please create an issue if this occurs.

[] 2023-04-07 20:20:36 - Getting user information
[
] Username: XXXXXX\XXXXXX
[*] Is Admin: True
[!] 2023-04-07 20:20:36 - The finding list C:\Users\XXXXXXX\Desktop\lists\finding_list_0x6d69636b_machine.csv was not fo
und.

XblGameSave Standby Task, 11060

I know the recommendation exist (and you should disable), but it never made it into the official Microsoft OS machine baselines, right ?
I remember they mentioned somewhere, they think about expanding the baselines and adding user based tasks and services..

11060 | Scheduled Task | XblGameSave Standby Task

finding_list_cis_microsoft_windows_server_2022_21h2_1.0.0_machine.csv - ID 2.3.10.9, Network access: Remotely accessible registry paths and sub-paths

[] Windows: Microsoft Windows Server 2022 Standard Evaluation
[
] Windows edition: ServerStandardEval
[*] Windows version: 2009
Finding list - finding_list_cis_microsoft_windows_server_2022_21h2_1.0.0_machine.csv

After changing settings to recommended; it still flagging as incorrect:

[$] ID 2.3.10.9, Network access: Remotely accessible registry paths and sub-paths, Result=System\CurrentControlSet\Control\Print\Printers;System\CurrentControlSet\Services\Eventlog;Software\Microsoft\OLAP Server;Software\Microsoft\Windows NT\CurrentVersion\Print;Software\Microsoft\Windows NT\CurrentVersion\Windows;System\CurrentControlSet\Control\ContentIndex;System\CurrentControlSet\Control\Terminal Server;System\CurrentControlSet\Control\Terminal Server\UserConfig;System\CurrentControlSet\Control\Terminal Server\DefaultUserConfiguration;Software\Microsoft\Windows NT\CurrentVersion\Perflib;System\CurrentControlSet\Services\SysmonLog, Recommended=System\CurrentControlSet\Control\Print\Printers System\CurrentControlSet\Services\Eventlog Software\Microsoft\OLAP Server Software\Microsoft\Windows NT\CurrentVersion\Print Software\Microsoft\Windows NT\CurrentVersion\Windows System\CurrentControlSet\Control\ContentIndex System\CurrentControlSet\Control\Terminal Server System\CurrentControlSet\Control\Terminal Server\UserConfig System\CurrentControlSet\Control\Terminal Server\DefaultUserConfiguration Software\Microsoft\Windows NT\CurrentVersion\Perflib System\CurrentControlSet\Services\SysmonLog, Severity=Medium

It's a bit hard to see with that blurb of text so I will paste again with easier formatting for visibility:

Result:
System\CurrentControlSet\Control\Print\Printers
System\CurrentControlSet\Services\Eventlog
Software\Microsoft\OLAP Server
Software\Microsoft\Windows NT\CurrentVersion\Print
Software\Microsoft\Windows NT\CurrentVersion\Windows
System\CurrentControlSet\Control\ContentIndex
System\CurrentControlSet\Control\Terminal Server
System\CurrentControlSet\Control\Terminal Server\UserConfig
System\CurrentControlSet\Control\Terminal Server\DefaultUserConfiguration
Software\Microsoft\Windows NT\CurrentVersion\Perflib
System\CurrentControlSet\Services\SysmonLog

Recommended:
System\CurrentControlSet\Control\Print\Printers
System\CurrentControlSet\Services\Eventlog
Software\Microsoft\OLAP Server
Software\Microsoft\Windows NT\CurrentVersion\Print
Software\Microsoft\Windows NT\CurrentVersion\Windows
System\CurrentControlSet\Control\ContentIndex
System\CurrentControlSet\Control\Terminal Server
System\CurrentControlSet\Control\Terminal Server\UserConfig
System\CurrentControlSet\Control\Terminal Server\DefaultUserConfiguration
Software\Microsoft\Windows NT\CurrentVersion\Perflib
System\CurrentControlSet\Services\SysmonLog

Any idea's what went wrong here?

Category Microsoft Edge ID 10952, 10953

When executing, on Windows 11 22H2:
Invoke-HardeningKitty -Mode Audit -FileFindingList .\lists\finding_list_msft_security_baseline_windows_11_22h2_machine.csv

the two Edge settings are not found:
`[*] 1/29/2023 6:22:34 PM - Starting Category Microsoft Edge

[$] ID 10952, Configure Windows Defender SmartScreen, Result=, Recommended=1, Severity=Medium

[$] ID 10953, Prevent bypassing Microsoft Defender SmartScreen prompts for sites, Result=, Recommended=1, Severity=Medium`

the list points to the reg key:
HKLM:\Software\Policies\Microsoft\MicrosoftEdge\PhishingFilter,EnabledV9

I could only find this setting here (the second Defender setting is also found here):
SOFTWARE\Policies\Microsoft\Internet Explorer\PhishingFilter

Network Provider: Hardened UNC Paths (SYSVOL)

[] 16.05.2022 15:05:49 - Getting machine information
[
] Domain role: MemberServer
[] Windows: Windows Server 2022 Datacenter
[
] Windows edition: ServerDatacenter
[] Windows version: 2009
[
] Windows build: 20348.1.amd64fre.fe_release.210507-1500
[] System-locale: de-DE
[
] Powershell Version: 5.1

Commandline:
Invoke-HardeningKitty -EmojiSupport -FileFindingList .\lists\finding_list_msft_security_baseline_windows_server_2022_21h2_member_machine.csv

ID 10653, Network Provider: Hardened UNC Paths (NETLOGON), Result=RequireMutualAuthentication=1,RequireIntegrity=1, Severity=Passed

[😿] ID 10654, Network Provider: Hardened UNC Paths (SYSVOL), Result=RequireMutualAuthentication=1,RequireIntegrity=1, Recommended=RequireMutualAuthentication=1, RequireIntegrity=1, Severity=Medium

The recommendation of the second case. contains a space character and might lead to the Severity=Medium instead of Severity=Passed. Both cases are configured exactly the same on my systems.

Add new finding

Hello all!

this is not really an issue - but I would like to know if it is possible to add a new finding and if yes how.

I want to check if the powershell executionpolicy on the endpoint is set to the microsoft default "restricted" or something different.

PS C:\Users\SecurityWho> Get-ExecutionPolicy                                                                        
Restricted

Adding new method

Hi,

Loving the HardeningKitty capabilities, but for "our" hardening process we need new methods :

  • Users creation (to replace default admin by a new account)
  • NTFS permissions
  • other ?

I want to contribute on that (and not ask you you dev it), but i want to known if it's something that can be considered in the "scope" of HardeningKitty ?

Best Regards,
Richard.

Registry to Local Group Policy?

This is a fantastic tool! I wanted to export the local policies to a csv after running HailMary but noticed that there are only "not configured" policies in the Local Group Policy Editor. At least all the "administrative template" policies. I find this weird, because when you enabled a policy the registry is changed. But apparently, when you modify/create a registry key, the corresponding policy is not enabled. Note that the machine I am using HardeningKitty Hailmary on is a non-domain joined machine. Is it possible to automate getting the policies enabled?

Potentially outdated default value for RestrictDriverInstallationToAdministrators

Multiple rule lists define the Point and Print driver installation restriction with the default value of 0:

https://github.com/scipag/HardeningKitty/search?q=RestrictDriverInstallationToAdministrators

Meanwhile, according to the documentation:

"Windows updates released August 10, 2021 and later will, by default, require administrative privilege to install drivers."

I don't know if HardeningKitty can take into account the current update level of the target system. If it can't, maybe the updated default could be reflected in lists used for builds released after the above date?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.