Skip to content
Skillpedia
Analysis & spreadsheets35k · #7640

analyzing-office365-audit-logs-for-compromise

What it does

This tool analyzes your Microsoft 365 account activity logs to find signs that it might have been hacked. It looks for suspicious changes, like email forwarding rules or unauthorized access.

When to use it

  • ✓When you suspect your Microsoft 365 account has been compromised.
  • ✓To check for unusual activity in your emails.
  • ✓When investigating a company security incident.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-office365-audit-logs-for-compromise/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-office365-audit-logs-for-compromise/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Check my Microsoft 365 email logs for suspicious hacking activity.”

5 new skills a week. 1 minute to read.

How it works

The tool connects to your Microsoft 365 account using a secure code. Then, it searches the activity logs for unusual actions, such as creating forwarding rules or granting permissions to unknown apps.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Analyzing Office 365 Audit Logs for Compromise

Overview

Business Email Compromise (BEC) attacks often leave traces in Office 365 audit logs: suspicious inbox rule creation, email forwarding to external addresses, mailbox delegation changes, and unauthorized OAuth application consent grants. This skill uses the Microsoft Graph API to query the Unified Audit Log, enumerate inbox rules across mailboxes, detect forwarding configurations, and identify compromised account indicators.

When to Use

  • When investigating security incidents that require analyzing office365 audit logs for compromise
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Azure AD app registration with AuditLog.Read.All, MailboxSettings.Read, Mail.Read (application permissions)
  • Python 3.9+ with msal, requests
  • Client secret or certificate for authentication
  • Global Reader or Security Reader role

Steps

  1. Authenticate to Microsoft Graph using MSAL client credentials flow
  2. Query Unified Audit Log for suspicious operations (Set-Mailbox, New-InboxRule)
  3. Enumerate inbox rules across mailboxes and flag forwarding rules
  4. Detect mailbox delegation changes (Add-MailboxPermission)
  5. Identify OAuth consent grants to suspicious applications
  6. Check for suspicious sign-in patterns from audit logs
  7. Generate compromise indicator report with timeline

Expected Output

  • JSON report listing forwarding rules, delegation changes, OAuth grants, and suspicious audit events with risk scores
  • Timeline of compromise indicators with affected mailboxes
FAQ

What are 'audit logs'?

They are like a diary of everything that happens in your Microsoft 365 account, recording who did what and when.

What is 'Business Email Compromise' (BEC)?

It's a type of scam where criminals pretend to be someone you know to trick people into giving information or money.

Do I need to be a tech expert to use this?

No, the tool is designed for anyone to use. It simplifies the analysis of security logs.

Details

Original description by the author

Parse Office 365 Unified Audit Logs via Microsoft Graph API to detect email forwarding rule creation, inbox delegation, suspicious OAuth app grants, and other indicators of account compromise.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#7640
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills