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

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

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

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

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

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
Kernel-exploitation — CTF चुनौतियों के लिए Linux कर्नेल एक्सप्लॉइट विकास नोट्स और स्क्रिप्ट्स, जिनमें initramfs निष्कर्षण, msg_msg/ldt_struct दुरुपयोग, तथा विशेषाधिकार वृद्धि के लिए व्यावहारिक शोषण तकनीकें शामिल हैं। | Kitploit
उपकरण/GitHubGitHub/ameetsaahu/kernel-exploitation
विशेषाधिकार वृद्धिशोषणCTFलर्निंग और शिक्षाचयनित संसाधनबाइनरी शोषण
GitHubameetsaahu/kernel-exploitation

Kernel-exploitation

CTF चुनौतियों के लिए Linux कर्नेल एक्सप्लॉइट विकास नोट्स और स्क्रिप्ट्स, जिनमें initramfs निष्कर्षण, msg_msg/ldt_struct दुरुपयोग, तथा विशेषाधिकार वृद्धि के लिए व्यावहारिक शोषण तकनीकें शामिल हैं।

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

सभी देखें →

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

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

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

सभी उपकरण देखें →
साझा करें
रिपॉजिटरी देखें
3751 साल पहलेKitploit द्वारा समीक्षित

कर्नेल-शोषण (Kernel-exploitation)

decompress.sh

CPIO संग्रह से फ़ाइल निकालें

root@kitploit:~
#!/bin/sh
mkdir fs
cd fs
cp ../initramfs.cpio.gz ./initramfs.cpio.gz
gunzip ./initramfs.cpio.gz
cpio -idm < ./initramfs.cpio
rm initramfs.cpio
cd ..

compress.sh

एक्सप्लॉइट को संकलित (compile) करें, उसे fs में जोड़ें, और चलाएँ।

root@kitploit:~
#!/bin/sh
gcc -w -o exploit -static exploit.c -pthread -lrt &&\
# musl-gcc -w -s -static -o3 exploit.c -o exploit -masm=intel &&\
mv exploit ./fs/ &&\
cd fs &&\
find . -print0 | cpio --owner root --null -ov --format=newc | gzip -9 > ../initramfs.cpio.gz &&\
cd .. &&\
# gunzip -f initramfs.cpio.gz &&\
./run.sh

ext4 फाइलसिस्टम संग्रह के मामले में

root@kitploit:~
mount ./initramfs.cpio.gz ./fs/

extract-image.sh

उपयोगी संरचनाएँ (Useful structures)

ldt_struct - modify_ldt syscall

0x20 आकार की संरचना, जिसमें copy_to_user कॉल के लिए कोई जाँच नहीं होती

  • https://elixir.bootlin.com/linux/v4.19.98/source/arch/x86/kernel/ldt.c#L553
  • https://github.com/ameetsaahu/Kernel-exploitation/tree/main/0ctffinal2021-kernote

msg_msg

root@kitploit:~
struct msg_msg {
    struct list_head m_list;
    long m_type;
    size_t m_ts;        /* message text size */
    struct msg_msgseg *next;
    void *security;
    /* the actual message follows immediately */
};

उपयोगकर्ता संदेश msg_msg संरचना के ठीक बाद 0x1000 - 0x30 तक संग्रहीत होता है; उसके बाद struct msg_msgseg *next में संग्रहीत चंक्स (chunks) की एकल-लिंक्ड सूची होती है, जिसका प्रत्येक आवंटन आकार 0x1000 तक होता है, और यह NULL से समाप्त होना चाहिए। मनमाना पठन (arbitrary read) के लिए: next और m_ts को इस प्रकार अधिलेखित (overwrite) करें कि उसे अधिलेखित next पॉइंटर से पढ़ना पड़े।

मनमाना लेखन (arbitrary write) के लिए:

root@kitploit:~
msgsnd()        // Userland
    do_msgsnd() // Kernel land
        load_msg()  
            alloc_msg()         // Allocate all the necessary chunks
            copy_from_user()    // Race here to replace `struct msg_msgseg *next` before its used to copy userdata. Maybe use userfaultfd ;)

msg_msg do_msgsnd load_msg copy_msg

  • https://github.com/ameetsaahu/Kernel-exploitation/tree/main/corctf2021-fire_of_salvation
  • https://syst3mfailure.io/wall-of-perdition

विविध (Misc)

प्रक्रिया को विशिष्ट CPU पर चलाने के लिए प्रतिबंधित करना

root@kitploit:~
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
CPU_SET(0,&cpu_set);
ret=sched_setaffinity(0,sizeof(cpu_set),&cpu_set);

संदर्भ (References)

  • https://github.com/xairy/linux-kernel-exploitation by @andreyknvl
  • Structures collection useful for kernel-exp by @ptr-yudai
  • https://blog.hacktivesecurity.com/index.php/2022/06/13/linux-kernel-exploit-development-1day-case-study
  • https://duasynt.com/blog/linux-kernel-heap-feng-shui-2022
  • https://googleprojectzero.blogspot.com/2019/11/bad-binder-android-in-wild-exploit.html
  • https://cloudfuzz.github.io/android-kernel-exploitation
टूल डाउनलोड करें