Scannerl 是一个模块化分布式指纹识别引擎,由 Kudelski Security 实现。Scannerl可以在单个主机上对数千个目标进行指纹识别,并且可以轻松地分布在多个主机上。Scannerl对于指纹识别的意义,就如同zmap对于端口扫描的意义。
Scannerl 适用于 Debian/Ubuntu/Arch(但也可能在其他发行版上运行)。它采用主从架构,主节点将工作(待指纹识别的主机)分配给其从节点(本地或远程)。整个部署对用户透明。
当使用传统指纹识别工具进行大规模分析时,安全研究人员通常会遇到两个限制:首先,这些工具通常设计用于一次扫描相对较少的主机,不适合大范围的IP地址。其次,如果对受IPS设备保护的大范围IP地址进行指纹识别,被列入黑名单的可能性更高,可能导致信息不完整。Scannerl旨在规避这些限制,不仅提供同时指纹识别多个主机的能力,还通过将负载分布到任意数量的主机上。Scannerl还使这些任务的分配完全透明,从而使大规模指纹识别项目的设置和维护变得简单;这使得可以专注于分析,而不是手工管理和分配指纹识别过程的艰巨任务。除了速度因素外,scannerl的设计允许用几行代码轻松设置特定的指纹识别分析。指纹识别集群的创建不仅容易设置,而且可以通过向指纹识别活动添加微调的扫描来进行调整。它是执行大规模指纹识别活动最快的工具。
更多信息:
目录
更多信息请参阅wiki。
请参阅wiki安装页面了解不同的安装选项。
要从源代码安装,请先为您的平台选择合适的包以安装 Erlang(至少 v.18):Erlang下载
安装所需包:
# on debian
$ sudo apt install erlang erlang-src rebar
# on arch
$ sudo pacman -S erlang-nox rebar
然后构建 scannerl:
$ git clone https://github.com/kudelskisecurity/scannerl.git
$ cd scannerl
$ ./build.sh
通过运行以下命令查看用法:
$ ./scannerl -h
Scannerl 在 AUR 上对 Arch Linux 用户可用
DEB 包(Ubuntu、Debian)可在发布页面获取。
RPM 包(OpenSUSE、CentOS、Red Hat)可在 https://build.opensuse.org/package/show/home:chapeaurouge/scannerl 获取。
执行分布式扫描需要两种类型的节点:
主节点需要安装并编译 scannerl,而从节点只需安装 Erlang。整个设置透明,由主节点自动完成。
分布式扫描的要求:
$ ./scannerl -h
____ ____ _ _ _ _ _ _____ ____ _
/ ___| / ___| / \ | \ | | \ | | ____| _ \| |
\___ \| | / _ \ | \| | \| | _| | |_) | |
___) | |___ / ___ \| |\ | |\ | |___| _ <| |___
|____/ \____/_/ \_\_| \_|_| \_|_____|_| \_\_____|
USAGE
scannerl MODULE TARGETS [NODES] [OPTIONS]
MODULE:
-m <mod> --module <mod>
mod: the fingerprinting module to use.
arguments are separated with a colon.
TARGETS:
-f <target> --target <target>
target: a list of target separated by a comma.
-F <path> --target-file <path>
path: the path of the file containing one target per line.
-d <domain> --domain <domain>
domain: a list of domains separated by a comma.
-D <path> --domain-file <path>
path: the path of the file containing one domain per line.
NODES:
-s <node> --slave <node>
node: a list of node (hostnames not IPs) separated by a comma.
-S <path> --slave-file <path>
path: the path of the file containing one node per line.
a node can also be supplied with a multiplier (<node>*<nb>).
OPTIONS:
-o <mod> --output <mod> comma separated list of output module(s) to use.
-p <port> --port <port> the port to fingerprint.
-t <sec> --timeout <sec> the fingerprinting process timeout.
-T <sec> --stimeout <sec> slave connection timeout (default: 10).
-j <nb> --max-pkt <nb> max pkt to receive (int or "infinity").
-r <nb> --retry <nb> retry counter (default: 0).
-c <cidr> --prefix <cidr> sub-divide range with prefix > cidr (default: 24).
-M <port> --message <port> port to listen for message (default: 57005).
-P <nb> --process <nb> max simultaneous process per node (default: 28232).
-Q <nb> --queue <nb> max nb unprocessed results in queue (default: infinity).
-C <path> --config <path> read arguments from file, one per line.
-O <mode> --outmode <mode> 0: on Master, 1: on slave, >1: on broker (default: 0).
-v <val> --verbose <val> be verbose (0 <= int <= 255).
-K <opt> --socket <opt> comma separated socket option (key[:value]).
-l --list-modules list available fp/out modules.
-V --list-debug list available debug options.
-A --print-args Output the args record.
-X --priv-ports use only source port between 1 and 1024.
-N --nosafe keep going even if some slaves fail to start.
-w --www DNS will try for www.<domain>.
-b --progress show progress.
-x --dryrun dry run.
更多信息请参阅wiki。
Scannerl 可以在本地主机上单独使用,无需其他主机。但是,它仍会在其运行的主机上创建一个从节点。因此,分布式设置中描述的要求也必须满足。
快速完成此操作的方法是确保主机能够解析自身,使用以下命令:
grep -q "127.0.1.1\s*`hostname`" /etc/hosts || echo "127.0.1.1 `hostname`" | sudo tee -a /etc/hosts
并创建 SSH 密钥(如果尚未创建)并将其添加到 authorized_keys(需要运行 SSH 服务器):
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
以下示例在本地主机上对 google.com 执行 HTTP 横幅抓取:
./scannerl -m httpbg -d google.com
为了执行分布式扫描,需要预先设置 scannerl 用于分配工作的主机。更多信息请参见分布式设置。
Scannerl 期望提供一个从节点列表(通过 -s 或 -S 开关提供)。
./scannerl -m httpbg -d google.com -s host1,host2,host3
Scannerl 将使用 -l 开关列出可用模块(输出模块和指纹识别模块):
$ ./scannerl -l
Fingerprinting modules available
================================
bacnet UDP/47808: Bacnet identification
chargen UDP/19: Chargen amplification factor identification
fox TCP/1911: FOX identification
httpbg TCP/80: HTTP Server header identification
- Arg1: [true|false] follow redirection [Default:false]
httpsbg SSL/443: HTTPS Server header identification
https_certif SSL/443: HTTPS certificate graber
imap_certif TCP/143: IMAP STARTTLS certificate graber
modbus TCP/502: Modbus identification
mqtt TCP/1883: MQTT identification
mqtts TCP/8883: MQTT over SSL identification
mysql_greeting TCP/3306: Mysql version identification
pop3_certif TCP/110: POP3 STARTTLS certificate graber
smtp_certif TCP/25: SMTP STARTTLS certificate graber
ssh_host_key TCP/22: SSH host key graber
Output modules available
========================
csv output to csv
- Arg1: [true|false] save everything [Default:true]
csvfile output to csv file
- Arg1: [true|false] save everything [Default:false]
- Arg2: File path
file output to file
- Arg1: File path
file_ip output to stdout (only ip)
- Arg1: File path
file_mini output to file (only ip and result)
- Arg1: File path
file_resultonly output to file (only result)
- Arg1: File path
stdout output to stdout
stdout_ip output to stdout (only IP)
stdout_mini output to stdout (only ip and result)
可以为模块提供以冒号分隔的参数。例如对于 file 输出模块:
./scannerl -m httpbg -d google.com -o file:/tmp/result
Scannerl 返回给输出模块的结果具有以下形式:
{module, target, port, result}
其中
module: 使用的模块(Erlang 原子)target: IP 或主机名(字符串或 IPv4 地址)port: 端口(整数)result: 见下文result 部分的形式为:
{{status, type},Value}
其中 {status, type} 是以下元组之一:
{ok, result}: 对目标指纹识别成功{error, up}: 指纹识别未成功但目标有响应{error, unknown}: 指纹识别失败Value 是返回的值 - 它是一个原子或元素列表
Scannerl 的设计和实现考虑了模块化。很容易为其添加新模块:
要创建新模块,只需遵循行为(指纹识别模块为 fp_module.erl,输出模块为 out_behavior.erl)并实现您的模块。
新模块可以在编译时添加,也可以作为外部文件动态添加。
更多信息请参阅wiki页面。
欢迎提交 issue 或 PR。
版权(c) 2017 Nagravision SA.
本程序是自由软件:您可以根据自由软件基金会发布的 GNU 通用公共许可证第3版(或任何更高版本)的条款重新分发和/或修改它。
本程序的分发希望能有所帮助,但不提供任何担保;甚至没有适销性或特定用途适用性的暗示担保。详情请参阅 GNU 通用公共许可证。
您应该已经与本程序一起收到了 GNU 通用公共许可证的副本。如果没有,请访问 http://www.gnu.org/licenses/。