Getting Started with Phink
Installation
System Requirements
To successfully install and run Phink, ensure your system meets the following requirements:
-
Operating System:
- Linux: Recommended for compatibility.
- macOS: Not recommended as it doesn’t support some AFL++ plugins.
- Windows: Untested.
-
Rust:
- Version: Rust nightly
- Current Compatibility:
cargo 1.83.0-nightly (ad074abe3 2024-10-04)
Installation Guide
You can install Phink by building it from the source or by using Docker. Choose the method that best suits your setup.
Building from Source
-
Clone the Repository
git clone https://github.com/srlabs/phink && cd phink/
You can also use:
cargo +nightly install --git https://github.com/srlabs/phink
-
Install Dependencies
cargo install --force ziggy cargo-afl honggfuzz grcov cargo-contract --locked
-
Configure AFL++
cargo afl config --build --plugins --verbose --force sudo cargo-afl afl system-config
-
Build Phink
cargo build --release
-
Run Phink
./target/release/phink --help phink --help # if installed via `cargo install`
Using Docker
- Build the Docker Image
docker build -t phink .
For detailed Docker instructions, refer to README.Docker.md.
Basic Workflow
-
Instrument the Contract
- Use Phink to instrument your ink! smart contract for fuzzing.
-
Configure Fuzzing Parameters
- Edit the
phink.toml
file to set paths, deployment settings, and fuzzing options according to your project needs.
- Edit the
-
Run Fuzzing
- Execute fuzzing with your configured settings to identify vulnerabilities early in the development cycle.