Description:
Join the 'Rogue Takeover Challenge' and showcase your smart contract skills in a thrilling test of control and exploitation.
Objective of CTF
Become the owner of the vault.
Note: You can create POCs using Foundry/Hardhat. Without proper POC, your submissions will not be accepted.
Contract Code:
pragma solidity =0.8.13;
contract Vault {
address public owner;
bytes32 public immutable name;
constructor (bytes32 _name) {
owner = msg.sender;
name = _name;
}
function anyCall(uint _func, uint data) external {
function(uint) func;
assembly {
func := _func
}
func(data);
}
function transferOwnership() public {
require(msg.sender == owner);
owner = msg.sender;
}
}
Foundry Setup:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import "../src/Vault.sol";
contract Challenge is Test {
Vault public vault;
address hacker;
function setUp() public {
vault = new Vault("BaoZang");
hacker = makeAddr("hacker");
}
function testHack() public {
vm.startPrank(hacker, hacker);
// solution
vm.stopPrank();
assertEq(vault.owner(), hacker);
}
}
Solutions:
Coming Soon…..
Author -
Neek @Amber Group