Giter Site home page Giter Site logo

nfuzz's Introduction

Website nfuzz-pypi   Made with Python   License: MIT (Code) nfuzz

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 with MutationFuzzer

from nfuzz.MutationFuzzer import MutationFuzzer
if __name__ == "__main__":
    print('\n### Generate random characters with 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__":
print('\n### Generate random characters with GrammarFuzzer')
    f = GrammarFuzzer(URL_GRAMMAR, log=False, min_nonterminals=10)
    for i in range(10):
        res = f.fuzz()
        print(res)

nfuzz's People

Contributors

alexqiaodan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.