Install
openclaw skills install @sdk-team/alibabacloud-web-application-attacks-analysisAnalyze origin web access logs (Nginx/Apache/IIS) to detect CC attacks, proxy-pool distributed bots, scanning probes, login brute force, abnormal crawlers, QPS/bandwidth/status-code surges, and slow resource consumption, then produce an actionable security report with mitigation advice. Read-only; no credentials required. Triggers: "CC attack", "HTTP flood", "proxy pool bot", "login brute force", "web access log analysis", "access log security analysis", "abnormal crawler", "QPS surge", "bandwidth surge", "4xx/5xx surge", "site being attacked", "scanning probe", "API abuse", "slow request analysis".
openclaw skills install @sdk-team/alibabacloud-web-application-attacks-analysisAnalyze origin web access logs and identify security threats with actionable mitigation recommendations. The analyzer supports Nginx, Apache, and IIS W3C log formats (auto-detected), extracts the real client IP from X-Forwarded-For chains, aggregates traffic across eleven analysis dimensions, detects eleven attack patterns with evidence-backed confidence levels, and renders a pure-ASCII report in text or Markdown format.
Requires Python 3 (standard library only, no third-party packages):
python3 --version
| Module | Purpose | File |
|---|---|---|
| Log Parsing | Format auto-detection, Nginx/Apache/IIS patterns, real client IP extraction, standardized fields | references/log_parsing.md |
| Attack Detection | Detection thresholds, behavioral signatures, and aggregate functions behind each attack type | references/attack-detection.md |
| Report Generation | Dual-audience layout: Executive Summary up front, the 11 detail sections, and Structured Findings (JSON) at the end | references/report-generation.md |
Load references on demand. Do not read all reference files unless the task requires them.
find, ls, glob, or any filesystem scan to look for log files. If no log file is provided, ask the user for the file path; never probe the disk instead.MANDATORY:
scripts/log_analyzer.py. Do not hand-assemble parsing or detection command chains. ABSOLUTE PROHIBITION: never write or run your own analysis scripts (no self-authored Python/shell analyzers, no ad-hoc awk/grep detection pipelines); the only permitted analysis command is the entry script.MANDATORY: after every successful analysis, the final answer MUST contain ALL THREE of the following parts, copied from the report without paraphrase:
/tmp/cc_single_ip.log).ABSOLUTE PROHIBITION: never deliver a final answer that omits any of the three parts above.
| # | Capability | Description |
|---|---|---|
| C1 | Single-IP High-Frequency CC | One IP generating massive requests in a short time window |
| C2 | Proxy-Pool / Distributed Bot CC | Many IPs sharing similar behavior (same UA, same URL, low frequency per IP) |
| C3 | API Abuse | Direct abnormal access patterns against API endpoints |
| C4 | Scanning / Probing | Systematic path/method enumeration with high 404 ratio |
| C5 | Login Brute Force / Credential Stuffing | Repeated POST requests against login endpoints |
| C6 | Abnormal Crawler | Non-standard UAs, aggressive crawling, spoofed browser UAs reused across many IPs |
| C7 | QPS Surge Mutation | Abrupt traffic surge or drop between adjacent minute windows |
| C8 | Slow Resource Consumption | Abnormally high upstream_time or request_time across time windows |
| C9 | Origin Direct-Access Risk | remote_ip == client_ip (no proxy layer in front of the origin) |
| C10 | Bandwidth Surge Mutation | Abrupt bandwidth surge or drop between adjacent minute windows |
| C11 | Status Code Surge (4xx/5xx) | Abrupt increase of 4xx or 5xx errors between adjacent minute windows |
Detection thresholds and behavioral signatures behind each capability are documented in references/attack-detection.md.
Set the skill directory once, then run the entry script:
SKILL_DIR=~/.qoderwork/skills/alibabacloud-web-application-attacks-analysis
cd $SKILL_DIR && python3 scripts/log_analyzer.py access.log
cd $SKILL_DIR && python3 scripts/log_analyzer.py access.log --output-format markdown
cd $SKILL_DIR && python3 scripts/log_analyzer.py access.log --time-window 30
cd $SKILL_DIR && python3 scripts/log_analyzer.py access.log --format nginx --output /tmp/report.txt
| Parameter | Description | Default |
|---|---|---|
log_file | Path to the access log file (required; .gz supported) | - |
--format <FORMAT> | Force log format: nginx, apache, or iis | auto-detect |
--top-n <N> | Number of Top N entries to display in report tables | 20 |
--time-window <N> | Only analyze the last N minutes of log data | full range |
--output <FILE> | Output report file path | <skill>/output/<logname>_report.<ext> (falls back to the current working directory if the skill directory is not writable) |
--output-format <FORMAT> | Report format: text or markdown (Markdown suits documentation tools) | text |
Exit code contract: 0 = analysis succeeded; 1 = input error (file not found, undetectable format, or no parseable log records); 2 = invalid command-line arguments.
Example 1: User: "My site is being attacked, here is the Nginx access log: /tmp/access.log"
cd $SKILL_DIR && python3 scripts/log_analyzer.py /tmp/access.log
Example 2: User: "I suspect a CC attack in the last hour, analyze this compressed log."
cd $SKILL_DIR && python3 scripts/log_analyzer.py access.log.gz --time-window 60
Example 3: User: "Analyze this Apache log and give me a Markdown report I can paste into my documentation."
cd $SKILL_DIR && python3 scripts/log_analyzer.py apache_access --format apache --output-format markdown
Example 4: User: "Login failures spiked, check this IIS log for brute force."
cd $SKILL_DIR && python3 scripts/log_analyzer.py u_ex260531.log --format iis
--time-window to keep analysis time reasonable.*.gz) are supported directly; no manual decompression needed.--output is omitted, the report is written to <skill>/output/ and the actual saved path is printed to stderr; if the skill directory is read-only, the script falls back to the current working directory and says so on stderr.