02.Guess the secret number
2023-06-23 20:26:12
# 01.Capturetheether CTF
Guess the secret number
topic
1 | pragma solidity ^0.4.21; |
analyses
we need to guess a number which returns 0xdb81b4d58595fbbbb592d3661a34cdca14d7ab379441400cbfa1b78bc447c365
after keccak256(). we can brute force it because the type of guess numer is uint8 which means there are only 256 probabilities.
solution
1.find the correct number off-chain
1 | const {ethers,utils} = require("ethers") |
2.call guess(uint8)
with the parameter “170” and 1 ETH