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

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

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

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

工具目录

分类

查看所有分类
Loading categories
onedrive_user_enum — onedrive user enumeration - pentest tool to enumerate valid o365 users | Kitploit
工具/GitHubGitHub/nyxgeek/onedrive_user_enum
OSINT (Open Source Intelligence)ReconnaissanceInformation GatheringPenetration TestingCloud SecurityRed Teaming
GitHubnyxgeek/onedrive_user_enum

onedrive_user_enum

onedrive user enumeration - pentest tool to enumerate valid o365 users

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

onedrive_user_enum v2.10

枚举有效的 OneDrive 用户

有关枚举技术和 OneDrive 枚举的完整说明,请参阅以下博客:

https://www.trustedsec.com/blog/onedrive-to-enum-them-all/

如果你在寻找旧的、非数据库版本的 OneDrive Enum,可以在这里找到:https://github.com/nyxgeek/simple_scanners

2.10 版新特性:

  • 远程 MySQL 数据库日志记录选项 -- 记录到远程数据库
  • PAUSEFILE -- 如果存在 pausefile (/tmp/PAUSEFILE),则暂停枚举
  • 将用户列表截断为 x 个字符 -- johnsmith -> johnsmi

2.00 版新特性:

  • 本地数据库(sqlite3)
  • 自动查找租户(感谢 @DrAzureAD 和 @thetechr0mancer)
  • 读取文件或文件文件夹
  • 追加 -- 轻松创建 'jsmith1' 'jsmith2' 之类的变体
  • 跳过已尝试(去重)-- 移除之前尝试过的用户名
  • 超时终止 -- 如果在 'x' 次尝试内未识别到任何用户名,则取消用户列表

OneDrive 枚举概述:

OneDrive 用户的文件共享 URL 具有已知的位置:

https://acmecomputercompany-my.sharepoint.com/personal/lightmand_acmecomputercompany_com/_layouts/15/onedrive.aspx

在此示例中,用户名为 'lightmand',域为 'acmecomputercompany.com'。如果用户已登录过 OneDrive,该路径将存在并返回 403 状态码。如果用户没有登录过,或者用户无效,则返回 404。

结果可能因 OneDrive 在组织内的使用广泛程度而有所不同。目前这是我所知的最可靠的用户枚举方法(office365userenum 已失效,UhOh365 等其他方法也不可靠)。此外,它不会尝试登录,更为被动,目标组织应无法察觉。Microsoft 会看到这些命中请求,但目标组织不会。

用法:

root@kitploit:~
 # ./onedrive_enum.py -h

*********************************************************************************************************

                                         ██████               ███                          
                                        ░░████               ░░░                           
   ██████    █████████     ███████    ████████   █████████   ████   █████  █████   ███████ 
  ███░░███  ░░███░░░███   ███░░░███  ███░░░███  ░░███░░░███ ░░███  ░░███  ░░███   ███░░░███
 ░███  ░███  ░███  ░███  ░████████  ░███ ░░███   ░███  ░░░   ░███   ░███   ░███  ░████████ 
 ░███  ░███  ░███  ░███  ░███░░░░   ░███ ░░███   ░███        ░███   ░░███  ███   ░███░░░   
 ░░██████    ████  █████ ░░███████  ░░█████████  ██████      █████   ░░██████    ░░███████ 
  ░░░░░░    ░░░░  ░░░░░   ░░░░░░░    ░░░░░░░░░  ░░░░░░      ░░░░░     ░░░░░░      ░░░░░░░  
                                                                             
                                                                             
   ██████  ████████   █████ ████ █████████████      +-------------------------------------------------+
  ███░░███░░███░░███ ░░███ ░███ ░░███░░███░░███     |               OneDrive Enumerator               |
 ░███████  ░███ ░███  ░███ ░███  ░███ ░███ ░███     |           2023 @nyxgeek - TrustedSec            |
 ░███░░░   ░███ ░███  ░███ ░███  ░███ ░███ ░███     |                 version 2.10                    |
 ░░██████  ████ █████ ░░████████ █████░███ █████    |  https://github.com/nyxgeek/onedrive_user_enum  |
  ░░░░░░  ░░░░ ░░░░░   ░░░░░░░░ ░░░░░ ░░░ ░░░░░     +-------------------------------------------------+
                                                                             
*********************************************************************************************************
usage: onedrive_enum.py [-h] -d  [-t] [-e] [-u] [-U] [-p] [-a] [-tr] [-T] [-r] [-x] [-n] [-m] [-o] [-k] [-v] [-D]

options:
  -h, --help           show this help message and exit
  -d , --domain        target domain name (required)
  -t , --tenant        tenant name
  -e , --environment   Azure environment to target [commercial (default), chinese, gov]
  -u , --username      user to target
  -U , --userfile      file containing usernames (wordlists) -- will also take a directory
  -p , --playlist      file containing list of paths to user lists (wordlists) to try
  -a , --append        mutator: append a number, character, or string to a username
  -tr , --truncate     truncate to x characters
  -T , --threads       total number of threads (defaut: 100)
  -r, --rerun          force re-run of previously tested tenant/domain/wordlist combination
  -x, --skip-tried     dedupe. skip any usernames from previous runs
  -n, --no-db          disable logging to db
  -m , --mysql         file containing mysql data (db.conf)
  -o , --output        file to append found users to
  -k , --killafter     kill off non-productive jobs after x tries with no success
  -v, --verbose        enable verbose output
  -D, --debug          enable debug output


示例 - 基本用法:

root@kitploit:~
# ./onedrive_enum.py -t microsoft -d microsoft.com -U USERNAMES/statistically-likely/jsmith.txt

*********************************************************************************************************

                                         ██████               ███                          
                                        ░░████               ░░░                           
   ██████    █████████     ███████    ████████   █████████   ████   █████  █████   ███████ 
  ███░░███  ░░███░░░███   ███░░░███  ███░░░███  ░░███░░░███ ░░███  ░░███  ░░███   ███░░░███
 ░███  ░███  ░███  ░███  ░████████  ░███ ░░███   ░███  ░░░   ░███   ░███   ░███  ░████████ 
 ░███  ░███  ░███  ░███  ░███░░░░   ░███ ░░███   ░███        ░███   ░░███  ███   ░███░░░   
 ░░██████    ████  █████ ░░███████  ░░█████████  ██████      █████   ░░██████    ░░███████ 
  ░░░░░░    ░░░░  ░░░░░   ░░░░░░░    ░░░░░░░░░  ░░░░░░      ░░░░░     ░░░░░░      ░░░░░░░  
                                                                             
                                                                             
   ██████  ████████   █████ ████ █████████████      +-------------------------------------------------+
  ███░░███░░███░░███ ░░███ ░███ ░░███░░███░░███     |               OneDrive Enumerator               |
 ░███████  ░███ ░███  ░███ ░███  ░███ ░███ ░███     |           2023 @nyxgeek - TrustedSec            |
 ░███░░░   ░███ ░███  ░███ ░███  ░███ ░███ ░███     |                 version 2.10                    |
 ░░██████  ████ █████ ░░████████ █████░███ █████    |  https://github.com/nyxgeek/onedrive_user_enum  |
  ░░░░░░  ░░░░ ░░░░░   ░░░░░░░░ ░░░░░ ░░░ ░░░░░     +-------------------------------------------------+
                                                                             
*********************************************************************************************************

Beginning enumeration of https://microsoft-my.sharepoint.com/personal/USER_microsoft_com/
--------------------------------------------------------------------------------------------------------
[-] [403] VALID USERNAME FOR microsoft,microsoft.com - user1, username:[email protected]
[-] [403] VALID USERNAME FOR microsoft,microsoft.com - user2, username:[email protected]
[-] [403] VALID USERNAME FOR microsoft,microsoft.com - user3, username:[email protected]


示例 - MySQL 数据库日志记录:

root@kitploit:~
# ./onedrive_enum.py -t microsoft -d microsoft.com -U USERNAMES/statistically-likely/jsmith.txt -m db.conf

*********************************************************************************************************

                                         ██████               ███                          
                                        ░░████               ░░░                           
   ██████    █████████     ███████    ████████   █████████   ████   █████  █████   ███████ 
  ███░░███  ░░███░░░███   ███░░░███  ███░░░███  ░░███░░░███ ░░███  ░░███  ░░███   ███░░░███
 ░███  ░███  ░███  ░███  ░████████  ░███ ░░███   ░███  ░░░   ░███   ░███   ░███  ░████████ 
 ░███  ░███  ░███  ░███  ░███░░░░   ░███ ░░███   ░███        ░███   ░░███  ███   ░███░░░   
 ░░██████    ████  █████ ░░███████  ░░█████████  ██████      █████   ░░██████    ░░███████ 
  ░░░░░░    ░░░░  ░░░░░   ░░░░░░░    ░░░░░░░░░  ░░░░░░      ░░░░░     ░░░░░░      ░░░░░░░  
                                                                             
                                                                             
   ██████  ████████   █████ ████ █████████████      +-------------------------------------------------+
  ███░░███░░███░░███ ░░███ ░███ ░░███░░███░░███     |               OneDrive Enumerator               |
 ░███████  ░███ ░███  ░███ ░███  ░███ ░███ ░███     |           2023 @nyxgeek - TrustedSec            |
 ░███░░░   ░███ ░███  ░███ ░███  ░███ ░███ ░███     |                 version 2.10                    |
 ░░██████  ████ █████ ░░████████ █████░███ █████    |  https://github.com/nyxgeek/onedrive_user_enum  |
  ░░░░░░  ░░░░ ░░░░░   ░░░░░░░░ ░░░░░ ░░░ ░░░░░     +-------------------------------------------------+
                                                                             
*********************************************************************************************************
Test connection to mysql db was successful!

Beginning enumeration of https://microsoft-my.sharepoint.com/personal/USER_microsoft_com/
--------------------------------------------------------------------------------------------------------
[-] [403] VALID USERNAME FOR microsoft,microsoft.com - user1, username:[email protected]
[-] [403] VALID USERNAME FOR microsoft,microsoft.com - user2, username:[email protected]
[-] [403] VALID USERNAME FOR microsoft,microsoft.com - user3, username:[email protected]


注意:有效但尚未登录过 OneDrive 的用户将返回 404 not found。

参考

  • https://github.com/Gerenios/AADInternals/
  • https://github.com/blacklanternsecurity/TREVORspray
  • https://github.com/nil0x42/duplicut
  • https://patorjk.com/ -- ASCII 艺术生成器

鸣谢与致敬

感谢 @DrAzureAD、@thetechr0mancer、@rootsecdev、@Oddvarmoe、@HackingLZ

下载工具