Command Palette

Search for a command to run...

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

log-analysis

БесплатноБез исполняемых скриптовНе проверен

Correlate auth.log, syslog, journald, application, and web logs to detect brute force, privilege escalation, and lateral movement.

jmaglyот jmagly★ 233 звезды на GitHub

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

log-analysis

Correlates log data from multiple sources to identify attacker activity patterns including brute force login attempts, credential stuffing, privilege escalation, lateral movement, and data exfiltration. Adapts to log availability on the target system and produces a structured timeline of suspicious events.

Triggers

Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):

  • "auth.log" / "syslog" → specific log file analysis
  • "lateral movement" → log-based lateral movement detection
  • "brute force" → authentication attack detection in logs

Purpose

Individual log sources tell fragments of a story. Correlating authentication logs, process accounting, web access logs, and application logs reveals the full attack chain: initial access method, persistence establishment, privilege escalation path, and lateral movement targets. This skill assembles those fragments into a coherent timeline.

Behavior

When triggered, this skill:

  1. Discover available log sources:

    • Check for journald: journalctl --disk-usage 2>/dev/null
    • Check for traditional syslog files: /var/log/syslog, /var/log/messages
    • Check for auth logs: /var/log/auth.log (Debian) or /var/log/secure (RHEL)
    • Check for web server logs: /var/log/nginx/, /var/log/apache2/, /var/log/httpd/
    • Check for application-specific logs: /var/log/ subdirectories
    • Record which sources are available and which are absent (absence is itself evidence)
  2. Authentication log analysis:

    • Extract all SSH authentication events:
      grep -E 'sshd.*(Failed|Accepted|Invalid|Disconnected)' /var/log/auth.log
      
    • Count failed logins per source IP to detect brute force:
      grep 'Failed password' /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -20
      
    • Extract successful logins after prior failures (credential stuffing success indicator)
    • Parse sudo and su events: privilege escalation timing, escalating users, target users
  3. Brute force pattern detection:

    • Identify source IPs with > threshold failed attempts within a rolling time window
    • Flag distributed brute force: multiple IPs, same username targets, compressed time window
    • Check for password spraying: many usernames, few attempts each, from one or few IPs
    • Flag successful login from an IP that previously generated failures (compromise indicator)
  4. Privilege escalation analysis:

    • Sudo usage: grep sudo /var/log/auth.log | grep -v 'pam_unix\|session'
    • PAM events for su, sudo, and other elevation mechanisms
    • setuid binary execution via process accounting if available: lastcomm 2>/dev/null
    • Journal entries for systemd service unit changes by non-root users
  5. Lateral movement indicators:

    • Internal SSH connections (source IP is RFC1918): logins from one internal host to another
    • Service accounts authenticating interactively
    • Accounts logging in from multiple source IPs within a short window
    • Use of credential forwarding (SSH agent forwarding): grep 'agent' /var/log/auth.log
  6. Web access log analysis:

    • Parse combined log format for common web attack patterns:
      grep -E '\.(php|asp|aspx|jsp|cgi).*\?(.*=.*)(union|select|exec|eval|base64)' access.log
      
    • Detect directory traversal: grep '\.\.\/' access.log
    • Detect webshell access patterns: repeated POST requests to static file paths
    • Identify scanning activity: high request rate from single IP, 404 storms, UA strings matching known scanners
    • Flag HTTP 200 responses to paths that should not exist
  7. Syslog and journal correlation:

    • Extract cron job execution events around suspicious times
    • Find process start events correlating with authentication events
    • Kernel OOM kills, segfaults, or coredumps near the incident window
    • Network interface up/down events (potential persistence via network scripts)
  8. Application log review:

    • Database logs: failed authentication, unusual query patterns, bulk SELECT/export activity
    • Mail server logs: outbound relay abuse, unusual recipient domains
    • VPN/remote access logs: off-hours connections, unusual source geographies
    • Custom application logs: error bursts, API authentication failures
  9. SSH key fingerprint and session duration analysis:

    • Extract accepted public key fingerprints: grep "Accepted publickey" /var/log/auth.log | awk '{print $NF}'
    • Correlate session open/close events to compute session durations; flag sessions that never close (potential persistent shell)
    • Distinguish opportunistic scanning (broad invalid-user lists) from targeted attacks (specific, plausible usernames) using invalid user enumeration counts
  10. PAM tampering detection:

    • Compare installed /etc/pam.d/ files against package manager originals using debsums (Debian) or `rp
Полный SKILL.md на GitHub

Установить log-analysis в Claude Code и Claude Desktop

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

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

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

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

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

Bash
Read
Write
Glob
Grep

FAQ

Что делает скилл log-analysis?

Correlate auth.log, syslog, journald, application, and web logs to detect brute force, privilege escalation, and lateral movement.

Как установить скилл log-analysis?

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

Скилл log-analysis запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить log-analysis с