pingcastle – Active Directory域控安全检测工具

2022-08-19 8,640

pingcastle简介:

PingCastle旨在使用基于风险评估和成熟度框架的方法快速评估 Active Directory 安全级别。它的目标不是完美的评估,而是效率的妥协。
Active Directory 正迅速成为任何大型公司的关键故障点,因为它既复杂又昂贵。
可使用pingcastle对Active Directory安全性进行评估.

委派漏洞检查示例

在委派创建用户或计算机的权利时,可能会犯错误,从而为攻击者打开了道路。PingCastle 可以快速扫描权限以发现此类漏洞。

注意事项:

pingcastle工具会被杀毒软件报毒,该工具安全,使用与否自行裁决.

检测报告示例:

可自行到如下链接进行查看报告样式:
pingcastle.com/PingCastleFiles/ad_hc_test.mysmartlogon.com.html


官网地址:

https://pingcastle.com/

pingcastle下载地址:

GitHub:https://github.com/vletoux/pingcastle/releases/download/2.11.0.0/PingCastle_2.11.0.0.zip

云中转网盘:

yunzhongzhuan.com/#sharefile=AJZSeirR_70483
解压密码:www.ddosi.org

目录列表

PingCastle_2.11.0.0中包含如下文件,其中包含Active Directory安全自我评估手册PingCastle v2.11.0使用说明书(英文版).

+---PingCastle_2.11.0.0|                          Active Directory Security Self Assessment v1.4.pdf
|       changelog.txt
|       license.rtf
|       Newtonsoft.Json.dll
|       PingCastle v2.11.0.pdf
|       PingCastle.exe
|       PingCastle.exe.config                          |       PingCastle.pdb
|       PingCastleAutoUpdater.exe
|       PingCastleAutoUpdater.exe.config               |       PingCastleAutoUpdater.pdb
|       PingCastleCloud.exe
|       PingCastleCloud.exe.config                     |       PingCastleCloud.pdb

pingcastle安装及使用方法

先决条件:

操作系统版本≥Windows 2000.
安装了解压工具,例如winrar.

注意事项:
对于 Windows 2000,您需要安装 dotnet framework 2.0

①解压

②双击PingCastle.exe运行.

③按键盘的 或者 ↓ 进行选择,然后回车.

比如我们选择了第一个,接下里会让你输入域控域名:

请指定要调查的域或服务器:

也可以使用命令行直接运行,例如:

PingCastle.exe --healthcheck --server ddosi.org

工具运行流程图:

PingCastle交互式命令参数:

  ==--O___      PingCastle (Version 2.11.0.0     2022/8/8 2:56:14)
    /   ¨¨>   Get Active Directory Security at 80% in 20% of the time
   /    ,’    End of support: 2024/1/31
    O¨---O
      ,'       Vincent LE TOUX (contact@pingcastle.com)
      v         twitter: @mysmartlogon       https://www.pingcastle.com
What do you want to do?
=======================
使用交互模式。不要忘记还有其他命令行开关,如--help,您可以使用
 1-healthcheck-对域的风险进行评分
 2-conso      -将多个报表聚合为单个报表
 3-carto      -构建所有互联域的映射
 4-scanner    -对工作站进行特定的安全检查
 5-export     -导出用户或计算机
 6-advanced   -打开高级菜单
 0-Exit
==============================
1-healthcheck
这是PingCastle的主要功能。在几分钟的时间内,它会生成一个报告,给你一个Active Directory安全性的概览。通过使用现有的信任链接,可以在其他域上生成此报告。2-conso
有了许多健康检查报告,您可以获得整个范围的单个报告。将生成地图。3-carto
它合并了将在所有受信任域上运行的健康检查报告,然后是conso选项。但是更轻,然后更快。4-scanner
您可以知道您的本地管理员,如果Bitlocker配置正确,发现不保护的共享,…一个菜单将显示选择正确的扫描仪。5-export
不要涉及您的管理员,获取您想要获得的用户或计算机列表。将显示一个菜单来选择导出。6-advanced
这是您希望在不使用命令行开关的情况下配置PingCastle的地方。

PingCastle完整命令参数列表

中文翻译:

switch:  --help              : 显示此消息
 --interactive       : 强制交互模式
 --log               : 生成日志文件
 --log-console       : 将日志添加到控制台
 --log-samba <option>: 启用samba登录(示例:10)连接AD时的常用选项  --server <server>   : 使用此服务器(默认值:当前域控制器)
                       特殊值**.forest对所有域进行健康检查  --port <port>       : ADWS或LDAP使用的端口(默认:9389或389)
 --user <user>       : 使用此用户(默认:integrated authentication)
 --password <pass>   : 使用此密码(默认:在安全提示下询问)
 --protocol <proto>  : 选择LDAP或ADWS之间使用的协议(最快)
                     : ADWSThenLDAP (默认), ADWSOnly, LDAPOnly, LDAPThenADWS  --pagesize <size>   : 更改默认的LDAP页面大小-默认为500
 --quota <num>       : 每秒将被处理的LDAP条目数——默认无限制

 --carto             : 使用周围的域进行快速制图

 --healthcheck       : 执行健康检查(step1)
   --api-endpoint <> : 通过API调用上传报告,例如: http://server
   --api-key  <key>  : 并使用已注册的API密钥
   --explore-trust   : 对于forest的域,在运行状况检查之后,对除forest和forest信任域之外的所有受信任域进行hc
   --explore-forest-trust : 在forest的root域上,在运行状况检查之后,对发现的所有forest信任执行hc
   --explore-trust 和 --explore-forest-trust 可以一起运行
   --explore-exception <domains> : 逗号分隔的域值不会被自动探索

   --datefile        : 在报告文件名中插入日期
   --encrypt         : 使用存储在.config文件中的RSA密钥来加密xml报告的内容
   --level <level>   : 指定在XML文件中找到的数据量
                     : level: Full, Normal, Light    --no-enum-limit   : 删除HTML报告中最大100个用户的限制
   --reachable       : 将可达域添加到已发现域列表中
   --sendXmlTo <emails>: 将XML报告发送到邮箱(逗号分隔的电子邮件)
   --sendHtmlTo <emails>: 发送HTML报表到邮箱
   --sendAllTo <emails>: 发送HTML报表到邮箱
   --notifyMail <emails>: 添加接收邮件时的邮件通知
   --smtplogin <user>: 允许SMTP凭据…
   --smtppass <pass> : ... 在命令行中输入
   --smtptls         : 如果在465和587以外的端口使用SMTP协议,请启用TLS/SSL
   --skip-null-session: 不测试空会话
   --webdirectory <dir>: 将XML报告上传到webdav服务器
   --webuser <user>  : 可选用户和密码
   --webpassword <password>
   --max-depth       : 探索的最大关系数(默认值:30)
   --max-nodes       : 包含的最大节点数(默认:1000)
   --node <node>     : 创建基于对象的报告
                     : 例如: "cn=name" 或者 "name"    --nodes <file>    : 根据文件中列出的节点创建x报告

   --I-swear-I-paid-win7-support : meaningless
   --I-swear-I-paid-win8-support : meaningless--rules               : 生成一个包含PingCastle使用的所有规则的html

 --generate-key      : 生成并显示用于加密的新RSA密钥

 --hc-conso          : 合并多个健康检查XML报告(步骤2)
   --center-on <domain> : 将简化图放在这个域的中心
                        默认是链接最多的域    --xmls <path>     : 指定包含XML的路径(默认:当前目录)
   --filter-date <date>: 日期之后生成的筛选报告。

 --regen-report <xml> : 基于XML报告重新生成HTML报告
 --reload-report <xml> : 基于XML报告重新生成XML报告
                         任何healthcheck交换机(发送电子邮件,..)都可以重用    --level <level>   : 指定在XML文件中找到的数据量
                     : 级别:Full, Normal, Light(默认为Normal)    --encrypt         : 使用存储在.config文件中的RSA密钥来加密xml报告的内容
                       如果加密的报表上没有此开关,将生成解密的报表  --scanner <type>    : 在域的所有计算机之一上执行扫描(使用--server)aclcheck
检查与用户/组相关的授权。默认为everyone、认证用户和域用户
antivirus
检查没有安装防病毒软件的电脑。它用于检测未受保护的计算机,但也可能报告带有未知杀毒软件的计算机。computerversion
可以用来确定过时的操作系统是否仍然存在。foreignusers
使用信任枚举位于拒绝域(如堡垒或太远的域)中的用户。laps_bitlocker
检查AD,如果laps和/或BitLocker已为域上的所有计算机启用。localadmin
列举计算机的本地管理员。nullsession
检查是否启用了空会话,并提供示例。nullsession-trust
如果可能,通过空会话转储域的信任。oxidbindings
通过Oxid解析器(DCOM的一部分)列出计算机的所有IP。没有身份验证。用于查找其他网络,如用于管理的网络。remote
检查计算机上是否安装了远程桌面解决方案。share
列出计算机上发布的所有共享,并确定该共享是否可以被任何人访问
smb
扫描计算机并确定smb可用版本。如果SMB签名是活动的。smb3querynetwork
使用SMB3列出计算机的所有IP和接口速度。认证要求。用于查找其他网络,如用于管理的网络。spooler
检查后台处理程序服务是否处于远程活动状态。当利用不受约束的委托时,后台处理程序可能被滥用以获取计算机令牌。startup
获取计算机的最后一次启动日期。可用于确定是否应用了最新的补丁。zerologon
测试ZeroLogon漏洞。重要:测试人员必须在域内。不能使用信任。可选扫描项:    --scmode-single   : 强制扫描仪检查一台计算机
   --scmode-workstation : 强制扫描仪检查工作站
   --scmode-server   : 强制扫描器检查服务器
   --scmode-dc       : 强制扫描仪检查dc
   --scmode-file <file> : 强制扫描仪从文件中使用计算机
   --nslimit <number>: 限制枚举的用户数量(默认:无限制)
   --foreigndomain <sid> : 使用FQDN或sid的外域
                       SID示例: S-1-5-21-4005144719-3948538632-2546531719

 --export <type>    : 执行域对象的导出(使用--server)changes
实时导出域中发生的所有修改
computers
导出所有电脑
users
导出所有用户                                             --upload-all-reports: 使用API上传当前目录中的所有报表
   --api-endpoint <> : 通过API调用上传报告例如: http://server
   --api-key  <key>  : 并使用已注册的API密钥
                       注意:不要忘记设置--level Full发送所有可用信息

英文原版:

switch:                                                      --help              : display this message
 --interactive       : force the interactive mode
 --log               : generate a log file
 --log-console       : add log to the console
 --log-samba <option>: enable samba login (example: 10)Common options when connecting to the AD            --server <server>   : use this server (default: current domain controller)
                       the special value * or *.forest do the healthcheck for all domains  --port <port>       : the port to use for ADWS or LDAP (default: 9389 or 389)
 --user <user>       : use this user (default: integrated authentication)
 --password <pass>   : use this password (default: asked on a secure prompt)
 --protocol <proto>  : selection the protocol to use among LDAP or ADWS (fastest)
                     : ADWSThenLDAP (default), ADWSOnly, LDAPOnly, LDAPThenADWS  --pagesize <size>   : change the default LDAP page size - default is 500
 --quota <num>       : Number of LDAP items per second that will be processed - default unlimited

 --carto             : perform a quick cartography with domains surrounding

 --healthcheck       : perform the healthcheck (step1)
   --api-endpoint <> : upload report via api call eg: http://server
   --api-key  <key>  : and using the api key as registered
   --explore-trust   : on domains of a forest, after the healthcheck, do the hc on all trusted domains except domains of the forest and forest trusts
   --explore-forest-trust : on root domain of a forest, after the healthcheck, do the hc on all forest trusts discovered
   --explore-trust and --explore-forest-trust can be run together
   --explore-exception <domains> : comma separated values of domains that will not be explored automatically

   --datefile        : insert the date into the report filename
   --encrypt         : use an RSA key stored in the .config file to crypt the content of the xml report
   --level <level>   : specify the amount of data found in the xml file
                     : level: Full, Normal, Light    --no-enum-limit   : remove the max 100 users limitation in html report
   --reachable       : add reachable domains to the list of discovered domains
   --sendXmlTo <emails>: send xml reports to a mailbox (comma separated email)
   --sendHtmlTo <emails>: send html reports to a mailbox
   --sendAllTo <emails>: send html reports to a mailbox
   --notifyMail <emails>: add email notification when the mail is received
   --smtplogin <user>: allow smtp credentials ...
   --smtppass <pass> : ... to be entered on the command line
   --smtptls         : enable TLS/SSL in SMTP if used on other port than 465 and 587
   --skip-null-session: do not test for null session
   --webdirectory <dir>: upload the xml report to a webdav server
   --webuser <user>  : optional user and password
   --webpassword <password>
   --max-depth       : maximum number of relation to explore (default:30)
   --max-nodes       : maximum number of node to include (default:1000)
   --node <node>     : create a report based on a object
                     : example: "cn=name" or "name"    --nodes <file>    : create x report based on the nodes listed on a file

   --I-swear-I-paid-win7-support : meaningless
   --I-swear-I-paid-win8-support : meaningless--rules               : Generate an html containing all the rules used by PingCastle

 --generate-key      : generate and display a new RSA key for encryption

 --hc-conso          : consolidate multiple healthcheck xml reports (step2)
   --center-on <domain> : center the simplified graph on this domain
                        default is the domain with the most links    --xmls <path>     : specify the path containing xml (default: current directory)
   --filter-date <date>: filter report generated after the date.

 --regen-report <xml> : regenerate a html report based on a xml report
 --reload-report <xml> : regenerate a xml report based on a xml report
                         any healthcheck switches (send email, ..) can be reused    --level <level>   : specify the amount of data found in the xml file
                     : level: Full, Normal, Light (default: Normal)    --encrypt         : use an RSA key stored in the .config file to crypt the content of the xml report
                       the absence of this switch on an encrypted report will produce a decrypted report  --scanner <type>    : perform a scan on one of all computers of the domain (using --server)aclcheckCheck authorization related to users or groups. Default to everyone, authenticated users and domain users
antivirusCheck for computers without known antivirus installed. It is used to detect unprotected computers but may also report computers with unknown antivirus.
computerversionGet the version of a computer. Can be used to determine if obsolete operating systems are still present.
foreignusers
Use trusts to enumerate users located in domain denied such as bastion or domains too far away.
laps_bitlockerCheck on the AD if LAPS and/or BitLocker has been enabled for all computers on the domain.
localadmin
Enumerate the local administrators of a computer.
nullsessionCheck if null sessions are enabled and provide example(s).
nullsession-trust
Dump the trusts of a domain via null session if possible
oxidbindings
List all IP of the computer via the Oxid Resolver (part of DCOM). No authentication. Used to find other networks such as the one used for administration.
remoteCheck if a remote desktop solution is installed on the computer.
share
List all shares published on a computer and determine if the share can be accessed by anyone
smb
Scan a computer and determine the smb version available. Also if SMB signing is active.
smb3querynetwork
List all IP of the computer and the interface speed using SMB3. Authentication required. Used to find other networks such as the one used for administration.
spoolerCheck if the spooler service is remotely active. The spooler can be abused to get computer tokens when unconstrained delegations are exploited.
startupGet the last startup date of a computer. Can be used to determine if latest patches have been applied.
zerologon
Test for the ZeroLogon vulnerability. Important: the tester must be inside the domain. Trusts cannot be used.
 options for scanners:                                                                          --scmode-single   : force scanner to check one single computer
   --scmode-workstation : force scanner to check workstations
   --scmode-server   : force scanner to check servers
   --scmode-dc       : force scanner to check dc
   --scmode-file <file> : force scanner to use the computer from file
   --nslimit <number>: Limit the number of users to enumerate (default: unlimited)
   --foreigndomain <sid> : foreign domain targeted using its FQDN or sids
                       Example of SID: S-1-5-21-4005144719-3948538632-2546531719

 --export <type>    : perform an export of objects of the domain (using --server)changes
Export all modifications that occurs in the domain in real timecomputers
Export all computers
users
Export all users                                         --upload-all-reports: use the API to upload all reports in the current directory
   --api-endpoint <> : upload report via api call eg: http://server
   --api-key  <key>  : and using the api key as registered
                       Note: do not forget to set --level Full to send all the information available

PingCastle使用的最新规则列表

https://pingcastle.com/PingCastleFiles/ad_hc_rules_list.html

陈旧的对象 特权帐户 信托 异常情况
非活动用户或计算机 账户接管 旧的信任协议 审计
网络拓扑 ACL 检查 SID 过滤 备份
对象配置 管理员控制 SID历史 证书接管
过时的操作系统 控制路径 信任不渗透性 金票
旧的身份验证协议 委托检查 信任无效 本地组漏洞
供应 不可逆转的变化 信任 Azure 网络嗅探
复制 权限控制
传递凭证
漏洞管理 只读域控制器
取回密码



侦察



临时管理员



密码强度低

map

地图是由“信任”链接的活动目录的表示。根据信息的新鲜度和信任链接的深度,它可能更准确或更准确。事实上,当开始这个过程时,没有太多可用的信息,PingCastle 使用了一组技巧来尽可能地扩展它。

常见问题及答案:

我有个问题。我应该怎么办?

如果你有问题,你应该再试一次。有时会出现连接问题。如果再次发生,请通过运行 –log 并最终添加 –interactive 来收集日志。然后联系我们的支持。请注意,免费支持是有限的

“支持终止”日期是什么意思?

每年有 2 个主要版本意味着要支持很多版本。如果我们不为此制定强有力的政策,这将是一项重大的努力。当支持结束时,软件停止运行并建议使用最新版本。只有已购买许可证的客户才能继续使用旧版本。

PingCastle 是否会发出防病毒警报?

PingCastle 本身就是一种安全工具,一些防病毒策略会阻止安全工具。PingCastle 就像任何安全工具一样是一把双刃剑。同时检查多个工作站的扫描仪功能可能会由于打开的连接数量众多而引发警报。MS17-010 扫描程序应发出防病毒警报。因此,它是测试 SOC 的有效工具。

项目地址:

GitHub:
https://github.com/vletoux/pingcastle

本文转载自网络

作者:雨苁

原文链接:https://www.ddosi.org/pingcastle/


本文作者:HACK_Learn

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/185620.html

Tags:
评论  (0)
快来写下你的想法吧!

HACK_Learn

文章数:142 积分: 323

微信公众号:HACK学习呀

安全问答社区

安全问答社区

脉搏官方公众号

脉搏公众号