New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Adversary-in-the-Middle Phishing Detection

Free

Detect and respond to AiTM phishing attacks effectively.

Get this skill

Free · Opens the source repo

What Adversary-in-the-Middle Phishing Detection does

The Adversary-in-the-Middle (AiTM) Phishing Detection skill is designed to help security professionals identify and respond to sophisticated phishing attacks that utilize reverse proxy techniques. These attacks, which can bypass multi-factor authentication (MFA), involve an attacker intercepting the communication between a user and a legitimate authentication service. By leveraging this skill, users can correlate Azure AD/Entra sign-in logs, SIEM alerts, and EDR telemetry to effectively investigate and mitigate potential threats.

This skill is particularly useful for security assessments, incident response, and security testing. It provides a structured workflow for deploying phishing-resistant MFA, configuring Conditional Access policies, and building detection rules tailored to identify AiTM attacks. The skill is grounded in the latest threat intelligence, detailing the mechanics of AiTM attacks and the most prevalent phishing-as-a-service (PhaaS) kits, such as EvilProxy and Evilginx, that attackers are using in 2025.

Users will find practical guidance on how to implement effective security controls and monitoring strategies to safeguard against these types of phishing schemes. The skill includes detailed steps for configuring detection rules, monitoring web proxies, and implementing post-compromise detection measures, ensuring a comprehensive approach to defending against AiTM threats. This makes it an essential tool for security teams focused on enhancing their incident response capabilities and improving overall security posture.

Overall, the Adversary-in-the-Middle Phishing Detection skill equips users with the knowledge and tools necessary to combat one of the most advanced phishing techniques currently in use, making it a valuable addition to any cybersecurity toolkit.

When to use it

Use this skill when investigating suspected MFA-bypass phishing incidents or when conducting security assessments focused on AiTM threats.

When not to use it

This skill may not be suitable for environments without Azure AD or those not using SIEM and EDR solutions, as it relies on specific prerequisites for effective operation.

What you can build with it

Investigating a Phishing Incident

Use this skill to analyze logs and telemetry when a phishing attack is suspected, allowing for a thorough investigation.

Conducting Security Assessments

Employ the skill during security assessments to identify vulnerabilities related to AiTM attacks and to validate existing security measures.

Building Detection Playbooks

Utilize the skill to create comprehensive detection and response playbooks specifically targeting AiTM phishing threats.

How to install Adversary-in-the-Middle Phishing Detection

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/performing-adversary-in-the-middle-phishing-detection --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Performing Adversary-in-the-Middle Phishing Detection

Overview

Adversary-in-the-Middle (AiTM) phishing attacks use reverse-proxy infrastructure to sit between the victim and the legitimate authentication service, intercepting both credentials and session cookies in real time. This allows attackers to bypass multi-factor authentication (MFA). The most prevalent PhaaS kits in 2025 include Tycoon 2FA, Sneaky 2FA, EvilProxy, and Evilginx. Over 1 million PhaaS attacks were detected in January-February 2025 alone. These attacks have evolved from QR codes to HTML attachments and SVG files for link distribution.

When to Use

  • When conducting security assessments that involve performing adversary in the middle phishing detection
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Azure AD / Entra ID Conditional Access policies
  • SIEM with authentication log ingestion (Azure AD sign-in logs)
  • Web proxy with SSL inspection and URL categorization
  • Endpoint Detection and Response (EDR) solution
  • FIDO2/phishing-resistant MFA capability

Key Concepts

How AiTM Works

  1. Victim receives phishing email with link to attacker-controlled domain
  2. Attacker domain runs reverse proxy that mirrors legitimate login page
  3. Victim enters credentials on proxied page; credentials captured in transit
  4. Reverse proxy forwards credentials to real authentication service
  5. MFA challenge sent to victim; victim completes MFA on proxied page
  6. Attacker captures session cookie returned by legitimate service
  7. Attacker replays session cookie to access victim's account without MFA

Major AiTM Kits (2025)

KitTypePrimary TargetsEvasion
Tycoon 2FAPhaaSMicrosoft 365, GoogleCAPTCHA, Cloudflare turnstile
EvilProxyPhaaSMicrosoft 365, Google, OktaRandom URLs, IP rotation
EvilginxOpen-sourceAny web applicationCustom phishlets
Sneaky 2FAPhaaSMicrosoft 365Anti-bot checks
NakedPagesPhaaSMultipleMinimal infrastructure

Detection Indicators

  • Authentication from unusual IP not matching user profile
  • Session cookie reuse from different IP/device than authentication
  • Login page served from non-Microsoft/non-Google infrastructure
  • CDN requests to legitimate auth providers from phishing domains
  • Impossible travel between authentication and session usage

Workflow

Step 1: Deploy Phishing-Resistant MFA

  • Implement FIDO2 security keys or Windows Hello for Business for high-value accounts
  • Configure Conditional Access to require phishing-resistant MFA for admins
  • Enable certificate-based authentication where possible
  • Disable SMS and voice MFA for privileged accounts
  • AiTM cannot intercept FIDO2 because authentication is bound to origin domain

Step 2: Configure Conditional Access Policies

  • Require compliant/managed device for sensitive application access
  • Block authentication from anonymous proxies and Tor exit nodes
  • Enforce token binding to limit session cookie replay
  • Configure continuous access evaluation (CAE) for real-time token revocation
  • Implement sign-in risk policies that require re-authentication for risky sign-ins

Step 3: Build AiTM Detection Rules

  • Alert on sign-in followed by session from different IP within 10 minutes
  • Detect authentication where proxy IP does not match user's expected location
  • Monitor for impossible travel patterns in session usage
  • Alert on inbox rules created immediately after authentication (common post-compromise)
  • Detect new MFA method registration from suspicious sign-in

Step 4: Monitor Web Proxy for AiTM Infrastructure

  • Log and analyze DNS queries to newly registered domains
  • Detect connections to known PhaaS infrastructure IPs
  • Alert on authentication page backgrounds loaded from legitimate CDNs through proxy domains
  • Monitor for SSL certificates issued to domains mimicking corporate login pages
  • Block access to known EvilProxy/Evilginx infrastructure via threat intelligence

Step 5: Implement Post-Compromise Detection

  • Alert on mailbox forwarding rules created after suspicious authentication
  • Detect OAuth app consent after AiTM sign-in
  • Monitor for email sending patterns indicating BEC follow-up
  • Alert on SharePoint/OneDrive mass download after session hijack
  • Track lateral movement from compromised account

Tools & Resources

  • Microsoft Entra ID Protection: Risk-based Conditional Access
  • Azure AD Sign-in Logs: Authentication event analysis
  • Okta ThreatInsight: AiTM proxy detection at IdP level
  • Sekoia TDR: AiTM campaign tracking and intelligence
  • Evilginx (defensive): Understanding attack mechanics for detection

Validation

  • Phishing-resistant MFA blocks AiTM session capture in test scenario
  • Conditional Access denies session replay from different device/IP
  • SIEM alerts fire on simulated AiTM sign-in patterns
  • Web proxy blocks connections to known PhaaS infrastructure
  • Post-compromise rules detect inbox rule creation after suspicious auth

Frequently asked questions about Adversary-in-the-Middle Phishing Detection

Similar skills