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 and IT environment. Let’s jump right into it!
Building from source
Follow these 5 easy steps:
-
Clone the Repository
git clone https://github.com/srlabs/phink && cd phink/
You can also run the following command:
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 To build the Phink Docker image, run the following command in your terminal:
docker build -t phink .
For detailed Phink Docker installation instructions, refer to README.Docker.md.
Basic workflow
Follow these three high-level steps:
-
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 your fuzzing campaign
- Execute fuzzing with your configured settings to identify vulnerabilities early in the development cycle