Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

๐Ÿ‘พ ๐—บ๐˜† ๐—บ๐—ฒ๐˜๐—ต๐—ผ๐—ฑ๐—ผ๐—น๐—ผ๐—ด๐˜† ๐—ณ๐—ผ๐—ฟ ๐—ฑ๐—ฒ๐˜๐—ฎ๐—ถ๐—น๐—ฒ๐—ฑ ๐˜€๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—ณ๐—ผ๐˜‚๐—ป๐—ฑ๐—ฟ๐˜† ๐—ฏ๐—ผ๐—ถ๐—น๐—ฒ๐—ฟ๐—ฝ๐—น๐—ฎ๐˜๐—ฒ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐—ฒ๐—ฎ๐—ฐ๐—ต ๐—ฒ๐˜๐—ต๐—ฒ๐—ฟ๐—ป๐—ฎ๐˜‚๐˜ ๐—น๐—ฒ๐˜ƒ๐—ฒ๐—น

Notifications You must be signed in to change notification settings

go-outside-labs/ethernaut-systematic-solutions-foundry-sol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

88 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง‘๐Ÿปโ€๐Ÿš€ my ethernaut write-ups + solutions, systematically on foundry


๐Ÿ”‹ this project contains solutions for openzeppelin's ethernaut wargames. leveraging foundry, each level has a test set (test/*.t.sol), a script set (script/*.s.sol), and a write-up. some levels also have an exploit at src/*.sol.
๐Ÿ”‹ to read the full notes about this work, check out my mirror publication: on hacking systematically with foundry. you are welcome to submit solutions and pull requests.
๐Ÿ”‹ by the way, do you remember overthewire? here is my WeChall profile from playing it in 2014.


levels


โœ… 01. Fallback - exploiting fallback():
โœ… 02. Fallout - exploiting constructor():
โœ… 03. Coin Flip - exploiting pseudo-randomness:
โœ… 04. Telephone - exploiting tx.origin:
โœ… 05. Token - exploiting integer overflows:
โœ… 06. Delegation - exploiting delegatecall:
โœ… 07. Force - exploiting payable contracts:
โœ… 08. Vault - exploiting private functions:
โœ… 09. King - exploiting transfer(msg.value):
โœ… 10. Reentrancy - exploiting reentrancy:
โœ… 11. Elevator - exploiting interfaces:
๐Ÿ”œ 12. Privacy:
๐Ÿ”œ 13. Gatekeeper One:
๐Ÿ”œ 14. Gatekeeper Two:
๐Ÿ”œ 15. Naught Coin:
๐Ÿ”œ 16. Preservation:
๐Ÿ”œ 17. Recovery:
๐Ÿ”œ 18. Magic Number:
๐Ÿ”œ 19. Alien Code:
๐Ÿ”œ 20. Denial:
โœ… 21. Shop - exploiting interfaces II:
๐Ÿ”œ 22. Dex:
๐Ÿ”œ 23. Dex Two:
๐Ÿ”œ 24. Puzzle Wallet:
๐Ÿ”œ 25. Motorbike:
๐Ÿ”œ 26. Doubly Entry Point:
๐Ÿ”œ 27. Good Samaritan:
๐Ÿ”œ 28. Gatekeeper Three:
๐Ÿ”œ 29. Switch:


installing


  • install foundry

  • create a test wallet (e.g., with metamask)

  • create a .env (copying from .env.example) and add keys and the addresses of each instance.

  • add a sepolia rpc url to foundry.toml (e.g., from alchemy or infura)



running each level


  • you will find detailed instructions in each write-up, but as a general rule:

  • run tests with, for example,
    • forge test -vvvv, or, for example,
    • forge test -vvvv --match-path ./test/01/Fallback.t.sol

  • submit scripts with, for example,
    • forge script ./script/01/Fallback.s.sol --broadcast -vvvv --rpc-url sepolia




(like to solve these types of problems? perhaps you are neo-cypherpunk, then?)

About

๐Ÿ‘พ ๐—บ๐˜† ๐—บ๐—ฒ๐˜๐—ต๐—ผ๐—ฑ๐—ผ๐—น๐—ผ๐—ด๐˜† ๐—ณ๐—ผ๐—ฟ ๐—ฑ๐—ฒ๐˜๐—ฎ๐—ถ๐—น๐—ฒ๐—ฑ ๐˜€๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—ณ๐—ผ๐˜‚๐—ป๐—ฑ๐—ฟ๐˜† ๐—ฏ๐—ผ๐—ถ๐—น๐—ฒ๐—ฟ๐—ฝ๐—น๐—ฎ๐˜๐—ฒ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐—ฒ๐—ฎ๐—ฐ๐—ต ๐—ฒ๐˜๐—ต๐—ฒ๐—ฟ๐—ป๐—ฎ๐˜‚๐˜ ๐—น๐—ฒ๐˜ƒ๐—ฒ๐—น

Topics

Resources

Stars

Watchers

Forks