investigating-m365-entra

investigating-m365-entra is a skill for Claude Code, Codex from EvilFreelancer/secs. It costs 110 tokens per session (1,560 once invoked), scanned A, original, Apache-2.0.

A guide to investigating Microsoft 365 and Entra ID account takeovers using cloud records such as sign-in logs, audit logs, app-consent records, and mailbox rules. Entra ID is Microsoft's cloud identity service.

In plain words
What is it for?
Investigating business email compromise, stolen login sessions, malicious app permissions, mailbox forwarding, inbox rules, and changes to delegates or access rights.
Why use it?
It helps reconstruct an attack when there is no computer disk or memory to examine. It also highlights evidence that may disappear as logs expire or hidden mail forwarding continues.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

Good fit Investigating business email compromise, stolen login sessions, malicious app permissions, mailbox forwarding, inbox rules, and changes to delegates or access rights.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/evilfreelancer/secs/investigating-m365-entra
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add EvilFreelancer/secs --skill investigating-m365-entra
Clone the repo
git clone --depth 1 https://github.com/EvilFreelancer/secs

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for investigating-m365-entra

README.md
[![agentmods](https://agentmods.dev/badge/skills/evilfreelancer/secs/investigating-m365-entra/github.svg)](https://agentmods.dev/skills/evilfreelancer/secs/investigating-m365-entra)
Your own site
<a href="https://agentmods.dev/skills/evilfreelancer/secs/investigating-m365-entra"><img src="https://agentmods.dev/badge/skills/evilfreelancer/secs/investigating-m365-entra/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.

agentmods 80×15 button for investigating-m365-entra

Your own site · 80×15
<a href="https://agentmods.dev/skills/evilfreelancer/secs/investigating-m365-entra"><img src="https://agentmods.dev/badge/skills/evilfreelancer/secs/investigating-m365-entra.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00110 $0.01560
Opus 5 $0.00055 $0.00780
Sonnet 5 $0.00022 $0.00312
Haiku 4.5 $0.00011 $0.00156

Measured 12d ago against content hash 509396db565e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

investigating-m365-entra 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 12d 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.

.agents/skills/investigating-m365-entra/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Investigating M365 / Entra Incidents

A Microsoft 365 compromise usually leaves no host to image — the crime scene is entirely in the cloud logs. An attacker who phishes a session token or tricks a user into consenting a malicious OAuth app does not need malware: they read mail, set a hidden forwarding rule, and pivot to invoice fraud, and every step is a record in the Unified Audit Log (UAL), the Entra sign-in logs, or the mailbox configuration. The investigator reconstructs the takeover from those records. The urgency is twofold: UAL retention is finite, and any forwarding or inbox rule the attacker set is still exfiltrating mail while you investigate.

Confirm the tenant is in scope per AGENTS.md. Enable/confirm UAL access early and export the relevant window before retention lapses. This is read-only investigation; disabling the account, revoking sessions, or removing a malicious app is the operator's containment call.

When to Use

  • A suspected M365/Entra account takeover or business email compromise (BEC)
  • No disk or memory to image — only cloud logs (UAL, sign-ins, OAuth grants)
  • Hunting hidden inbox/forwarding rules and delegate/permission changes
  • Investigating malicious OAuth app consent as a persistence and exfil path
  • Reconstructing token/session theft that bypassed MFA

When NOT to Use

  • Azure resource control plane (subscriptions, RBAC, Key Vault, VMs) — use investigating-azure-incidents; this skill is the M365 workload and identity layer
  • AWS or GCP — use investigating-aws-incidents or investigating-gcp-incidents
  • On-host artifacts — use investigating-windows-endpoints
  • Triaging the phishing email that started it — use analyzing-phishing-emails
  • Proactive search with no incident yet — use hunting-threats
  • Running the whole incident — use responding-to-incidents
  • Packaging IOCs into a product — use producing-threat-intelligence

Reconstruct from the Cloud Logs

Unified Audit Log is the backbone. Search it for the suspect user and window:

Read the full file on GitHub · 108 lines

Changes

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.

  1. 12d ago First seen · 108 lines · 110 tokens per session scan A 509396db565e

Subscribe to this mod's changes

investigating-m365-entra is a skill published in the GitHub repository EvilFreelancer/secs (10 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 110 tokens to every session and 1,560 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

Blue Team Defense & Hardening

System hardening, detection engineering, security baseline monitoring, patch management, defense-in-depth architecture, and security posture improvement.

Masriyan/Claude-Code-CyberSecurity-Skill · 30 tokens

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

26zl/cybersec-toolkit · 79 tokens

analyzing-slack-space-and-file-system-artifacts

Examine file system slack space, MFT entries, USN journal, and alternate data streams to recover hidden data and reconstruct file activity on NTFS volumes.

26zl/cybersec-toolkit · 44 tokens

conducting-mobile-app-penetration-test

Conducts penetration testing of iOS and Android mobile applications following the OWASP Mobile Application Security Testing Guide (MASTG) to identify vulnerabilities in data storage, network communication, authentication, cryptography, and platform-specific security controls. The tester performs static analysis of…

26zl/cybersec-toolkit · 108 tokens

configuring-identity-aware-proxy-with-google-iap

Configuring Google Cloud Identity-Aware Proxy (IAP) to enforce per-request identity verification for Compute Engine, App Engine, Cloud Run, and GKE services using access levels, context-aware policies, and programmatic access with service accounts.

26zl/cybersec-toolkit · 60 tokens

configuring-network-segmentation-with-vlans

Designs and implements VLAN-based network segmentation on managed switches to isolate network zones, enforce access control between segments, and reduce the attack surface by limiting lateral movement paths in enterprise network environments.

26zl/cybersec-toolkit · 48 tokens