Firefly Black-Box Fuzzer

repository·main·Indexed 19 days ago

https://github.com/brum3ns/firefly

An advanced black-box fuzzer designed for asset discovery and detecting complex target behaviors. Firefly utilizes high-concurrency goroutines, a two-phase execution process (Verification and Attack), and features such as payload tampering, encoding, request verification, and regex-based payload replacement to identify vulnerabilities and target patterns.

Tokens
2K
Snippets
12
Records
12
Agent score
66%

What's inside firefly

  1. Use Request Verifier to improve quality

    main

    The Request Verifier is a critical feature that helps Firefly understand the core behavior of the target. By verifying requests, Firefly can avoid junk results and focus on high-quality findings. Note that increasing verification depth may impact performance depending on your hardware.

    Use the -e flag to enable verification.

    firefly -u 'http://example.com/?query=FUZZ' -e
  2. Use Custom Wordlists

    main

    You can provide your own wordlists for fuzzing.

    Single Wordlist

    Specify a file and its attack type using the format file:type.

    Directory of Wordlists

    Point to a folder to extract all wordlists. Firefly expects wordlists to follow the naming convention <type>_wordlist.txt (e.g., fuzz_wordlist.txt, time_wordlist.txt).

    # Single wordlist with attack type
    firefly -u 'http://example.com/?query=FUZZ' -w wordlist.txt:fuzz
    
    # Extract all wordlists from a folder
    firefly -u 'http://example.com/?query=FUZZ' -w wl/
  3. Advanced Request Input Methods

    main

    Firefly supports several ways to define the target request:

    Methods and Protocols

    Specify multiple HTTP methods and protocols using comma-separated lists.

    • -m: HTTP methods (e.g., GET,POST,PUT)
    • -p: Protocols (e.g., https,http,ws)

    Pipeline Input

    You can pipe URLs directly into Firefly via stdin.

    HTTP Raw Requests

    Use the -r flag to provide a raw HTTP request. Firefly will automatically detect GET and/or POST parameters to fuzz. You can use -au replace to specify how to handle parameter replacement.

    Timeout

    Set a custom timeout for requests using --timeout (in milliseconds).

    # Using methods and protocols
    firefly -u 'http://example.com/?query=FUZZ' -m GET,POST,PUT -p https,http,ws
    
    # Using pipeline
    echo 'http://example.com/?query=FUZZ' | firefly 
    
    # Using raw HTTP request
    firefly -r 'GET /?query=FUZZ HTTP/1.1\nHost: example.com\nUser-Agent: FireFly'
    
    # Raw request with parameter replacement
    firefly -r 'POST /?A=1 HTTP/1.1\nHost: example.com\nUser-Agent: Firefly\nX-Host: FUZZ\n\nB=2&C=3' -au replace
  4. Customize Payloads with Tampering and Encoding

    main

    Firefly allows you to manipulate payloads before they are sent to the target.

    Inspecting Payloads

    • -show-payload: Displays the format of all payloads and exits.
    • -list-tamper: Lists all available tamper types.

    Tampering and Encoding

    Use the -e flag to apply transformations. You can provide multiple transformations separated by commas.

    • Tamper: Apply a specific tamper type (e.g., s2c).
    • Encode: Apply encoding (e.g., hex, url).

    Regex Payload Replacement

    Use -pr to perform regex-based replacement on payloads. The syntax uses => (with spaces) to indicate the replacement string.

    Example: Replacing (1=1) with (13=(37-24)) in payloads.

    # List available tampers
    firefly -list-tamper
    
    # Apply a tamper (e.g., s2c)
    firefly -u 'http://example.com/?query=FUZZ' -e s2c
    
    # Apply multiple encodings (hex then URL)
    firefly -u 'http://example.com/?query=FUZZ' -e hex,url
    
    # Regex payload replacement
    firefly -u 'http://example.com/?query=FUZZ' -pr '\([0-9]+=[0-9]+\) => (13=(37-24))'
  5. Run the Firefly fuzzer

    main

    Firefly is a fuzzer that operates in two distinct phases: a verification phase and an attack phase.

    1. Verification Phase: The tool first runs a VerifyRunner to detect normal behavior and patterns within the target. This phase generates KnowledgeStorage.
    2. Attack Phase: The tool then runs an AttackRunner (black-box enumeration) using the knowledge gathered during the verification phase to perform the actual fuzzing.

    Upon completion, the tool outputs a summary including total requests/responses, scanned items, detected behaviors, filtered requests, errors, and total execution time.

    # Note: As this is the main entrypoint, usage typically involves running the compiled binary.
    # The tool automatically handles setup, configuration, and the two-stage execution process.
    ./firefly
  6. Run the Firefly test server using Docker Compose

    main

    You can deploy a local test server environment for Firefly using the provided docker-compose.yml. This service runs a php-apache container which builds from the local Dockerfile and exposes the Firefly service on port 1337 of your host machine.

    docker-compose up
  7. Configure Performance and Concurrency

    main

    Adjust how Firefly utilizes system resources:

    • -t: Set the number of threads/concurrency.
    • -dl: Set a time delay in milliseconds (ms) for each concurrency level.
    # Use 35 threads
    firefly -u 'http://example.com/?query=FUZZ' -t 35
    
    # Use 35 threads with a 2000ms delay
    firefly -u 'http://example.com/?query=FUZZ' -t 35 -dl 2000
  8. Configure Output Formats

    main

    Specify how results are saved using the -o flag.

    • Plaintext: Standard output format. Useful for piping to other tools.
    • JSON (-oJ): Strongly recommended for structured data. Allows for easy navigation and comparison using tools like jq.
    # Plaintext output
    firefly -u 'http://example.com/?query=FUZZ' -o file.txt
    
    # JSON output (recommended)
    firefly -u 'http://example.com/?query=FUZZ' -oJ file.json
  9. Filter Request Responses

    main

    Use filters to include or exclude results based on specific criteria to reduce noise.

    Filter Out (Ignore)

    Use -fc to filter by status code and -fl to filter by line count to ignore specific responses.

    Match (Include)

    Use -mr to match a regex pattern in the response and -mc to match a specific status code to include only those responses.

    # Ignore status code 302 and line count 0
    firefly -u 'http://example.com/?query=FUZZ' -fc 302 -fl 0
    
    # Include only responses matching a regex and status code 200
    firefly -u 'http://example.com/?query=FUZZ' -mr '[Ee]rror (at|on) line \d' -mc 200