
CVE-2023-36845에 취약한 주니퍼 방화벽을 스캔하기 위한 go-exploit
이 취약점 스캐너는 Juniper 방화벽을 스캔하여 CVE-2023-36845에 취약한지 여부를 확인하는 데 사용됩니다. 이 스캐너는 go-exploit을 기반으로 구축되었기 때문에 두 단계로 구성됩니다:
LD_PRELOAD 메시지를 전송하여 취약한 시스템에서 (무해한) 오류 메시지를 생성합니다.CVE-2023-36845 익스플로잇에 대한 자세한 내용은 블로그인 Fileless Remote Code Execution on Juniper Firewalls를 참조하십시오.
makefile을 사용하여 도커 컨테이너를 빌드할 수 있습니다:
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
이 도구는 go-exploit을 기반으로 구축되었으므로 스캔할 대상을 제공하는 여러 가지 방법이 있습니다. 전체 설명은 프로젝트의 에서 확인할 수 있습니다. 그러나 다음은 몇 가지 예를 보여줍니다:
$ ./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, anything if ssl is enabled입니다 (단, -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