How htrgouvea/fuzzpm works
Project type and purpose
• This is an open-source, command-line differential fuzzing tool (“FuzzPM”) for Perl modules.
• It automates large-scale security testing by feeding the same inputs (from seed files) into multiple Perl “targets,” comparing their outputs, and flagging divergences as potential bugs or vulnerabilities.
File structure
• Top-level script: fuzzpm.pl (the CLI entry point).
• lib/FuzzPM/Component: core engine broken into modules – CLI, Case, Mutator.
• lib/FuzzPM/Network/Runner(Worker): modules to distribute fuzzing work across processes or machines.
• cases/*.yml: YAML definitions linking seed files and targets.
• seeds/*.txt: raw input data.
• targets/<category>/*.pm: Perl modules under test (each implements a “new($payload)” constructor).
• Dockerfile, GitHub workflows, tests/ – CI, containerization, and unit tests.
README for insights
• Confirms three main pieces: Targets, Input Seeds, Test Cases.
• Describes spawning processes (Runner/Worker) to parallelize.
Main components & interactions
a) Components
• CLI Module (lib/FuzzPM/Component/CLI.pm)
• Case Loader (lib/FuzzPM/Component/Case.pm)
• Seed Manager (reads seeds/*.txt)
• Target Adapters (targets/*/*.pm)
• Mutator Engine (lib/FuzzPM/Component/Mutator.pm)
• Network Runner (Coordinator) (lib/FuzzPM/Network/Runner.pm)
• Worker Processes (lib/FuzzPM/Network/Runner/Worker.pm)
• Comparison Engine (built into Runner or Mutator)
• Output Reporter (CLI output, logs, CI badges)
b) Relationships & data flow
1. User invokes fuzzpm.pl with a --case YAML.
2. CLI Module parses arguments → loads Case definition.
3. Case Loader reads the YAML, identifies seed files & target names & folder.
4. Seed Manager loads all payloads from seeds/*.txt.
5. Target Adapters are dynamically loaded for each module under targets/<case>/.
6. Network Runner (master) is started:
• Spawns N Worker processes.
7. Each Worker:
i. Pulls a payload from the Seed Manager (or Mutator if enabled).
ii. Sends the payload to each Target Adapter in sequence.
iii. Collects outputs (or errors).
iv. Returns results to the Runner.
8. Runner’s Comparison Engine compares outputs across targets.
• If divergence → marks as failure/vulnerability.
9. Reporter aggregates successes/failures, prints to STDOUT, logs to files, and exits with code.
c) Architectural patterns & design principles
• Modular design: clear separation of CLI, parsing, mutating, networking, and comparison.
• Plugin-style “targets”: new modules can be dropped into targets/ without changing core.
• Master-worker pattern for parallel or distributed fuzzing.
• YAML-driven configuration for high extensibility.
d) Key technologies & libraries
• Perl 5 modules, Try::Tiny for exception handling in Targets.
• YAML::Tiny (or similar) for parsing .yml case files.
• IO::Socket or IPC module for Runner/Worker communication (Network runner).
• Docker for containerized runs.
• GitHub Actions for CI (linting, testing, security scans).
Don’t overthink—capture every logical component
• File system (cases/, seeds/, targets/) as persistent resources.
• Where new modules plug in (extensibility points).