Hunting credential stuffing attacks

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Hunting credential stuffing attacks is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. Detects credential stuffing attacks by analyzing authentication logs for login velocity anomalies, ASN diversity, password spray patterns, and geographic distribution of failed logins. Uses statistical analysis on Splunk or raw log data. Use when investigating account takeover campaigns or building

How to use this skill

Skill file

Hunting Credential Stuffing Attacks

When to Use

Prerequisites

Instructions

Analyze authentication logs to detect credential stuffing by identifying patterns

of distributed login failures, high IP diversity, and suspicious ASN distribution.

import pandas as pd
from collections import Counter

# Load auth logs
df = pd.read_csv("auth_logs.csv", parse_dates=["timestamp"])

# Credential stuffing indicator: many IPs trying few accounts
ip_per_account = df[df["status"] == "failed"].groupby("username")["source_ip"].nunique()
accounts_under_attack = ip_per_account[ip_per_account > 50]

Key detection indicators:

  1. High unique source IPs per failed username
  2. Low success rate across many accounts (< 1%)
  3. ASN concentration from cloud/proxy providers
  4. Geographic impossibility (same account, distant locations)
  5. User-agent uniformity across distributed IPs

Examples

# Password spray: one password tried across many accounts
spray = df[df["status"] == "failed"].groupby(["source_ip", "password_hash"]).agg(
    accounts=("username", "nunique")).reset_index()
sprays = spray[spray["accounts"] > 10]
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.