Skip to content
KitploitKITPLOIT
أدواتالمدونة
إرسال
أدواتالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

··الخلاصات·اتصال·الخصوصية·© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
CVE-2026-7777-Rust-Use-After-Free-in-Unsafe-Web-Server — يوضح ثغرة الاستخدام بعد التحرير (use-after-free) في خادم ويب مكتوب بلغة Rust مع كود هشّ ومشغّل متعدد الخيوط لإظهار تلف الذاكرة وإمكانية تنفيذ تعليمات برمجية. | Kitploit
أدوات/GitHubGitHub/george0papasotiriou/cve-2026-7777-rust-use-after-free-in-unsafe-web-server
تحليل الثغرات الأمنيةالاستغلالالتعلم والتعليماستغلال الملفات الثنائيةمختبرات وتدريب عملي
GitHubgeorge0papasotiriou/cve-2026-7777-rust-use-after-free-in-unsafe-web-server

CVE-2026-7777-Rust-Use-After-Free-in-Unsafe-Web-Server

يوضح ثغرة الاستخدام بعد التحرير (use-after-free) في خادم ويب مكتوب بلغة Rust مع كود هشّ ومشغّل متعدد الخيوط لإظهار تلف الذاكرة وإمكانية تنفيذ تعليمات برمجية.

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة
عرض المستودع
منذ 17 أياملم تتم المراجعة بعد

CVE-2026-7777 – الاستخدام بعد التحرير (Use‑After‑Free) في Rust داخل خادم ويب غير آمن

الكود البرمجي (Rust)

root@kitploit:~
// uaf_server.rs - Vulnerable Rust HTTP server with use-after-free
use std::sync::{Arc, Mutex};
use std::thread;
use std::io::prelude::*;
use std::net::{TcpListener, TcpStream};

struct SharedBuffer {
    data: Vec<u8>,
}

impl SharedBuffer {
    fn new() -> Self { SharedBuffer { data: vec![0; 1024] } }
}

fn handle_client(mut stream: TcpStream, buffer: Arc<Mutex<SharedBuffer>>) {
    // Simulate reading request and writing response.
    let mut buf = [0; 512];
    stream.read(&mut buf).unwrap();
    let b = buffer.lock().unwrap();
    let ptr = b.data.as_ptr() as *mut u8; // raw pointer
    // Drop the lock early? In unsafe block we might send the pointer to another thread.
    // Here we simulate a bug: the SharedBuffer is dropped, but we later use the pointer.
    drop(b);
    // After lock is released, another thread could replace the Vec, freeing the old allocation.
    // Unsafe write through the dangling pointer.
    unsafe {
        *ptr = 42; // use after free!
    }
    stream.write(b"HTTP/1.1 200 OK\r\n\r\nHello").unwrap();
}

fn main() {
    let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
    let buffer = Arc::new(Mutex::new(SharedBuffer::new()));
    for stream in listener.incoming() {
        let stream = stream.unwrap();
        let buf_clone = Arc::clone(&buffer);
        thread::spawn(move || {
            handle_client(stream, buf_clone);
        });
    }
}

CVE-2026-7777 – الاستخدام بعد التحرير غير الآمن في Rust داخل خادم ويب

Severity: High

نظرة عامة

يستخدم خادم ويب بلغة Rust كودًا غير آمن (unsafe) لمشاركة مخزن مؤقت عبر الخيوط. تؤدي حالة سباق (race condition) إلى الاستخدام بعد التحرير (use-after-free)، مما قد يسبب تلفًا في الذاكرة أو كشفًا للمعلومات.

تفاصيل الثغرة

  • النوع: الاستخدام بعد التحرير (Use‑After‑Free) (سلامة الذاكرة)
  • التأثير: حجب الخدمة (Denial of Service)، مع احتمالية تنفيذ كود تعسفي.
  • السبب الجذري: يتم الحصول على مؤشر خام (raw pointer) من Vec تحت قفل (lock)، ثم يتم تحرير القفل، ويُستبدل المتجه بواسطة خيط آخر، مما يحرر الذاكرة بينما يظل المؤشر مستخدمًا.

توضيح الاستغلال

  1. قم بتجميع وتشغيل الخادم الضعيف:
    root@kitploit:~
    rustc uaf_server.rs
    ./uaf_server
    
  2. قم بتشغيل المُحفِّز متعدد الخيوط:
    root@kitploit:~
    python trigger_uaf.py
    
تنزيل الأداة