Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

threat-detection

БесплатноЗапускает вложенные скриптыНе проверен

Scan auth and access logs for brute force, injection, path traversal, admin probing and request floods, with triage guidance. Use when analyzing logs for…

borgheiот borghei★ 1 250 звёзд на GitHub

Об этом скилле

Threat Detection

Category: Engineering Domain: Security Operations

Overview

The Threat Detection skill provides automated analysis of log files for suspicious patterns including brute force attempts, injection attempts, path traversal, admin path probing and request flooding. It helps security teams triage log data and identify threats before they escalate.

When to Use

  • Triage after an alert: which IPs sent injection or traversal payloads, and did any succeed?
  • A periodic review of auth or access logs for brute force and probing.
  • Checking a log excerpt someone pasted for obvious attack patterns.

For live monitoring and alert routing use a SIEM; this skill reads one file per run.

Clarify First

Before analyzing logs, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

  • Log file & source type: auth / access / application logs to analyze (--file; the subject of detection).
  • Threat category: injection / auth (brute force) / traversal / probe / rate (--category; focuses the scan).
  • Minimum severity: the reporting/alert threshold (--min-severity; changes which signals surface and any SIEM/CI gate).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Quick Start

# Bundled sample: SQLi (plain and URL-encoded), traversal, command injection, XSS,
# admin probes and a brute-force run -> 10 signals, exit 1
python scripts/threat_signal_analyzer.py --file assets/sample_access_log.txt

# Clean traffic (including URL fragments and "--" in queries) -> no signals, exit 0
python scripts/threat_signal_analyzer.py --file assets/sample_clean_log.txt

# Analyze with specific threat category
python scripts/threat_signal_analyzer.py --file access.log --category injection

# JSON output for SIEM integration
python scripts/threat_signal_analyzer.py --file auth.log --format json

# Set minimum severity
python scripts/threat_signal_analyzer.py --file access.log --min-severity high

Exit codes: 0 no critical signal; 1 at least one critical signal (SQL or command injection); 2 bad input (file missing or unreadable). High-severity signals alone exit 0, so gate on the JSON summary if you need to fail on them.

Request lines are URL-decoded (twice) before matching, so %27%20OR%20%271%27%3D%271 is caught as a quoted tautology; evidence keeps the raw line. Brute force and flooding counts cover the whole file, so for a long log slice it by time window first (for example one hour with awk '$2 >= "09:00" && $2 < "10:00"') or every busy IP looks like a flood.

Tools Overview

threat_signal_analyzer.py

Analyzes log files for suspicious activity patterns across multiple threat categories.

Feature Description
Brute force detection Counts failed login lines per source IP across the whole file
Injection scanning Detects SQL injection, XSS, command injection in requests
Path traversal Detects ../ sequences, their URL-encoded forms and direct requests for /etc/passwd, /etc/shadow, win.ini
Admin probing Flags requests to admin and sensitive paths such as /admin, /.env and /.git that returned 401, 403 or 404
Rate analysis Counts requests per source IP across the whole file and flags high volumes

Workflows

Log Analysis Workflow

  1. Collect - Gather logs from auth, access, application sources
  2. Analyze - Run threat_signal_analyzer.py across log files
  3. Triage - Review critical and high severity findings first
  4. Correlate - Cross-reference findings across log sources
  5. Respond - Block IPs, reset credentials, escalate as needed

Incident Investigation Workflow

  1. Scope - Identify time window and affected systems
  2. Scan - Run analyzer on all relevant log files
  3. Timeline - Build timeline from threat signals
  4. Impact - Assess what was accessed or modified
  5. Contain - Block threat actors and patch vulnerabilities

Continuous Monitoring

# Cron job: analyze auth logs every hour
python scripts/threat_signal_analyzer.py --file /var/log/auth.log --format json --min-severity high > /tmp/threat_report.json

# CI/CD: scan application logs on deployment
python scripts/threat_signal_analyzer.py --file app.log --category injection --format json

Scope & Limitations

In Scope:

  • Rule-based scanning of a single log file with threat_signal_analyzer.py for SQL injection, XSS, command injection, path traversal, failed authentication and brute force, admin path probing, and request flooding.
  • Filtering by --category (injection, auth, traversal, probe, rate) and --min-severity, with text or JSON output.
  • Attack categories, severity levels, common log formats, scanner indicators
Полный SKILL.md на GitHub

Установить threat-detection в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/sample_access_log.txtassets/sample_clean_log.txtreferences/threat-indicators.mdscripts/threat_signal_analyzer.py

FAQ

Что делает скилл threat-detection?

Scan auth and access logs for brute force, injection, path traversal, admin probing and request floods, with triage guidance. Use when analyzing logs for threats or reviewing suspicious activity after an alert.

Как установить скилл threat-detection?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл threat-detection запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить threat-detection с