incident-response-bec
Business Email Compromise and AiTM Analysis
Mission
Determine whether a Microsoft identity and mailbox event is consistent with BEC, AiTM session theft, or another compromise pattern. Keep the assessment advisory; final decision belongs to the human analyst.
Use when
- Suspicious sign-ins are paired with mailbox forwarding, inbox rules, or unexpected sent mail.
- A user reports phishing, strange mailbox behavior, or external recipients the user did not send to.
- The incident includes suspected session theft, token replay, or unauthorized app consent.
- The same workflow applies to non-Microsoft cases when equivalent sign-in and mailbox evidence exists.
Required context
- Preferred inputs: UPN, incident window, alert or incident ID, and any phishing message identifiers.
- If UPN is missing and Microsoft telemetry is required, ask for it before querying.
Investigation flow
- Confirm the compromise hypothesis
- identify the first suspicious sign-in or mailbox event
- note source IP, geo, ASN, device, client app, and MFA context
- Extract all IPs from the prompt, phishing artifacts, logs, and mailbox evidence and enrich every unique public IP
- classify each IP as public or non-public before enrichment
- run
/root/Tools/IncidentResponseScripts/vpnchecker.sh <ip>and/root/Tools/IncidentResponseScripts/ipir.sh <ip>for every public IP - keep the raw outputs and use them in the verdict
- Review authentication
- look for impossible travel, session reuse, token replay, claim-based MFA satisfaction, repeated MFA prompts, or suspicious non-interactive activity
- Review mailbox and collaboration activity
- check inbox rules, forwarding, transport rules, sent items, deleted items, search behavior, delegated access, and OAuth consent
- look for MailItemsAccessed or equivalent mailbox access evidence when available
- Review downstream actions
- identify secondary phishing, data exfiltration, file sharing changes, role or group changes, and privileged app consent
- Contain and preserve
- preserve the suspicious events, then revoke sessions, reset credentials, remove malicious rules, disable forwarding, and remove unauthorized consent
- isolate the host if endpoint evidence shows active malware or credential theft
Public IP rule
- If a public IP is present anywhere in the prompt or evidence, enrichment is required before closing the assessment.
vpnchecker.shis the fast VPN and provider signal.ipir.shis the deeper multi-source reputation and infrastructure scoring pass.- A VPN, proxy, or datacenter result alone is not enough to call the IP malicious.
- Use the enrichment results together with sign-in behavior, mailbox activity, and timeline context.
- If the tools cannot be executed, state the limitation explicitly in the analyst note.
Microsoft Graph guidance
- Use
az restor the best available Microsoft telemetry path. - Scope every query to the user and time window under investigation.
- Do not rely on the last sign-in date alone.
- Treat MFA as one control signal, not proof of safety.
- Do not alert the user before initial scoping if doing so could tip off an attacker.
Evidence to preserve
- IPs, user agents, device IDs, session IDs, timestamps, and app IDs
- mailbox rule definitions, forwarding targets, and transport rule changes
- OAuth consents, delegated permissions, role changes, and group changes
- phishing message details or sender infrastructure when available
Assessment output
- State whether the incident is confirmed, suspected, likely benign, or inconclusive.
- Separate facts from indicators and hypotheses.
- Explain whether the likely path is AiTM or session theft, mailbox compromise, or another access path.
- Include public IP enrichment results for every material public IP.
- List immediate containment actions and remaining gaps.
More from crtvrffnrt/skills
pentest-xss
Security assessment skill for Cross-Site Scripting (XSS) vulnerabilities. Use when investigating input sanitization, reflected, stored, DOM, or blind XSS. Focuses on discovery, exploitation, and payload optimization. Do not use for generic network recon or non-web injection types.
37pentest-exploit-execution-payload-control
Security assessment skill for deterministic exploit execution from validated primitives. Use when prompts include exploit implementation, payload hardening, chaining confirmed weaknesses, post-exploitation proof, or controlled impact demonstration. Do not use for early-stage reconnaissance, speculative hypothesis generation, or report-only requests.
31pentest-recon-surface-analysis
Security assessment skill for reconnaissance, endpoint/service enumeration, and attack-surface mapping. Use when prompts include recon, enumerate, map endpoints, discover assets, inventory interfaces, fingerprint technologies, or identify control-plane surfaces. Do not use when the request is exploit development, payload execution, or final report writing only.
30pentest-business-logic-abuse
Security assessment skill for business workflow abuse, state-machine manipulation, and control-plane logic flaws. Use when prompts include workflow bypass, race condition, replay, quota abuse, order-of-operations flaws, delegated execution abuse, or unauthorized state transitions. Do not use for pure input injection fuzzing, broad recon, or standalone report formatting tasks.
27pentest-gemini-az
Use when users need an Azure, Microsoft 365, or Entra ID companion that reads, lists, changes, and manages resources using the current Azure CLI session, with `az rest` as the default execution path.
26pentest-outbound-interaction-oob-detection
Security assessment skill for outbound interaction and out-of-band (OOB) validation. Use when prompts include SSRF callback confirmation, blind XSS beacons, webhook abuse, XXE/OOB behavior, DNS/HTTP callback correlation, or asynchronous server-side interaction proof. Do not use when vulnerabilities are fully in-band and require no external callback correlation.
25