post-exploiting-microsoft-graph-with-graphrunner
Skill này làm gì
Công cụ này giúp khám phá và kiểm soát hệ thống Microsoft 365 (như email và file) sau khi đã có quyền truy cập ban đầu. Nó có thể dùng để tìm thông tin, duy trì quyền truy cập và thậm chí nâng quyền trong hệ thống.
Khi nào nên dùng
- ✓Khi bạn đã có quyền truy cập được phép vào một hệ thống Microsoft 365.
- ✓Khi bạn cần kiểm tra quyền và chính sách bảo mật.
- ✓Khi bạn muốn chứng minh cách kẻ tấn công có thể duy trì quyền truy cập hoặc leo thang đặc quyền.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/post-exploiting-microsoft-graph-with-graphrunner/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi muốn khám phá hệ thống Microsoft 365 để tìm thông tin nhạy cảm và duy trì quyền truy cập.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ dùng Microsoft Graph API để tương tác với hệ thống. Nó ngụy trang thành lưu lượng bình thường, cho phép thực hiện các hành động như đánh cắp dữ liệu, tạo quyền truy cập giả hoặc thêm thành viên vào nhóm.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Post-Exploiting Microsoft Graph with GraphRunner
Authorized use only: GraphRunner performs offensive actions against live Microsoft 365 / Entra ID tenants — deploying OAuth apps, cloning groups, adding members, and reading mailboxes, SharePoint, and Teams. Run it only against tenants you own or are explicitly authorized in writing to test. Unauthorized use is illegal.
Overview
GraphRunner (Beau Bullock / Black Hills Information Security) is a PowerShell post-exploitation toolset built entirely on the Microsoft Graph API. Given a foothold token, it performs recon, establishes persistence, escalates privilege, and pillages M365 data — all through Graph, which blends in with normal traffic and bypasses many endpoint controls. It is the natural follow-on to credential/token theft (e.g., device-code phishing or ROADtools): once you hold Graph access, GraphRunner operationalizes it.
The toolset is a single PowerShell module (GraphRunner.ps1) exposing dozens of functions grouped by purpose:
- Authentication —
Get-GraphTokens(device-code login),Invoke-RefreshGraphTokens,Invoke-AutoTokenRefresh,Invoke-ImportTokens,Invoke-RefreshToSharePointToken. - Recon & Enumeration —
Invoke-GraphRecon(tenant/user permission summary),Invoke-DumpCAPS(conditional-access policies),Invoke-DumpApps(app registrations / consent grants),Get-AzureADUsers,Get-SecurityGroups,Get-UpdatableGroups,Get-DynamicGroups,Invoke-SearchUserAttributes,Invoke-GraphOpenInboxFinder,Find-PermissiveCalendars. - Persistence —
Invoke-InjectOAuthApp(deploy a malicious OAuth app for consent-grant persistence),Invoke-CreateInboxForwardingRule. - Privilege Escalation —
Get-UpdatableGroups,Invoke-AddGroupMember,Invoke-SecurityGroupCloner,Invoke-InviteGuest. - Pillage / Data Search —
Invoke-SearchMailbox,Invoke-SearchSharePointAndOneDrive,Invoke-SearchTeams,Get-TeamsChat,Invoke-DriveFileDownload. - Master runner —
Invoke-GraphRunnerruns an automated recon-and-pillage pass;List-GraphRunnerModulesprints all modules.
This maps to MITRE ATT&CK T1098 — Account Manipulation: GraphRunner manipulates accounts, groups, and OAuth grants (adding members, injecting apps, cloning groups, inviting guests) to maintain and escalate access in the cloud identity plane.
When to Use
- After obtaining a valid Microsoft Graph access/refresh token during an authorized M365/Entra engagement.
- When mapping tenant permissions, conditional-access policies, and OAuth app exposure.
- When establishing cloud persistence via OAuth consent grants or inbox forwarding (in scope).
- When demonstrating privilege escalation through updatable/dynamic groups.
- When searching mailboxes, SharePoint/OneDrive, and Teams for sensitive data to evidence impact.
Prerequisites
- Written authorization and scope for the target tenant.
- A Graph token foothold (from
Get-GraphTokensdevice-code login, or imported tokens). - PowerShell 5.1+ or PowerShell 7 (cross-platform).
# Clone and import the module
git clone https://github.com/dafthack/GraphRunner.git
cd GraphRunner
Import-Module .\GraphRunner.ps1
# List every available module
List-GraphRunnerModules
Objectives
- Authenticate to Microsoft Graph and maintain tokens via refresh.
- Enumerate tenant users, groups, CA policies, and OAuth apps.
- Identify updatable groups and demonstrate privilege escalation.
- Establish persistence via an injected OAuth app and/or inbox forwarding rule.
- Search mailboxes, SharePoint/OneDrive, and Teams for sensitive content.
MITRE ATT&CK Mapping
| ID | Tactic | Official Technique Name | Role in this skill |
|---|---|---|---|
| T1098 | Persistence | Account Manipulation | Add group members, clone groups, invite guests to retain/escalate access |
| T1098.003 | Privilege Escalation | Account Manipulation: Additional Cloud Roles | Adding members to privileged/updatable groups |
| T1528 | Credential Access | Steal Application Access Token | Get-GraphTokens device-code token acquisition |
| T1087.004 | Discovery | Account Discovery: Cloud Account | Get-AzureADUsers, Invoke-SearchUserAttributes |
| T1114.002 | Collection | Email Collection: Remote Email Collection | Invoke-SearchMailbox over Graph |
| T1606.002 | Credential Access | Forge Web Credentials: SAML/OAuth | Invoke-InjectOAuthApp consent-grant persistence |
…
Câu hỏi thường gặp
Tôi có cần sự cho phép để dùng công cụ này không?
Có, bạn cần giấy ủy quyền rõ ràng bằng văn bản để dùng công cụ này trên bất kỳ hệ thống nào. Sử dụng trái phép là vi phạm pháp luật.
“Graph token” là gì?
Đây là khóa truy cập đặc biệt cho phép công cụ tương tác với các dịch vụ Microsoft như email và file mà không cần mật khẩu thông thường.
Công cụ ảnh hưởng đến những hệ thống nào?
Công cụ hoạt động trong hệ sinh thái Microsoft 365 và Entra ID (trước đây là Azure AD), ảnh hưởng đến các dịch vụ như Outlook, SharePoint và Teams.
Chi tiết
Mô tả gốc của tác giả
Runs GraphRunner, a PowerShell post-exploitation toolset built on the Microsoft Graph API, to perform tenant recon, establish persistence (OAuth app injection, inbox rules), escalate privilege via group manipulation, and pillage mailboxes, SharePoint, and Teams data from a foothold Graph token. Use during authorized red-team engagements against Microsoft 365/Entra ID tenants once you hold a Graph
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #8341
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.