这是迈克尔·施耐德(Michael Schneider)的Windows硬化项目的HardeningKitty稳定版本。稳定版本的HardeningKitty用SCIP AG的代码签名证书签名。由于这是稳定版本,因此我们不接受此存储库中的拉动请求,请将其发送给开发存储库。
HardeningKitty支持Windows系统的硬化。使用查找列表检索和评估系统的配置。另外,可以根据预定义值硬化系统。 HardeningKitty读取注册表的设置,并使用其他模块来读取注册表之外的配置。
该脚本是为英语系统开发的。在其他语言中,分析可能是不正确的。如果发生这种情况,请创建一个问题。
运行具有管理特权以访问机器设置的脚本。对于用户设置,最好使用普通用户帐户执行它们。理想情况下,用户帐户用于日常工作。
下载HardeningKitty并将其复制到目标系统(脚本和列表)。然后可以进口和执行HardeningKitty:
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 = BUILTINAdministrators;BUILTINUsers , Recommended = BUILTINAdministrators , 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 .首先创建Directory HardeningKitty ,对于每个版本,在PSModulePath环境变量中列出的路径中的子目录中的一个子目录(例如0.9.2) 。
将模块hardeningkitty.psm1 , hardeningkitty.psd1和列表目录复制到此新目录。
PS C:tmp > $Version = " 0.9.2 "
PS C:tmp > New-Item - Path $ Env: ProgramFiles WindowsPowerShellModulesHardeningKitty $Version - ItemType Directory
PS C:tmp > Copy-Item - Path .HardeningKitty.psd1 , .HardeningKitty.psm1 , .lists - Destination $ Env: ProgramFiles WindowsPowerShellModulesHardeningKitty $Version - Recurse有关更多信息,请参见Microsoft的文章安装PowerShell模块。
您可以使用下面的脚本下载并安装HardeningKitty的最新版本。
Function InstallHardeningKitty () {
$Version = ((( Invoke-WebRequest " https://api.github.com/repos/0x6d69636b/windows_hardening/releases/latest " - UseBasicParsing) | ConvertFrom-Json ).Name).SubString( 2 )
$HardeningKittyLatestVersionDownloadLink = (( Invoke-WebRequest " https://api.github.com/repos/0x6d69636b/windows_hardening/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 WindowsPowerShellModulesHardeningKitty $Version - ItemType Directory
Set-Location .HardeningKitty $Version
Copy-Item - Path .HardeningKitty.psd1 , .HardeningKitty.psm1 , .lists - Destination $ Env: ProgramFiles WindowsPowerShellModulesHardeningKitty $Version - Recurse
Import-Module " $ Env: ProgramFiles WindowsPowerShellModulesHardeningKitty $Version HardeningKitty.psm1 "
}
InstallHardeningKitty默认模式是审核。 HardeningKitty执行审核,将结果保存到CSV文件并创建日志文件。文件自动命名并接收时间戳。使用参数ReportFile或LogFile ,也可以分配您自己的名称和路径。
滤波器参数可用于过滤硬化列表。为此,必须使用PowerShell ScriptBlock语法,例如{ $_.ID -eq 4505 } 。以下元素可用于过滤:ID,类别,名称,方法和严重性。
Invoke-HardeningKitty - Mode Audit - Log - ReportHardeningKitty可以使用由参数FileFindingList定义的特定列表执行。如果HardeningKitty在同一系统上运行多次,则隐藏机器信息可能很有用。参数Skipmachineformation用于此目的。
Invoke-HardeningKitty - FileFindingList .listsfinding_list_0x6d69636b_user.csv - SkipMachineInformationHardeningKitty使用默认列表,仅使用严重性介质检查测试。
Invoke-HardeningKitty - Filter { $_ .Severity -eq " Medium " }模式配置重新检索系统的所有当前设置。如果尚未配置设置,则HardeningKitty将使用查找列表中存储的默认值。该模式可以与其他功能结合使用,例如创建备份。
HardeningKitty获取当前设置并将其存储在报告中:
Invoke-HardeningKitty - Mode Config - Report - ReportFile C:tmpmy_hardeningkitty_report.csv备份很重要。真的很重要。因此,HardeningKitty还具有检索当前配置并以可以部分恢复的形式保存的功能。
免责声明: HardeningKitty试图恢复原始配置。这与注册表键和硬化小猫非常有效。但是备份功能不是快照,也不能替换真实的系统备份。在冰雹之后,不可能单独使用HardeningKitty恢复系统1:1。如果这是必需的,请创建图像或系统备份并恢复它。
备份开关指定文件是以查找列表的形式编写的,因此可以用于冰雹模式。备份的名称和路径可以使用参数备份文件指定。
Invoke-HardeningKitty - Mode Config - Backup请测试此功能,以查看其在进行任何严重更改之前是否真的在目标系统上正常工作。 Schrödinger的备份很危险。
请注意,如果未指定-FileFindingList ,则将备份转介给默认查找列表。在以冰雹模式部署特定列表之前,请务必创建一个转介到该特定列表的备份。
Invoke-HardeningKitty - Mode Config - Backup - BackupFile " .myBackup.csv " - FileFindingList " .list{list}.csv " 备份开关以查找列表的形式创建一个文件,以在任何查找列表中以冰雹模式恢复备份加载它:
Invoke-HardeningKitty - Mode HailMary - Log - Report - FileFindingList " .myBackup.csv " 冰雹方法非常强大。它可用于在系统上部署查找列表。所有发现均按照列表中的建议在此系统上设置。权力带来责任。仅当您知道自己在做什么时,请使用此模式。确保对系统进行备份。
目前,仅在审核和配置模式下支持过滤器功能。由于冰雹模式是一个微妙的问题,请创建自己的文件并删除要过滤的所有线条。
Invoke-HardeningKitty - Mode HailMary - Log - Report - FileFindingList .listsfinding_list_0x6d69636b_machine.csv在冰雹运行之前,必须选择一个发现清单。重要的是检查设置是否对系统的稳定性和功能有影响。在运行冰雹之前,应进行备份。
多亏了@gderybel,HardeningKitty可以将查找列表转换为组策略。作为基本要求,必须安装组策略管理PowerShell模块。目前,只有注册表设置才能转换,并且并非所有内容都已进行了测试。只要没有将其分配给对象,就可以创建一个新的策略,就不会对系统进行更改。谨慎使用它。
Invoke-HardeningKitty - Mode GPO - FileFindingList .listsfinding_list_0x6d69636b_machine.csv - GPOName HardeningKitty - Machine - 01 每个通过的发现给出了4分,一个低的发现给出了2分,一个介质发现给出1分,一个高发现给出0分。
HardeningKitty评分的公式为(达到点 /最大点) * 5 + 1 。
| 分数 | 等级休闲 | 评级专业人士 |
|---|---|---|
| 6 | ?出色的 | 出色的 |
| 5 | ?做得好 | 好的 |
| 4 | ?充足的 | 充足的 |
| 3 | ?你应该做得更好 | 不足的 |
| 2 | ?虚弱的 | 不足的 |
| 1 | ?虚假 | 不足的 |
Ataumo构建了一个基于Web的界面,用于HardeningKitty。该工具可用于创建自己的列表,并提供有关硬化设置的其他信息。源代码在AGPL许可下,并且有一个演示站点。
HardeningKitty可用于针对以下基准 /基准测试系统审核系统:
| 姓名 | 系统版本 | 版本 |
|---|---|---|
| 0x6d69636b Windows 10(机器) | 22H2 | |
| 0x6d69636b Windows 10(用户) | 22H2 | |
| BSI Sisyphus Windows 10 Hoher SchutzbedarfDomänenmitglied(机器) | 1809年 | 1.0 |
| BSI Sisyphus Windows 10 Hoher Schutzbedarfdomänenmitglied(用户) | 1809年 | 1.0 |
| BSI Sisyphus Windows 10正常的Schutzbedarfdomänenmitglied(机器) | 1809年 | 1.0 |
| BSI Sisyphus Windows 10正常人Schutzbedarfdomänenmitglied(用户) | 1809年 | 1.0 |
| BSI Sisyphus Windows 10正常人Schutzbedarf Einzelrechner(机器) | 1809年 | 1.0 |
| BSI Sisyphus Windows 10 Normaler Schutzbedarf Einzelrechner(用户) | 1809年 | 1.0 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 1809年 | 1.6.1 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 1809年 | 1.6.1 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 1903年 | 1.7.1 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 1903年 | 1.7.1 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 1909年 | 1.8.1 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 1909年 | 1.8.1 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 2004 | 1.9.1 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 2004 | 1.9.1 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 20H2 | 1.10.1 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 20H2 | 1.10.1 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 21H1 | 1.11.0 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 21H1 | 1.11.0 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 21H2 | 1.12.0 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 21H2 | 1.12.0 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 22H2 | 2.0.0 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 22H2 | 2.0.0 |
| 顺式Microsoft Windows 10 Enterprise(机器) | 22H2 | 3.0.0 |
| 顺式Microsoft Windows 10 Enterprise(用户) | 22H2 | 3.0.0 |
| 顺式Microsoft Windows 11 Enterprise(机器) | 21H2 | 1.0.0 |
| 顺式Microsoft Windows 11 Enterprise(用户) | 21H2 | 1.0.0 |
| 顺式Microsoft Windows 11 Enterprise(机器) | 22H2 | 2.0.0 |
| 顺式Microsoft Windows 11 Enterprise(用户) | 22H2 | 2.0.0 |
| 顺式Microsoft Windows 11 Enterprise(机器) | 23H2 | 3.0.0 |
| 顺式Microsoft Windows 11 Enterprise(用户) | 23H2 | 3.0.0 |
| 顺式Microsoft Windows Server 2012 R2(机器) | R2 | 2.4.0 |
| 顺式Microsoft Windows Server 2012 R2(用户) | R2 | 2.4.0 |
| 顺式Microsoft Windows Server 2012 R2(机器) | R2 | 2.6.0 |
| 顺式Microsoft Windows Server 2012 R2(用户) | R2 | 2.6.0 |
| 顺式Microsoft Windows Server 2012 R2(机器) | R2 | 3.0.0 |
| 顺式Microsoft Windows Server 2012 R2(用户) | R2 | 3.0.0 |
| CIS Microsoft Windows Server 2016(机器) | 1607年 | 1.2.0 |
| 顺式Microsoft Windows Server 2016(用户) | 1607年 | 1.2.0 |
| CIS Microsoft Windows Server 2016(机器) | 1607年 | 1.3.0 |
| 顺式Microsoft Windows Server 2016(用户) | 1607年 | 1.3.0 |
| CIS Microsoft Windows Server 2016(机器) | 1607年 | 2.0.0 |
| 顺式Microsoft Windows Server 2016(用户) | 1607年 | 2.0.0 |
| CIS Microsoft Windows Server 2016(机器) | 1607年 | 3.0.0 |
| 顺式Microsoft Windows Server 2016(用户) | 1607年 | 3.0.0 |
| CIS Microsoft Windows Server 2019(机器) | 1809年 | 1.1.0 |
| 顺式Microsoft Windows Server 2019(用户) | 1809年 | 1.1.0 |
| CIS Microsoft Windows Server 2019(机器) | 1809年 | 1.2.1 |
| 顺式Microsoft Windows Server 2019(用户) | 1809年 | 1.2.1 |
| CIS Microsoft Windows Server 2019(机器) | 1809年 | 2.0.0 |
| 顺式Microsoft Windows Server 2019(用户) | 1809年 | 2.0.0 |
| CIS Microsoft Windows Server 2019(机器) | 1809年 | 3.0.0 |
| 顺式Microsoft Windows Server 2019(用户) | 1809年 | 3.0.0 |
| 顺式Microsoft Windows Server 2022(机器) | 21H2 | 1.0.0 |
| 顺式Microsoft Windows Server 2022(用户) | 21H2 | 1.0.0 |
| 顺式Microsoft Windows Server 2022(机器) | 22H2 | 2.0.0 |
| 顺式Microsoft Windows Server 2022(用户) | 22H2 | 2.0.0 |
| 顺式Microsoft Windows Server 2022(机器) | 22H2 | 3.0.0 |
| 顺式Microsoft Windows Server 2022(用户) | 22H2 | 3.0.0 |
| DOD Microsoft Windows 10 Stig(机器) | 20H2 | V2R1 |
| DOD Microsoft Windows 10 Stig(用户) | 20H2 | V2R1 |
| DOD Windows Server 2019域控制器Stig(机器) | 20H2 | V2R1 |
| DOD Windows Server 2019域控制器Stig(用户) | 20H2 | V2R1 |
| DOD Windows Server 2019成员服务器(机器) | 20H2 | V2R1 |
| DOD Windows Server 2019成员服务器Stig(用户) | 20H2 | V2R1 |
| DOD Windows Defender Antivirus Stig | 20H2 | V2R1 |
| DOD Windows防火墙柱头 | 20H2 | V1R7 |
| Microsoft Edge的Microsoft安全基线 | 87 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 88、89、90、91 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 92 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 93,94 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 95 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 96 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 97 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 98、99、100、101、102、103、104、105、106 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 107、108、109、110、111 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 112,113 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 114、115、116 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 117、118、119、120、121、122、123、124、125、126、127 | 最终的 |
| Microsoft Edge的Microsoft安全基线 | 128,129,130 | 最终的 |
| Windows 10的Microsoft安全基线 | 2004 | 最终的 |
| Windows 10的Microsoft安全基线 | 20H2,21H1 | 最终的 |
| Windows 10的Microsoft安全基线 | 21H2 | 最终的 |
| Windows 10(机器)的Microsoft安全基线 | 22H2 | 最终的 |
| Windows 10(用户)的Microsoft安全基线 | 22H2 | 最终的 |
| Windows 11的Microsoft安全基线 | 21H2 | 最终的 |
| Windows 11(机器)的Microsoft安全基线 | 22H2 | 最终的 |
| Windows 11(用户)的Microsoft安全基线 | 22H2 | 最终的 |
| Windows 11(机器)的Microsoft安全基线 | 23H2 | 最终的 |
| Windows 11(用户)的Microsoft安全基线 | 23H2 | 最终的 |
| Windows 11(机器)的Microsoft安全基线 | 24H2 | 最终的 |
| Windows 11(用户)的Microsoft安全基线 | 24H2 | 最终的 |
| Windows Server(DC)的Microsoft安全基线 | 2004 | 最终的 |
| Windows Server的Microsoft安全基线(成员) | 2004 | 最终的 |
| Windows Server(DC)的Microsoft安全基线 | 20H2 | 最终的 |
| Windows Server的Microsoft安全基线(成员) | 20H2 | 最终的 |
| Windows Server 2022(DC)的Microsoft安全基线 | 21H2 | 最终的 |
| Windows Server 2022(成员)的Microsoft安全基线 | 21H2 | 最终的 |
| Office 365 Proplus(机器)的Microsoft安全基线 | 2019年9月 | 最终的 |
| Office 365 Proplus(用户)的Microsoft安全基线 | 2019年9月 | 最终的 |
| Microsoft Security Bayliare for Enterprise(机器)的Microsoft 365应用程序 | V2104,V2106 | 最终的 |
| Microsoft Security Baselizon for Enterprise(用户)的Microsoft 365应用程序 | V2104,V2106 | 最终的 |
| Microsoft Security Bayliare for Enterprise(机器)的Microsoft 365应用程序 | V2112 | 最终的 |
| Microsoft Security Baselizon for Enterprise(用户)的Microsoft 365应用程序 | V2112 | 最终的 |
| Microsoft Security Bayliare for Enterprise(机器)的Microsoft 365应用程序 | V2206 | 最终的 |
| Microsoft Security Baselizon for Enterprise(用户)的Microsoft 365应用程序 | V2206 | 最终的 |
| Microsoft Security Bayliare for Enterprise(机器)的Microsoft 365应用程序 | V2306,V2312 | 最终的 |
| Microsoft Security Baselizon for Enterprise(用户)的Microsoft 365应用程序 | V2306,V2312 | 最终的 |
| Microsoft Windows Server TLS设置 | 1809年 | 1.0 |
| Microsoft Windows Server TLS设置(将来与TLSV1.3一起使用) | 1903年 | 1.0 |