|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# PostgreSQL Corpus Example for Fuzzilli |
| 4 | +# This script demonstrates how to use the new PostgreSQL corpus feature |
| 5 | + |
| 6 | +echo "=== Fuzzilli PostgreSQL Corpus Example ===" |
| 7 | +echo "" |
| 8 | + |
| 9 | +echo "1. Basic PostgreSQL corpus usage:" |
| 10 | +echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://localhost:5432/fuzzilli --profile=v8 /path/to/d8" |
| 11 | +echo "" |
| 12 | + |
| 13 | +echo "2. With custom sync interval and validation:" |
| 14 | +echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://user:pass@host:5432/db --sync-interval=30 --validate-before-cache --execution-history-size=20 --profile=v8 /path/to/d8" |
| 15 | +echo "" |
| 16 | + |
| 17 | +echo "3. Multiple fuzzer instances sharing the same PostgreSQL database:" |
| 18 | +echo "# Fuzzer 1:" |
| 19 | +echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://localhost:5432/fuzzilli --profile=v8 /path/to/d8" |
| 20 | +echo "" |
| 21 | +echo "# Fuzzer 2 (in another terminal):" |
| 22 | +echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://localhost:5432/fuzzilli --profile=v8 /path/to/d8" |
| 23 | +echo "" |
| 24 | + |
| 25 | +echo "4. Available PostgreSQL corpus options:" |
| 26 | +echo " --corpus=postgresql : Use PostgreSQL corpus" |
| 27 | +echo " --postgres-url=url : PostgreSQL connection string (required)" |
| 28 | +echo " --sync-interval=n : Sync interval in seconds (default: 10)" |
| 29 | +echo " --validate-before-cache : Enable program validation (default: true)" |
| 30 | +echo " --execution-history-size=n : Recent executions to keep in memory (default: 10)" |
| 31 | +echo "" |
| 32 | + |
| 33 | +echo "5. PostgreSQL connection string format:" |
| 34 | +echo " postgresql://username:password@hostname:port/database" |
| 35 | +echo " Example: postgresql://fuzzilli:password@localhost:5432/fuzzilli" |
| 36 | +echo "" |
| 37 | + |
| 38 | +echo "6. Features of PostgreSQL corpus:" |
| 39 | +echo " - In-memory caching for fast access" |
| 40 | +echo " - PostgreSQL backend for persistence and sharing" |
| 41 | +echo " - Execution metadata tracking (coverage, execution count, etc.)" |
| 42 | +echo " - Periodic synchronization with central database" |
| 43 | +echo " - Thread-safe operations" |
| 44 | +echo " - Distributed fuzzing support" |
| 45 | +echo "" |
| 46 | + |
| 47 | +echo "7. Help and validation:" |
| 48 | +echo "swift run FuzzilliCli --help # Show all options" |
| 49 | +echo "swift run FuzzilliCli --corpus=postgresql # Shows validation error" |
| 50 | +echo "" |
| 51 | + |
| 52 | +echo "=== Example Complete ===" |
0 commit comments