2个版本
0.1.1 | 2021年5月13日 |
---|---|
0.1.0 | 2021年4月16日 |
#2776 在 解析实现
20KB
413 行
ComBot 0.1.1
一个命令行实用工具,用于解析服务器访问日志、检测机器人,并以指定格式输出检测到的机器人列表。
支持的输入格式
- NGINX
- Apache
支持的输出格式
- CSV
- AbuseIPDB CSV(提交前请勿忘去重此列表)
- JSON
触发列表
此工具支持指定“触发列表”或使用内置列表。
列表文件应采用以下格式
botname1|trigger string one
botname2|trigger string two
管道字符 |
用于分隔触发名称和触发字符串,每行是一个触发。
支持两个列表,这些是URI列表和用户代理列表。触发字符串在它们是日志条目相应部分的子字符串时效果最佳。例如
对于URI触发使用 phpunit
而不是 /test/phpunit/submit.php
。
对于用户代理触发使用 zgrab
而不是 Mozilla/5.0 zgrab/0.x
。
URI比用户代理具有优先权,因为它们通常更具体。
帮助
combot 0.1.0 GNU-GPL-3.0
Chad Baxter
A utility to parse server access logs and detect bots based on URI paths and User Agents.
USAGE:
combot [OPTIONS] <input> <output> --input_format <input_format> --output_format <output_format>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --input_format <input_format> Select the input format: nginx
-f, --output_format <output_format> Select the output format: csv, abuseipdb-csv
-a, --ua_list <ua_list> Specify a path to a list of User Agent pieces to trigger on.
-u, --uri_list <uri_list> Specify a path to a list of URI pieces to trigger on.
ARGS:
<input> The input file path.
<output> The output file path (will be overwritten).
依赖
~5–6.5MB
~97K SLoC