Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
AzureADAssessment — 用于评估 Azure AD 租户状态和配置的工具集 | Kitploit
工具/GitHubGitHub/azuread/azureadassessment
云基础设施安全防御工具配置审计信息收集云安全身份与访问管理 (IAM)
GitHubazuread/azureadassessment

AzureADAssessment

用于评估 Azure AD 租户状态和配置的工具集

查看仓库
8501162年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Microsoft Azure AD 评估

PSGallery Version PSGallery Downloads PSGallery Platform

评估人员指南

如果你是执行客户评估的 Microsoft 员工或合作伙伴,请参阅 Wiki 中的评估指南。

从 PowerShell 库安装

如果遇到任何错误,请参阅本文档末尾的常见问题解答部分。

root@kitploit:~
Install-Module AzureADAssessment -Force -Scope CurrentUser

## If you have already installed the module, run the following instead to ensure you have the latest version.
Update-Module AzureADAssessment -Force -Scope CurrentUser

在 Entra ID 中创建应用

该评估要求在租户中创建自定义应用。

  • 打开 Entra 管理中心 > 标识 > 应用程序 > 应用注册
  • 选择 新注册
    • 名称:输入应用程序的名称(例如 Entra Assessment Account)
    • 重定向 URI:
      • 从下拉列表中选择 移动和桌面应用程序
      • 将 URI 设置为 https://login.microsoftonline.com/common/oauth2/nativeclient
    • 选择 注册 以创建应用
  • 从左侧导航中选择刚创建的应用的 身份验证 边栏选项卡
  • 将 允许公共客户端流 设置为 是
  • 单击 保存

运行数据收集

可以从任何可访问 Azure AD 的客户端运行来自 Azure AD 的数据收集。但是,来自混合组件(例如 AD FS、AAD Connect 等)的数据收集最好在这些服务器上本地运行。AAD Connect 数据收集需要在主服务器和暂存服务器上运行。

验证你拥有访问这些工作负载的授权凭据:

  • Azure Active Directory 的全局管理员或全局读取者权限
  • 对 ADFS 服务器具有域管理员或本地管理员访问权限
  • 对 Azure AD 代理连接器服务器具有域管理员或本地管理员访问权限
  • 对 Azure AD Connect 服务器(主服务器)具有域管理员或本地管理员访问权限
  • 对 Azure AD Connect 服务器(暂存服务器)具有域管理员或本地管理员访问权限

首次连接时,系统会要求你同意评估所需的权限。需要管理员提供同意。

运行以下命令以生成完成评估所需的全部 Azure AD 数据包。

root@kitploit:~
## Authenticate using a Global Admin or Global Reader account.
Connect-AADAssessment -ClientId "AppId of app created in the previous step"

## Export data to "C:\AzureADAssessment" into a single output package.
Invoke-AADAssessmentDataCollection

输出包将按照以下模式命名:AzureADAssessmentData-<TenantDomain>.aad

如果数据收集命令在完成前失败,请尝试使用 SkipReportOutput 参数重新运行。

root@kitploit:~
Invoke-AADAssessmentDataCollection -SkipReportOutput

在每台运行混合组件的服务器上,安装相同的模块并运行 Invoke-AADAssessmentHybridDataCollection 命令。

root@kitploit:~
## Export Data to "C:\AzureADAssessment" into a single output package.
Invoke-AADAssessmentHybridDataCollection

输出包将按照以下模式命名:AzureADAssessmentData-<Svc>-<ServerName>.zip

数据收集完成后,将输出包提供给完成评估的人员。请勿对生成的文件(包括文件名)进行任何更改。

完成评估报告

如果你自行生成并查看输出,请参阅 Wiki 中的评估指南。

常见问题解答

我无法通过 Internet 在 AAD Connect、ADFS、应用代理服务器上安装模块

要从混合组件(如 AAD Connect、AD FS、AAD 应用代理)收集数据,你可以导出此模块的便携版本,以便轻松复制到没有互联网连接的服务器。

root@kitploit:~
## Export Portable Module to "C:\AzureADAssessment".
Export-AADAssessmentPortableModule "C:\AzureADAssessment"

在每台运行混合组件的服务器上,将模块文件 "AzureADAssessmentPortable.psm1" 复制并导入到该服务器。

root@kitploit:~
## Import the module on each server running hybrid components.
Import-Module "C:\AzureADAssessment\AzureADAssessmentPortable.psm1"

## Export Data to "C:\AzureADAssessment" into a single output package.
Invoke-AADAssessmentHybridDataCollection

我想将评估文件输出到其他目录

root@kitploit:~
## If you would like to specify a different directory, use the OutputDirectory parameter.
Invoke-AADAssessmentDataCollection "C:\Temp"
Invoke-AADAssessmentHybridDataCollection "C:\Temp"

我想使用服务主体标识而不是用户标识来运行评估

如果你希望出于自动化目的使用自己的应用注册(服务主体),可以使用自己的 ClientId 和证书进行连接,如下例所示。你的应用注册应包含对 MS Graph 的 Directory.Read.All、Policy.Read.All 和 AuditLog.Read.All 应用程序权限,以便进行完整评估。添加后,请确保你已在服务主体上完成这些权限的管理员同意。

root@kitploit:~
## Connect using Service Principal identity with app permissions.
Connect-AADAssessment -ClientId <ClientId> -ClientCertificate (Get-Item 'Cert:\CurrentUser\My\<Thumbprint>') -TenantId <TenantId>

我在主权云中有一个租户,如何运行此评估?

你必须先在租户中创建应用注册,并在运行 Connect-AADAssessment 时提供 ClientId。只要为云环境定义正确的重定向 URI,默认应用程序配置即可正常工作。例如,"移动和桌面应用程序"的重定向 URI 为 https://login.microsoftonline.us/common/oauth2/nativeclient。

root@kitploit:~
## Example connecting to USGov cloud environment using user delegated permissions.
Connect-AADAssessment -ClientId <ClientId> -CloudEnvironment USGov -TenantId <TenantId>

## Example connecting to USGov cloud environment using app permissions.
Connect-AADAssessment -ClientId <ClientId> -ClientCertificate (Get-Item 'Cert:\CurrentUser\My\<Thumbprint>') -CloudEnvironment USGov -TenantId <TenantId>

尝试安装模块时,收到错误 'A parameter cannot be found that matches parameter name 'AcceptLicense'

在尝试重新安装 AzureADAssessment 模块之前,运行以下命令将 PowerShellGet 更新到最新版本。选项 1 是执行脚本(https://aka.ms/Update-PowerShellGet)的单个命令,而选项 2 需要多个命令,并且可能需要进行一些故障排除。

root@kitploit:~
### Option 1: Run the following command to download and execute a script to update PowerShellGet. Note: Navigate to this URL in a web browser to see the contents of the script in GitHub.
iex $(irm 'https://aka.ms/Update-PowerShellGet')

### Option 2: Run the following commands individually.
## Update Nuget Package and PowerShellGet Module
Install-PackageProvider NuGet -Scope CurrentUser -Force
Install-Module PowerShellGet -Scope CurrentUser -Force -AllowClobber
## Remove old modules from existing session
Remove-Module PowerShellGet,PackageManagement -Force -ErrorAction Ignore
## Import updated module
Import-Module PowerShellGet -MinimumVersion 2.0 -Force
Import-PackageProvider PowerShellGet -MinimumVersion 2.0 -Force

如果在任何时候看到错误 <Path> cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.,你必须启用本地脚本运行。

root@kitploit:~
## Set globally on device
Set-ExecutionPolicy RemoteSigned
## Or set for just for current PowerShell session.
Set-ExecutionPolicy RemoteSigned -Scope Process

MSAL.PS 证书错误(Authenticode 颁发者)

MSAL.PS 的签名证书将改用 Microsoft 的代码签名流程。如果你看到以下错误,PackageManagement\Install-Package : Authenticode issuer 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' of the new module 'MSAL.PS' with version 'x.x.x.x' from root certificate authority 'CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' is not matching with the authenticode issuer 'CN=Jason Thompson, O=Jason Thompson, L=Cincinnati, S=Ohio, C=US' of the previously-installed module 'MSAL.PS' with version 'x.x.x.x' from root certificate authority 'CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US'. If you still want to install or update, use -SkipPublisherCheck parameter.,可以使用以下命令解决该错误。

root@kitploit:~
Install-Module MSAL.PS -SkipPublisherCheck -Force

无法使用设备代码流登录

如果你使用的是 PowerShell Core(即 PowerShell 6 或 7),并且租户要求合规或混合 Azure AD 加入设备的条件访问策略,则可能无法登录。

若要解决此问题,请使用 Windows PowerShell(而不是 PowerShell 6 或 7)。要启动 Windows PowerShell,请转到 开始 > Windows PowerShell

无法在 PowerBI 模板中加载数据

打开 PowerBI 模板时,系统会要求你引用提取数据所在的文件夹(csv 和 json)。选择后,PowerBI 将加载数据。 执行此操作时,PowerBI 可能会报告与数据源交叉引用相关的错误:

root@kitploit:~
Query '*' (step '*') references other queries or steps, so it may not directly access a datasource. Please rebuild this data combination.  

若要解决此问题,请配置 PowerBI 文件设置以忽略隐私设置:

  • 文件 > 选项和设置 > 选项
  • 在 选项 中的 当前文件 下找到 隐私
  • 在 隐私级别 中选择 忽略隐私级别并可能提高性能

内容

参与贡献

本项目欢迎贡献和建议。大多数贡献需要你同意贡献者许可协议(CLA),声明你有权且确实授予我们使用你的贡献的权利。有关详细信息,请访问 https://cla.opensource.microsoft.com。

当你提交拉取请求时,CLA 机器人会自动确定你是否需要提供 CLA,并适当地装饰 PR(例如状态检查、评论)。只需按照机器人提供的说明操作即可。在所有使用我们 CLA 的仓库中,你只需执行此操作一次。

本项目已采用 Microsoft 开源行为准则。 有关详细信息,请参阅行为准则常见问题解答,或通过 [email protected] 联系我们提出任何其他问题或评论。

有关贡献的更详细指导和建议,请参阅贡献页面。

下载工具
File/folderDescription
build用于打包、测试、签名和发布模块的脚本。
src模块源代码。
tests模块的测试脚本。
.gitignore定义提交时要忽略的内容。
README.md本 README 文件。
LICENSE模块的许可证。