
CVE-2023-36845 に脆弱な Juniper ファイアウォールをスキャンするための go-exploit
この脆弱性スキャナーを使用して、Juniper ファイアウォールが CVE-2023-36845 に対して脆弱かどうかをスキャンできます。このスキャナーは go-exploit をベースに構築されているため、2 つのフェーズがあります。
LD_PRELOAD メッセージを送信し、脆弱なシステムから(無害な)エラーメッセージを生成します。CVE-2023-36845 のエクスプロイトに関する詳細は、ブログ記事「Fileless Remote Code Execution on Juniper Firewalls」をご覧ください。
Makefile を使用して Docker コンテナをビルドできます。
make docker
または、Go ビルド環境が既に整っている場合は、単に make を使用します。
albinolobster@mournland:~/cve-2023-36845-scanner$ make
gofmt -d -w scan.go
golangci-lint run --fix scan.go
GOOS=linux GOARCH=arm64 go build -o build/scan_linux-arm64 scan.go
このツールは をベースに構築されているため、スキャン対象を指定する方法が複数あります。詳細な説明はプロジェクトのにあります。以下にいくつかの例を示します。
$ ./build/scan_linux-arm64 -a -v -e -rhost 10.12.72.1 -log-json=true | jq 'select(.msg == "Vulnerable")'
{
"time": "2023-09-16T06:18:01.964471183-04:00",
"level": "SUCCESS",
"msg": "Vulnerable",
"vulnerable": true,
"rhost": "10.12.72.1",
"rport": 80
}
$ ./build/scan_linux-arm64 -a -v -e -rhosts 10.12.72.1,10.12.72.2
time=2023-09-16T06:19:26.592-04:00 level=STATUS msg="Starting target" index=0 host=10.12.72.1 port=80 ssl=false "ssl auto"=true
time=2023-09-16T06:19:36.607-04:00 level=STATUS msg="Validating JunOS Web Interface target" host=10.12.72.1 port=80
time=2023-09-16T06:19:37.528-04:00 level=SUCCESS msg="Target validation succeeded!" host=10.12.72.1 port=80
time=2023-09-16T06:19:37.574-04:00 level=SUCCESS msg=Vulnerable vulnerable=true rhost=10.12.72.1 rport=80
time=2023-09-16T06:19:37.575-04:00 level=STATUS msg="Exploit successfully completed"
time=2023-09-16T06:19:37.575-04:00 level=STATUS msg="Starting target" index=1 host=10.12.72.2 port=80 ssl=false "ssl auto"=true
time=2023-09-16T06:19:37.575-04:00 level=STATUS msg="Validating JunOS Web Interface target" host=10.12.72.2 port=80
time=2023-09-16T06:19:37.576-04:00 level=ERROR msg="The target isn't recognized as JunOS Web Interface, quitting" host=10.12.72.2 port=80
go-exploit は、提供されたターゲット CSV を介してスキャンする機能を提供します。CSV の形式は host, port, SSL が有効な場合の任意の文字列 です(ただし、-a が使用されている場合、SSL フィールドは無視されます)。詳細はスキャンのドキュメントを参照してください。また、プロキシを介してスキャンする機能も提供します。コマンドは次のように動作します。
$ ./build/scan_linux-arm64 -v -e -rhosts-file ~/junos/junos.targets.csv -proxy socks5://127.0.0.1:9050 -log-file vulnscan.json
^C
$ tail vulnscan.json
time=2023-09-17T05:11:19.256-04:00 level=STATUS msg="Starting target" index=0 host=x port=443 ssl=true "ssl auto"=false
time=2023-09-17T05:11:19.256-04:00 level=STATUS msg="Validating JunOS Web Interface target" host=x port=443
time=2023-09-17T05:11:29.257-04:00 level=ERROR msg="HTTP request error: Get \"https://x:443/\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
time=2023-09-17T05:11:29.257-04:00 level=ERROR msg="The target isn't recognized as JunOS Web Interface, quitting" host=x port=443
time=2023-09-17T05:11:29.257-04:00 level=STATUS msg="Starting target" index=1 host=x port=80 ssl=false "ssl auto"=false
time=2023-09-17T05:11:29.257-04:00 level=STATUS msg="Validating JunOS Web Interface target" host=xport=80