
O motor modular distribuído de fingerprinting
O Scannerl é um mecanismo modular distribuído de fingerprinting implementado pela Kudelski Security. O Scannerl pode realizar fingerprint de milhares de alvos em um único host, mas pode ser facilmente distribuído por vários hosts. O Scannerl está para o fingerprinting assim como o zmap está para o escaneamento de portas.
O Scannerl funciona no Debian/Ubuntu/Arch (mas provavelmente funcionará em outras distribuições também). Ele usa uma arquitetura mestre/escravo onde o nó mestre distribui o trabalho (host(s) para fingerprint) para seus escravos (locais ou remotos). Toda a implantação é transparente para o usuário.
Ao usar ferramentas convencionais de fingerprinting para análises em larga escala, os pesquisadores de segurança frequentemente encontram duas limitações: primeiro, essas ferramentas são tipicamente construídas para escanear comparativamente poucos hosts por vez e são inadequadas para grandes faixas de endereços IP. Segundo, se uma grande faixa de endereços IP protegidos por dispositivos IPS estiver sendo submetida a fingerprint, a probabilidade de ser colocada na lista negra é maior, o que pode levar a um conjunto incompleto de informações. O Scannerl foi projetado para contornar essas limitações, não apenas fornecendo a capacidade de realizar fingerprint de múltiplos hosts simultaneamente, mas também distribuindo a carga por um número arbitrário de hosts. O Scannerl também torna a distribuição dessas tarefas completamente transparente, o que torna a configuração e manutenção de projetos de fingerprinting em larga escala triviais; isso permite focar nas análises em vez da tarefa hercúlea de gerenciar e distribuir processos de fingerprinting manualmente. Além do fator velocidade, o scannerl foi projetado para permitir configurar facilmente análises específicas de fingerprinting em algumas linhas de código. Não apenas a criação de um cluster de fingerprinting é fácil de configurar, mas também pode ser ajustada adicionando varreduras refinadas às suas campanhas de fingerprinting.
É a ferramenta mais rápida para realizar campanhas de fingerprinting em larga escala.
Para mais informações:
Índice
Veja o wiki para mais.
Veja as diferentes opções de instalação na página de instalação do wiki
Para instalar a partir do código fonte, primeiro instale o Erlang (pelo menos v.18) escolhendo o pacote correto para sua plataforma: Downloads do Erlang
Instale os pacotes necessários:
# on debian
$ sudo apt install erlang erlang-src rebar
# on arch
$ sudo pacman -S erlang-nox rebar
Em seguida, compile o scannerl:
$ git clone https://github.com/kudelskisecurity/scannerl.git
$ cd scannerl
$ ./build.sh
Obtenha o uso executando
$ ./scannerl -h
O Scannerl está disponível no AUR para usuários do Arch Linux
DEBs (Ubuntu, Debian) estão disponíveis nos releases.
RPMs (Opensuse, Centos, Redhat) estão disponíveis em https://build.opensuse.org/package/show/home:chapeaurouge/scannerl.
Dois tipos de nós são necessários para realizar uma varredura distribuída:
O nó mestre precisa ter o scannerl instalado e compilado, enquanto o(s) nó(s) escravo(s) precisa(m) apenas ter o Erlang instalado. Toda a configuração é transparente e feita automaticamente pelo nó mestre.
Requisitos para uma varredura distribuída:
$ ./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.
Veja o wiki para mais.
O Scannerl pode ser usado no host local sem nenhum outro host. No entanto, ele ainda criará um nó escravo no mesmo host de onde é executado. Portanto, os requisitos descritos em Configuração distribuída também devem ser atendidos.
Uma maneira rápida de fazer isso é garantir que seu host seja capaz de se resolver com
grep -q "127.0.1.1\s*`hostname`" /etc/hosts || echo "127.0.1.1 `hostname`" | sudo tee -a /etc/hosts
e criar uma chave SSH (se ainda não existir) e adicioná-la ao authorized_keys (você precisa de um servidor SSH em execução):
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
O exemplo a seguir executa uma captura de banner HTTP em google.com a partir do localhost
./scannerl -m httpbg -d google.com
Para realizar uma varredura distribuída, é necessário pré-configurar os hosts que serão usados pelo scannerl para distribuir o trabalho. Veja Configuração distribuída para mais informações.
O Scannerl espera uma lista de escravos para usar (fornecida pelas opções -s ou -S).
./scannerl -m httpbg -d google.com -s host1,host2,host3
O Scannerl listará os módulos disponíveis (módulos de saída e módulos de fingerprinting) com a opção -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)
Os argumentos podem ser fornecidos aos módulos com dois pontos. Por exemplo, para o módulo de saída file:
./scannerl -m httpbg -d google.com -o file:/tmp/result
O resultado retornado pelo scannerl aos módulos de saída tem a seguinte forma:
{module, target, port, result}
Onde
module: o módulo usado (átomo Erlang)target: IP ou hostname (string ou endereço IPv4)port: a porta (inteiro)result: veja abaixoA parte result tem a forma:
{{status, type},Value}
Onde {status, type} é uma das seguintes tuplas:
{ok, result}: o fingerprint do alvo foi bem-sucedido{error, up}: o fingerprint não foi bem-sucedido, mas o alvo respondeu{error, unknown}: o fingerprint falhouValue é o valor retornado - pode ser um átomo ou uma lista de elementos
O Scannerl foi projetado e implementado com modularidade em mente. É fácil adicionar novos módulos a ele:
Para criar novos módulos, basta seguir o comportamento (fp_module.erl para módulos de fingerprinting e out_behavior.erl para módulos de saída) e implementar seus módulos.
Novos módulos podem ser adicionados em tempo de compilação ou dinamicamente como um arquivo externo.
Veja a página do wiki para mais.
Sinta-se à vontade para abrir uma issue ou um PR.
Copyright(c) 2017 Nagravision SA.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.