Skip to main content

A useful tool for fuzz job.

Project description

NFuzz

NFuzz has been created to conduct fuzzy testing and it is based on a simple concept: it generates the FUZZ keywords by an excellent fuzz grammar method that is created by this job. And it also provides a simple WebFuzzer for daily use.

Installation

To install NFuzz, simply use pip: pip install nfuzz

Usage

A simple webFuzzer example base on Baidu homepage:

from nfuzz.WebFuzzer import WebFormFuzzer
from nfuzz.WebFuzzer import WebRunner
import requests
if __name__ == "__main__":
    print('\n### A WebFormFuzzer')
    httpd_url = "https://www.baidu.com/"
    base_url = "https://www.baidu.com/"
    web_form_fuzzer = WebFormFuzzer(httpd_url)
    web_form_fuzzer.fuzz()
    web_form_runner = WebRunner(base_url)
    out = web_form_fuzzer.runs(web_form_runner, 100000)
    print(out)

Generate random characters

from nfuzz.Fuzzer import RandomFuzzer
if __name__ == "__main__":
    print('\n### Generate random characters')
    fuzzer = RandomFuzzer()
    print(fuzzer.fuzz())

Generate random characters

from nfuzz.Fuzzer import RandomFuzzer
if __name__ == "__main__":
    print('\n### Generate random characters')
    fuzzer = RandomFuzzer()
    print(fuzzer.fuzz())

Generate random characters with MutationFuzzer

from nfuzz.MutationFuzzer import MutationFuzzer
seed_input = "http://www.baidu.com/"
mutation_fuzzer = MutationFuzzer(seed=[seed_input])
for i in range(20):
    inp = mutation_fuzzer.fuzz()
    print(inp)

Generate random characters with GrammarFuzzer

from nfuzz.GrammarFuzzer import GrammarFuzzer
URL_GRAMMAR = {
    "<start>": ["<url>"],
    "<url>":
        ["<scheme>://<domain><path><query>"],
    "<scheme>":
        ["http", "https"],
    "<domain>":
        ["<host>", "<host>:<port>"],
    "<host>":  # Just a few
        ["www.baidu.com", "lofter.com"],
    "<port>":
        ["80", "8080", "<nat>"],
    "<nat>":
        ["<digit>", "<digit><digit>"],
    "<digit>":
        ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
    "<path>":  # Just a few
        ["", "/", "/<id>"],
    "<id>":  # Just a few
        ["abc", "def", "x<digit><digit>"],
    "<query>":
        ["", "?<params>"],
    "<params>":
        ["<param>", "<param>&<params>"],
    "<param>":  # Just a few
        ["<id>=<id>", "<id>=<nat>"],
}

if __name__ == "__main__":
    f = GrammarFuzzer(URL_GRAMMAR, log=False, min_nonterminals=10)
    for i in range(10):
        res = f.fuzz()
        print(res)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nfuzz-0.0.5.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

nfuzz-0.0.5-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file nfuzz-0.0.5.tar.gz.

File metadata

  • Download URL: nfuzz-0.0.5.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2

File hashes

Hashes for nfuzz-0.0.5.tar.gz
Algorithm Hash digest
SHA256 61612d5f43f847ce28e372ca6be1a2c4fdc27235ef6dc36748c84fb086b9fab3
MD5 66053d2e6463c1f5736d58ecf35572f9
BLAKE2b-256 8234fef0b139508561cd3ff783be07d5b99540fd2e89effd3d376900c905835a

See more details on using hashes here.

File details

Details for the file nfuzz-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: nfuzz-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.2

File hashes

Hashes for nfuzz-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1a93f0720a028c63c49db278e8287f5c8043dc4620d3360c304e61f898212b15
MD5 16a863b8eef10e40dcd9c9d7cd1fdfae
BLAKE2b-256 dedc6a75e0c47fd0cea03b749af26aeb18d377ecd897acaeac1289996dc19aea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page