
모듈형 분산 핑거프린팅 엔진
Scannerl은 Kudelski Security에서 구현한 모듈식 분산 핑거프린팅 엔진입니다. Scannerl은 단일 호스트에서 수천 개의 대상을 핑거프린팅할 수 있지만, 여러 호스트에 쉽게 분산될 수도 있습니다. Scannerl은 핑거프린팅에 있어 zmap이 포트 스캐닝에 해당하는 역할을 합니다.
Scannerl은 Debian/Ubuntu/Arch에서 작동합니다 (다른 배포판에서도 작동할 가능성이 높습니다). 마스터/슬레이브 아키텍처를 사용하며, 마스터 노드는 작업(핑거프린팅할 호스트)을 슬레이브(로컬 또는 원격)에 분배합니다. 전체 배포는 사용자에게 투명하게 이루어집니다.
기존 핑거프린팅 도구를 대규모 분석에 사용할 때 보안 연구자들은 두 가지 한계에 부딪히곤 합니다. 첫째, 이러한 도구는 일반적으로 비교적 적은 수의 호스트를 동시에 스캔하도록 설계되어 있어 넓은 IP 주소 범위에는 적합하지 않습니다. 둘째, IPS 장치로 보호되는 넓은 IP 주소 범위를 핑거프린팅할 경우 블랙리스트에 등록될 가능성이 높아져 불완전한 정보를 얻게 될 수 있습니다. Scannerl은 여러 호스트를 동시에 핑거프린팅할 수 있을 뿐만 아니라 임의의 수의 호스트에 작업을 분산시켜 이러한 한계를 극복하도록 설계되었습니다. 또한 Scannerl은 이러한 작업 분배를 완전히 투명하게 만들어 대규모 핑거프린팅 프로젝트의 설정 및 유지 관리를 간단하게 합니다. 이를 통해 수동으로 핑거프린팅 프로세스를 관리하고 분배하는 어려운 작업 대신 분석에 집중할 수 있습니다. 속도 외에도 Scannerl은 몇 줄의 코드로 특정 핑거프린팅 분석을 쉽게 설정할 수 있도록 설계되었습니다. 핑거프린팅 클러스터 생성이 쉬울 뿐만 아니라, 미세 조정된 스캔을 핑거프린팅 캠페인에 추가하여 세부 조정도 가능합니다.
대규모 핑거프린팅 캠페인을 수행하는 가장 빠른 도구입니다.
자세한 내용은 다음을 참조하세요:
목차
자세한 내용은 위키를 참조하세요.
다양한 설치 옵션은 위키 설치 페이지를 참조하세요.
소스에서 설치하려면 먼저 플랫폼에 맞는 패키지를 선택하여 Erlang(최소 v.18)을 설치하세요: Erlang 다운로드
필수 패키지를 설치합니다:
# debian의 경우
$ sudo apt install erlang erlang-src rebar
# arch의 경우
$ sudo pacman -S erlang-nox rebar
그런 다음 scannerl을 빌드합니다:
$ git clone https://github.com/kudelskisecurity/scannerl.git
$ cd scannerl
$ ./build.sh
사용법을 확인하려면 다음을 실행하세요:
$ ./scannerl -h
Scannerl은 Arch Linux 사용자를 위해 AUR에서 사용할 수 있습니다:
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.
자세한 내용은 위키를 참조하세요.
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 atom)target: IP 또는 호스트명 (문자열 또는 IPv4 주소)port: 포트 (정수)result: 아래 참조result 부분의 형식은 다음과 같습니다:
{{status, type},Value}
여기서 {status, type}은 다음 튜플 중 하나입니다:
{ok, result}: 대상 핑거프린팅 성공{error, up}: 핑거프린팅 실패했지만 대상이 응답함{error, unknown}: 핑거프린팅 실패Value는 반환된 값입니다 - atom 또는 요소의 리스트입니다.
Scannerl은 모듈성을 염두에 두고 설계 및 구현되었습니다. 새로운 모듈을 쉽게 추가할 수 있습니다:
새 모듈을 생성하려면 동작(fp_module.erl (핑거프린팅 모듈용) 및 out_behavior.erl (출력 모듈용))을 따르고 모듈을 구현하기만 하면 됩니다.
새 모듈은 컴파일 시 추가하거나 외부 파일로 동적으로 추가할 수 있습니다.
자세한 내용은 위키 페이지를 참조하세요.
이슈나 PR을 자유롭게 열어주세요.
Copyright(c) 2017 Nagravision SA.
이 프로그램은 자유 소프트웨어입니다. 자유 소프트웨어 재단이 발표한 GNU General Public License 버전 3의 조건에 따라 재배포하거나 수정할 수 있습니다.
이 프로그램은 유용하게 사용되기를 바라는 마음으로 배포되지만, 어떠한 보증도 제공되지 않습니다. 상품성 또는 특정 목적에의 적합성에 대한 묵시적 보증도 포함되지 않습니다. 자세한 내용은 GNU General Public License를 참조하세요.
이 프로그램과 함께 GNU General Public License의 사본을 받았을 것입니다. 받지 못했다면 http://www.gnu.org/licenses/를 참조하십시오.