# server log threat hunter

> Hunt nginx/Apache and SSH auth logs offline for attacks and break-ins: scored IPs, ATT&CK mapping, timeline, IOCs and a reviewable blocklist.

server log threat hunter is a paid AI agent skill on Agensi by Big t, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $20 (one-time purchase)
- Creator: [Big t](https://www.agensi.io/creators/t-b)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-10-11
- Security: scan passed (2026-10-11); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/server-log-threat-hunter
- Tags: security, devops, research, incident-response, threat-hunting, log-analysis, nginx, apache

## About this skill

**Find out if your server was attacked, or broken into, from the logs you already have.**

server log threat hunter gives your AI agent an incident-response toolkit for Linux web servers. Point it at your web access logs and your SSH/auth logs (rotated `.gz` files are fine). It parses every line, matches tested attack signatures, scores each source IP from 0 to 100, and tells you in plain language what happened and when. The most important question gets a direct answer: did anyone actually get in? A successful SSH login after a run of failures, followed by sudo downloads and a new admin account, is flagged CRITICAL. A noisy scanner that never got in tops out at HIGH. Everything runs locally and nothing is changed on the server.

### What it does
- **Reads real-world logs:** nginx and Apache combined/common format (with or without vhost prefix), JSON access logs, `/var/log/auth.log` and `/var/log/secure` (classic syslog and ISO-8601 rsyslog), and `journalctl -o short-iso` output. Gzip, mixed files, year-less syslog dates and timezones are handled.
- **Web attack signatures:** Log4Shell (CVE-2021-44228), Shellshock (CVE-2014-6271), PHPUnit RCE (CVE-2017-9841), Apache 2.4.49 traversal (CVE-2021-41773), SQL injection, XSS, template injection, command injection, path traversal, webshell access, `.env`/`.git`/backup-file probes, admin-panel probing, scanner user agents, 404 bursts, login floods and request-rate spikes. Exploit hits that returned HTTP 200 score higher.
- **SSH and host signals:** password guessing, password spraying across many usernames, invalid users, distributed guessing of one username from many IPs, accepted logins after failures, logins from IPs that also attacked the website, suspicious sudo commands (downloads, chmod +x in /tmp, reverse shells, user creation), new local accounts and additions to sudo/wheel/admin groups.
- **MITRE ATT&CK mapping** on every finding (T1190, T1110.001, T1110.003, T1078, T1548.003, T1136.001, T1098 and more).
- **Severity you can trust:** per-area caps, and CRITICAL only with evidence of access or post-login activity.
- **Outputs:** terminal summary, `hunt.md` report, `iocs.csv`, `timeline.csv`, `hunt.json`, and `blocklist.txt` with ufw, nftables and nginx `deny` lines. Your own `--allow` IPs and CIDRs never land in the blocklist. URLs and IPs inside commands are defanged.
- **Daily diffs:** `hunt_diff.py` compares two runs and lists new findings, new IPs, escalations and attackers that went quiet.
- **Response playbook:** a step-by-step guide for when the result is CRITICAL (preserve evidence, keep access, contain, hunt persistence, rotate credentials, rebuild or clean).

### Problems it solves
- "My server is slow / my host sent an abuse notice. Was I hacked?"
- Thousands of SSH failures a day and no idea whether one of them succeeded
- Grepping access logs by hand for `jndi`, `../` and `union select`
- Writing firewall rules from a log without blocking yourself
- Explaining an incident to a client or boss with a timeline instead of a guess

### Who it's for
Developers and indie hackers running a VPS, sysadmins and DevOps engineers, MSPs and IT generalists, small-business web hosts, and SOC analysts who want a fast offline first pass on Linux logs.

### What's included
- `SKILL.md`: hard safety rules for the agent, where each log lives on Debian/Ubuntu and RHEL-family systems, run commands, how to read severities, and a decision tree for what to tell the user
- `scripts/hunt.py` (main CLI), `logparse.py` (parsers), `detections.py` (signatures and ATT&CK map), `hunt_diff.py` (run-to-run diff), `make_samples.py` (a synthetic incident using RFC 5737 documentation IPs)
- `references/`: detection rules table generated from the code, supported log formats with examples, an incident response playbook, and every source used (nginx, Apache, OpenSSH, shadow-utils, sudo, RFC 3164/5424/3339, NVD, MITRE ATT&CK)
- `examples/`: expected terminal output and blocklist for the bundled sample

Standard-library Python only. No API keys, no network calls, no installs.

## Known limitations

- Detection is signature- and threshold-based. A careful attacker using valid credentials from a new IP, with no failures and no suspicious sudo, can look normal. Treat a clean result as "nothing obvious", not proof.
- Only sees what the logs recorded: no process, file-system or network-flow data. Post-compromise checks rely on auth/sudo/useradd log lines.
- Web logs don't contain POST bodies, so payloads sent in POST bodies aren't visible.
- Classic syslog lines have no year or timezone. Pass `--year` and `--tz` for accurate timestamps.
- Private and loopback addresses are left out of the blocklist unless you pass `--include-private`.
- Windows, IIS, cloud load-balancer and CDN log formats aren't supported. Behind a proxy or CDN, the client IP must be in the log (for example `$http_x_forwarded_for` or real_ip configured).
- Files over 512 MB each are refused. Split or filter them first.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the server log threat hunter skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Will it change anything on my server?

No. You copy the logs to a working folder and the scripts only read them. The blocklist is written to a text file with ufw, nftables and nginx lines. You decide whether to apply it.

### How is "CRITICAL" different from "HIGH"?

Each IP gets points in capped areas (exploits, brute force, recon, rate and so on). Without proof of access, such as a successful login after failures or post-login sudo activity, the score is capped at 79 (HIGH), however loud the scanning was. CRITICAL (80+) means someone probably got in, and the SKILL.md then walks through the response playbook.

### Which logs do I need?

Ideally both: the web access log (`/var/log/nginx/access.log` or the Apache equivalent) and the auth log (`/var/log/auth.log` on Debian/Ubuntu, `/var/log/secure` on RHEL-family systems). Rotated `.1` and `.gz` files can be passed directly. On systemd-only hosts, export with `journalctl -o short-iso`.

### Will my own IP or uptime monitor get blocked?

Not if you pass it with `--allow` (single IPs or CIDRs, repeatable). Allowlisted sources are still analyzed but never appear in the blocklist.

### Can I run it every day?

Yes. Save `--json-out` each run and use `hunt_diff.py old.json new.json` to see only new findings, new IPs, escalations and attackers that went quiet.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
