---
# System prepended metadata

title: 'HKCTF: Challenge Questions'

---

HKCTF: Challenge Questions
===
## Challenge 1
There is a smart contract that stores an encrypted flag in a private variable. 

> Solution: Use curl to reveal the encrypted flag at a specific position
> Tutorial: https://medium.com/swlh/ethereum-aint-hiding-your-secrets-703e89088937

## Challenge 2
Replaying The Classics - DAO
> Solution: Use reentrancy attack to zero the contract's balances
> Reference: https://github.com/Oakland-Blockchain-Developers/Reentrancy-Attack-On-Smart-Contract/blob/master/reentrancy-attack-101.md

## Challenge 3
There are two contracts, you have to transfer all balances from one contract to another. Upon completion, you can go to a special website which gives u the flag once the contract balances are checked

> Solution: Use a smart contract to selfdestruct() another contract
> Reference: https://github.com/seadog007/smartcontract_ctfgame/blob/master/VXCTF%202018/NoMoneyNoCoin_Solved.sol#L44


## Challenge 4
There is a smart contract doing lottery. It will draw a random number based on the blocktime and blockheight and several other computations. If you could guess the number that it will generating, you will get the prize.

> Solution: Mimic the computation that is employed by the contract


## Implement

https://github.com/brdn1010/forHKCTF
