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

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

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

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

工具目录

分类

查看所有分类
Loading categories
Azure-AD-Password-Checker — Azure AD Password Checker | Kitploit
工具/GitHubGitHub/quahac/azure-ad-password-checker
Defensive ToolsConfiguration AuditingCloud SecurityIdentity & Access Management (IAM)AuthenticationRed Teaming
GitHubquahac/azure-ad-password-checker

Azure-AD-Password-Checker

Azure AD Password Checker

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Azure AD Password Checker

在 Azure AD 环境中,无需任何特殊权限即可确定用户是否已禁用多重身份验证 (MFA)。这可以通过分析账户的创建日期和上次密码更改日期来实现。

如果账户的创建日期和时间与其上次密码更改日期和时间一致,则可能表明自账户创建以来未发生任何人机交互,且用户无法启用多重身份验证 (MFA) 或更改其密码。此外还有其他“异常”,例如密码更改日期早于创建日期。这也表明,由于用户尚未创建,因此无法启用多重身份验证 (MFA)!

2023 年 10 月 16 日更新:

  • 两个用户在同一时间更改密码的可能性有多大?这可以视为另一种 MFA 异常。该异常将以蓝色标记,并标注为(出现的次数)

2024 年 2 月 18 日更新:

  • 将存在 MFA 异常的账户输出到文件
  • 无需更新密码即可通过电话或短信启用多重身份验证 (MFA)。但是,如果用户的账户未列出电话号码,管理员将无法激活电话或短信验证选项。这种遗漏意味着用户无法在创建账户时或登录过程中验证其电话号码。缺少电话号码验证使得更容易识别未配置 MFA 的账户。为解决此问题,没有电话号码的账户将以浅蓝色标记,并标注为(电话号码数量:x)。
    另请参阅:Microsoft/Azure SMS 或电话呼叫 - 在首次注册或登录期间,系统会要求用户提供并验证电话号码。在后续登录期间,系统会提示用户选择“发送代码”或“呼叫我”选项。

此信息可用于识别潜在的安全风险,供红队和蓝队使用。

此工具需要 roadrecon 数据库文件或借助 --code-javascript 选项提取的 JSON 文件。 Roadrecon 工具由 dirkjanm 开发,可在 github 上下载 https://github.com/dirkjanm/ROADtools 或通过 pip install roadrecon 安装。

使用方法请参阅:

root@kitploit:~
python3 azurepwchecker.py
usage: azurepwchecker.py [-h] [--roadrecon-dump] [--roadrecon-dump-mfa] [-d DB] [-m] [-l] [-ll] [-lll] [-la] [-lo]
                         [-ji JSON_INPUT] [-c]

Azure AD Password Checker - This is a parser for generated JSON file or the roadrecon database file designed for use by both red and blue teams. 
Database can be created when using --code-javascript option to extract 'merged_users.json' file with be created to later input this file with --json-input argument.
And roadrecon generated roadrecon.db file can be used! roadrecon is developed by https://github.com/dirkjanm credits to him!

options:
  -h, --help            show this help message and exit
  -d DB, --db DB        Specify the path to the 'roadrecon.db' database file, default is this location
  -m, --mfa-list        User Accounts without MFA (No privileged user required)! This argument helps identify user
                        accounts that have not enabled Multi-Factor Authentication (MFA). If an account's creation
                        date and time match its last password change date and time, it may indicate that no human
                        interaction has occurred since the account was created, and the user has not been able to
                        enable MFA or change their password. And there are other 'anomalies' such as the password
                        change date being older than the creation date. This suggests also that Multi-Factor
                        Authentication (MFA) couldn't be enabled because the User wasn't created yet! :-]
  -mo OUTFILE, --outfile OUTFILE
                        Output users with MFA anomalies to file
  -l, --pw-month        User accounts that had their passwords changed last month
  -ll, --pw-year        User accounts that had their passwords changed last year
  -lll, --pw-older      User accounts that haven't changed their passwords in a long time, oldest first
  -la, --admin          User accounts that are members of 'Admin' named groups, including 'Global Reader'
  -lo, --out-of-hours   User password change that occurred outside of office hours, specifically between 5:00 PM
                        (17:00) and 8:00 AM (08:00) on weekdays, as well as on Saturdays and Sundays
  -ji JSON_INPUT, --json-input JSON_INPUT
                        Provide the JSON file imported from your web browser's console using JavaScript. For
                        'createdDateTime' and 'lastPasswordChange' details, ensure you download the JSON output using
                        the '--code-javascript' option.
  -c, --code-javascript
                        Perform extraction even if 'azurepwchecker.py' or 'roadrecon' is unavailable. This script
                        enables extraction through the JavaScript console of a web browser. To proceed, ensure you
                        have a valid account to log in at https://portal.azure.com/#view/Microsoft_AAD_UsersAndTenants
                        /UserManagementMenuBlade/~/AllUsers or an active session on a computer. Copy and paste the
                        provided JavaScript code into the browser's console. Once the session is validated and you
                        have the necessary permissions, a JSON file named 'merged_users.json' will be generated. You
                        can then import it using the following command as example: 'azurepwchecker.py --json-input
                        merged_users.json -m'
  -v, --version         show program's version number and exit
  
run roadrecon first:
  (Run the following command to install the tool "pip install roadrecon)"

  --roadrecon-dump      "roadrecon dump" command or do it with roadrecon
  --roadrecon-dump-mfa  "roadrecon dump --mfa" command (requires privileged access) or do it with roadrecon

没有 roadrecon?> 生成并复制 azurepwchecker.py --code-javascript 或文件夹中的 js 文件:

按照以下步骤,使用提供的脚本获取用户列表及其账户信息。

  1. 登录 Azure 门户

    • 前往 https://portal.azure.com 并使用你的有效账户登录。
  2. 访问用户管理

    • 在 Azure 门户中导航到用户管理。
  3. 打开开发者工具

    • 在你的 Web 浏览器中按 F12 打开开发者工具。
  4. 执行脚本

    • 复制并粘贴提供的脚本。
  5. 获取用户列表和用户信息

    • 脚本将获取用户列表以及用户信息,包括创建日期和上次密码更改。
  6. 下载合并的用户信息

    • 脚本执行完成后,请检查你的下载。如果一切顺利,将生成一个名为 merged_users.json 的文件。
  7. 在 Azure AD Password Checker 中运行

    • azurepwchecker.py --json-input merged_users.json

查看示例:

https://github.com/quahac/Azure-AD-Password-Checker/assets/49560894/0fd77e2c-068e-4aef-aafd-c5ec23db7385

查看介绍:

https://user-images.githubusercontent.com/49560894/233073626-d1ccc173-c3cf-4751-878b-e8f0c65e6c0a.mp4

2023 年 10 月 16 日更新:

double_lastpasswordchangedatetime

如何使用 --code-javascript 参数在 Azure 门户上生成用户列表,然后使用命令 azurepwchecker.py --json-input merged_users.json 导入该列表:

2024 年 2 月 13 日更新:

我上传了来自 @dafthack 的 GraphRunner 编辑版本,感谢他的贡献。在此修改版本中,我添加了一项新功能,允许直接读取“受害者”设备上的 HAR 文件。此新功能有助于检查和审阅访问令牌,以访问不同的权限或作用域。此外,如果访问令牌已过期,此版本允许使用刷新令牌来创建新的访问令牌。此过程具有时效性,但如果你已经登录 Office365 环境,则无需用户名和密码,因为它只需要 HAR 文件中找到的会话令牌。

请理解,代码可能看起来有些杂乱。我的专长主要不在 JavaScript 上,因此我的主要精力放在添加新功能上,而不是整理代码。

  1. 下载 HAR 文件,你可以使用 Web 浏览器中提供的开发者工具。对于大多数浏览器,只需按 F12 打开开发者工具,然后导航到“网络”选项卡,在刷新网页后保存 HAR 文件: video

  2. 通过提供的界面上传你的 HAR 文件。上传后,你可以浏览各种访问令牌来分析会话详细信息,包括它们的作用域等。显示为红色的令牌表示它们已过期。GraphRunner 还支持在必要时使用刷新令牌生成新的有效访问令牌: video

  3. 新增功能:允许以 JSON 文件形式下载完整的用户数据、检测账户中的 MFA 异常,并下载这些异常的列表: video

下载工具