Secureum Book
  • ðŸ›ĄïļSecureum Bootcamp
    • ðŸ›ĄïļSecureum Bootcamp
    • 🙌Participate
    • 📜History
  • 📚LEARN
    • Introduction
      • 🔷1. Ethereum Basics
        • 1.1 Ethereum: Concept, Infrastructure & Purpose
        • 1.2 Properties of the Ethereum Infrastructure
        • 1.3 Ethereum vs. Bitcoin
        • 1.4 Ethereum Core Components
        • 1.5 Gas Metering: Solving the Halting Problem
        • 1.6 web2 vs. web3: The Paradigm Shift
        • 1.7 Decentralization
        • 1.8 Cryptography, Digital Signature & Keys
        • 1.9 Ethereum State & Account Types
        • 1.10 Transactions: Properties & Components
        • 1.11 Contract Creation
        • 1.12 Transactions, Messages & Blockchain
        • 1.13 EVM (Ethereum Virtual Machine) in Depth
        • 1.14 Transaction Reverts & Data
        • 1.15 Block Explorer
        • 1.16 Mainnet & Testnets
        • 1.17 ERCs & EIPs
        • 1.18 Legal Aspects in web3: Pseudonymity & DAOs
        • 1.19 Security in web3
        • 1.20 web2 Timescales vs. web3 Timescales
        • 1.21 Test-in-Prod. SSLDC vs. Audits
        • Summary: 101 Keypoints
      • 🌀2. Solidity
        • 2.1 Solidity: Influence, Features & Layout
        • 2.2 SPDX & Pragmas
        • 2.3 Imports
        • 2.4 Comments & NatSpec
        • 2.5 Smart Contracts
        • 2.6 State Variables: Definition, Visibility & Mutability
        • 2.7 Data Location
        • 2.8 Functions
        • 2.9 Events
        • 2.10 Solidity Typing
        • 2.11 Solidity Variables
        • 2.12 Address Type
        • 2.13 Conversions
        • 2.14 Keywords & Shorthand Operators
        • 2.15 Solidity Units
        • 2.16 Block & Transaction Properties
        • 2.17 ABI Encoding & Decoding
        • 2.18 Error Handling
        • 2.19 Mathematical & Cryptographic Functions
        • 2.20 Control Structures
        • 2.21 Style & Conventions
        • 2.22 Inheritance
        • 2.23 EVM Storage
        • 2.24 EVM Memory
        • 2.25 Inline Assembly
        • 2.26 Solidity Version Changes
        • 2.27 Security Checks
        • 2.28 OpenZeppelin Libraries
        • 2.29 DAppSys Libraries
        • 2.30 Important Protocols
        • Summary: 201 Keypoints
      • 🔏3. Security Pitfalls & Best Practices
        • 3.1 Solidity Versions
        • 3.2 Access Control
        • 3.3 Modifiers
        • 3.4 Constructor
        • 3.5 Delegatecall
        • 3.6 Reentrancy
        • 3.7 Private Data
        • 3.8 PRNG & Time
        • 3.9 Math & Logic
        • 3.10 Transaction Order Dependence
        • 3.11 ecrecover
        • 3.12 Unexpected Returns
        • 3.13 Ether Accounting
        • 3.14 Transaction Checks
        • 3.15 Delete Mappings
        • 3.16 State Modification
        • 3.17 Shadowing & Pre-declaration
        • 3.18 Gas & Costs
        • 3.19 Events
        • 3.20 Unary Expressions
        • 3.21 Addresses
        • 3.22 Assertions
        • 3.23 Keywords
        • 3.24 Visibility
        • 3.25 Inheritance
        • 3.26 Reference Parameters
        • 3.27 Arbitrary Jumps
        • 3.28 Hash Collisions & Byte Level Issues
        • 3.29 Unicode RTLO
        • 3.30 Variables
        • 3.31 Pointers
        • 3.32 Out-of-range Enum
        • 3.33 Dead Code & Redundant Statements
        • 3.34 Compiler Bugs
        • 3.35 Proxy Pitfalls
        • 3.36 Token Pitfalls
        • 3.37 Special Token Pitfalls
        • 3.38 Guarded Launch Pitfalls
        • 3.39 System Pitfalls
        • 3.40 Access Control Pitfalls
        • 3.41 Testing, Unused & Redundand Code
        • 3.42 Handling Ether
        • 3.43 Application Logic Pitfalls
        • 3.44 Saltzer & Schroeder's Design Principles
        • Summary: 201 Keypoints
      • 🗜ïļ4. Audit Techniques & Tools
        • 4.1 Audit
        • 4.2 Analysis Techniques
        • 4.3 Specification, Documentation & Testing
        • 4.4 False Positives & Negatives
        • 4.5 Security Tools
        • 4.6 Audit Process
        • Summary: 101 Keypoints
      • ☝ïļ5. Audit Findings
        • 5.1 Criticals
        • 5.2 Highs
        • 5.3 Mediums
        • 5.4 Lows
        • 5.5 Informationals
        • Summary: 201 Keypoints
  • ðŸŒąCARE
    • CARE
      • CARE Reports
  • ðŸšĐCTFs
    • A-MAZE-X CTFs
      • Secureum A-MAZE-X
      • Secureum A-MAZE-X Stanford
      • Secureum A-MAZE-X Maison de la Chimie Paris
Powered by GitBook
On this page
  • Secureum A-MAZE-X Maison de la Chimie, DeFi Security Summit
  • A Smart Contract Security _Capture the Flag_** Workshop**
  • Contents
  • Instructions ðŸ•đïļ
  • Flavors
  • Important note
  • How to play ♘
  • Challenges ðŸŽŪ
  • Slides
  • CTF Writeup 🗒ïļðŸ—’ïļðŸ—’ïļ
  1. CTFs
  2. A-MAZE-X CTFs

Secureum A-MAZE-X Maison de la Chimie Paris

PreviousSecureum A-MAZE-X Stanford

Last updated 1 year ago

Secureum A-MAZE-X Maison de la Chimie, DeFi Security Summit

A Smart Contract Security _Capture the Flag_** Workshop**


\

Contents

Instructions ðŸ•đïļ

This Workshop consists in a series of challenges, of increasing difficulty, targeting different concepts and common vulnerabilities found in DeFi. The CTF consists of a series of challenges suitable for different levels of expertise.


\

Flavors

This workshop provides different flavors. Feel free to use the one you feel more comfortable with:

  • Option 1: Locally with Foundry


\

Important note

This set of challenges aren't set for competitive purposes. Their main objective is to showcase scenarios involving DeFi, Solidity concepts and common vulnerabilities.

Focus on learning and having fun! 😊

\

How to play ♘

This challenge is thought for users who are very familiar with Solidity and do not want to use additional languages. The following setup tutorial will guide you through the installation of Foundry and its setup.

\

Clone this repository

Run the command below to clone this repository into your local machine

git clone https://github.com/secureum/AMAZEX-DSS-PARIS.git
cd AMAZEX-DSS-PARIS

\

Install Foundry (if you don't have Foundry already installed)

Run the command below to get foundryup the Foundry toolchain installer:

curl -L https://foundry.paradigm.xyz | bash

Then, in a new terminal session (or after reloading your PATH environmental variable), run foundryup to get the latest forge and cast binaries:

foundryup

And finally, install the repository's dependencies by entering it and running:

forge install

Note that you might have to restart your terminal for the forge command to become available.

\

Solving a challenge

Challenge contracts are located in the subdirectories of the src/ directory. Do not modify them, as it may lead to unexpected behaviors within the challenges.

To solve a challenge, you must open the corresponding test/ChallengeX.t.sol (where X is a number) and add your exploit code in the signalized areas within said file.

Then, to check if the challenge has been solved, execute the following command

forge test --match-path test/ChallengeX.t.sol

If the solution criteria have been reached, it shall display the following message

Running 1 test for test/ChallengeX.t.sol:ChallengeXTest
[PASS] testChallenge() (gas: XXXX)
Test result: ok. 1 passed; 0 failed; finished in XXXms

Alternatively, to check if all challenges have been solved, execute the following command:

bash isSolved.sh

which will return the test results for all challenges in order.

If one wishes to have a more detailed prompt (i.e. to see the logged messages), it is necessary to increase the verbosity with -vvvv, for example:

forge test --match-path test/ChallengeX.t.sol -vvvv

Challenges ðŸŽŪ


Slides


CTF Writeup 🗒ïļðŸ—’ïļðŸ—’ïļ

Writeups will be available after the event

Hosted by as part of

Built with love by , , , and Special thanks to , , and for reviewing, commenting and helping during the elaboration and design of this CTF Workshop

Option 2: Online through Gitpod, using Foundry

At this point you should be all set. If not, check .

Find the slides of the event's presentation .

ðŸšĐ
Defi Security Summit
Defi Security 101
eugenioclrc
luksgrin
PeterisPrieditis
RomiRand
misirov
patrickd
StErMi
tinchoabbate
Rajeev
Foundry's installation troubleshooting
Challenge 1: Operation magic redemption 🊄ðŸ”Ū
Challenge 2: Mission Modern WETH: Rescue the Ether 🧗🧭
Challenge 3: LendEx pool hack ðŸĪšðŸƒ
Challenge 4: Operation Rescue POSI Token! 💞🔓
Challenge 5: Balloon Vault 🎈🎈
Challenge 6: Safe Yield? ðŸĶ📈
Challenge 7: Crystal DAO 💎💎
Challenge 8: Liquidatoooor ðŸ”ąðŸ”ą
here
SOLUTIONS
Instructions ðŸ•đïļ
Flavors
How to play ♘
Challenges ðŸŽŪ
CTF Writeup 🗒ïļðŸ—’ïļðŸ—’ïļ
A-MAZE-X-Stanford-LOGO