Log analysis

From jmagly/aiwg · View interactive version

Log analysis is an AI agent skill from the GitHub repository jmagly/aiwg. Correlate auth.log, syslog, journald, application, and web logs to detect brute force, privilege escalation, and lateral movement.

How to use this skill

Skill file

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):

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:
  1. Authentication log analysis:

```bash

grep -E 'sshd.*(Failed|Accepted|Invalid|Disconnected)' /var/log/auth.log

```

```bash

grep 'Failed password' /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head -20

```

  1. Brute force pattern detection:
  1. Privilege escalation analysis:
  1. Lateral movement indicators:
  1. Web access log analysis:

```bash

grep -E '\.(php|asp|aspx|jsp|cgi).\?(.=.*)(union|select|exec|eval|base64)' access.log

```

  1. Syslog and journal correlation:
  1. Application log review:
  1. SSH key fingerprint and session duration analysis:
  1. PAM tampering detection:
  1. Btmp and lastb failed login analysis:
  1. Windows Event Log correlation:
  1. Cloud log parsing:
  1. Timeline construction:
  1. Write findings document:

Usage Examples

Example 1 — Full log analysis on local system

analyze logs

Example 2 — Auth log focus

auth log analysis /var/log/auth.log

Example 3 — Specify time window

log forensics --from "2026-02-01 00:00:00" --to "2026-02-15 23:59:59"

Output Locations

Configuration

log_analysis:
  brute_force_threshold: 10
  brute_force_window_minutes: 5
  spray_threshold_users: 5
  web_log_paths:
    - /var/log/nginx/access.log
    - /var/log/apache2/access.log
    - /var/log/httpd/access_log
  timeline_timezone: UTC
  severity_levels:
    - INFO
    - SUSPICIOUS
    - MALICIOUS

References

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.