The Lost Contract
- Category: Blockchain
- 750 Points
- Solved by the JCTF Team
Description
Solution
Let's connect to the provider:
const Web3 = require('web3');
web3 = new Web3(new Web3.providers.HttpProvider("http://elprofessor.challenges.bsidestlv.com:7545/"));
var code = web3.eth.getCode("0x176E7dD5238041E9962106cBbccE55FB75b474ae", web3.eth.defaultBlock, (code, data) =>{
console.log(code);
console.log(data);
});
The output:
C:\TheLostContract> node main.js
0x6080604052600436106100405763ffffffff7c010000000000000000000000000000000000000000000000000000000060
0035041663f96339308114610045575b600080fd5b34801561005157600080fd5b5061005a6100cf565b6040805160208082
528351818301528351919283929083019185019080838360005b8381101561009457818101518382015260200161007c565b
50505050905090810190601f1680156100c15780820380516001836020036101000a031916815260200191505b5092505050
60405180910390f35b60408051606081018252602281527f425369646573544c567b4976654233336e4c307374346e645930
754730744d6560208201527f217d000000000000000000000000000000000000000000000000000000000000918101919091
52905600a165627a7a723058209f6eba20363460903dbcda0aa3bc6186399495ca039878348b01e886101c1be00029
Using IDA-EVM (An IDA Processor Module for the Ethereum Virtual Machine (EVM)) we can disassemble this code.
After disassembly we see this chunk:
RAM:00DE PUSH32 0x425369646573544c567b4976654233336e4c307374346e645930754730744d65 // BSidesTLV{IveB33nL0st4ndY0uG0tMe
RAM:00FF PUSH1 0x20
RAM:0101 DUP3
RAM:0102 ADD
RAM:0103 MSTORE
RAM:0104 PUSH32 0x217d000000000000000000000000000000000000000000000000000000000000 // !}
Therefore the flag is BSidesTLV{IveB33nL0st4ndY0uG0tMe!}
.