All Projects → mseclab → Pyjfuzz

mseclab / Pyjfuzz

Licence: mit
PyJFuzz - Python JSON Fuzzer

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyjfuzz

Element Api
Create a JSON API/Feed for your elements in Craft.
Stars: ✭ 493 (+44.15%)
Mutual labels:  json-api, json, json-serialization
fuzza
Customizable TCP fuzzing tool to test for remote buffer overflows.
Stars: ✭ 29 (-91.52%)
Mutual labels:  fuzzing, fuzzer
doona
Network based protocol fuzzer
Stars: ✭ 64 (-81.29%)
Mutual labels:  fuzzing, fuzzer
Syzkaller
syzkaller is an unsupervised coverage-guided kernel fuzzer
Stars: ✭ 3,841 (+1023.1%)
Mutual labels:  fuzzing, fuzzer
Tslog
📝 tslog - Expressive TypeScript Logger for Node.js.
Stars: ✭ 321 (-6.14%)
Mutual labels:  json-api, json
afl-pin
run AFL with pintool
Stars: ✭ 64 (-81.29%)
Mutual labels:  fuzzing, fuzzer
Safrs
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI
Stars: ✭ 255 (-25.44%)
Mutual labels:  json-api, json
afl-dynamorio
run AFL with dynamorio
Stars: ✭ 32 (-90.64%)
Mutual labels:  fuzzing, fuzzer
Spine
A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
Stars: ✭ 267 (-21.93%)
Mutual labels:  json-api, json
Mojojson
A simple and fast JSON parser.
Stars: ✭ 271 (-20.76%)
Mutual labels:  json-api, json
Json Schema Validator
A fast Java JSON schema validator that supports draft V4, V6, V7 and V2019-09
Stars: ✭ 292 (-14.62%)
Mutual labels:  json-schema, json
format-to-json
An algorithm that can format a string to json-like template. 字符串JSON格式化的算法。
Stars: ✭ 30 (-91.23%)
Mutual labels:  json-api, json-schema
unicorn-fuzzer
expansion of afl-unicorn using c++
Stars: ✭ 25 (-92.69%)
Mutual labels:  fuzzing, fuzzer
nozaki
HTTP fuzzer engine security oriented
Stars: ✭ 37 (-89.18%)
Mutual labels:  fuzzing, fuzzer
IEC61850-MMS-Fuzzer
Mutation Based Fuzzer for IEC61850 Server IED'S
Stars: ✭ 20 (-94.15%)
Mutual labels:  fuzzing, fuzzer
fuzzuf
Fuzzing Unification Framework
Stars: ✭ 263 (-23.1%)
Mutual labels:  fuzzing, fuzzer
Fuzzdicts
Web Pentesting Fuzz 字典,一个就够了。
Stars: ✭ 4,013 (+1073.39%)
Mutual labels:  fuzzing, fuzzer
RTSPhuzz
RTSPhuzz - An RTSP Fuzzer written using the Boofuzz framework
Stars: ✭ 33 (-90.35%)
Mutual labels:  fuzzing, fuzzer
HITB2020 FSFUZZER
My Material for the HITB presentation
Stars: ✭ 33 (-90.35%)
Mutual labels:  fuzzing, fuzzer
Json Schema To Ts
Infer TS types from JSON schemas 📝
Stars: ✭ 261 (-23.68%)
Mutual labels:  json-schema, json

LOGO

PyJFuzz is a small, extensible and ready-to-use framework used to fuzz JSON inputs, such as mobile endpoint REST API, JSON implementation, Browsers, cli executable and much more.

Version 1.1.0
Homepage http://www.mseclab.com/
Github https://github.com/mseclab/PyJFuzz
Author Daniele Linguaglossa (@dzonerzy)
License MIT - (see LICENSE file)

Installation

Dependencies

In order to work PyJFuzz need some dependency, bottle,netifaces,GitPython and gramfuzz, you can install them from automatic setup.py installation.

Installation

You can install PyJFuzz with the following command

git clone https://github.com/mseclab/PyJFuzz.git && cd PyJFuzz && sudo python setup.py install

Documentation and Examples

CLI tool

Once installed PyJFuzz will create both a python library and a command-line utility called pjf (screenshot below)

MENU

PJF

Library

PyJFuzz could also work as a library, you can import in your project like following

from pyjfuzz.lib import *

Classes

The available object/class are the following:

  • PJFServer - User to start and stop built-in HTTP and HTTPS servers
  • PJFProcessMonitor - Used to monitor process crash, it will automatically restart proccess each time it crash
  • PJFTestcaseServer - The testcase server is used in conjunction with PJFProcessMonitor, whenever a process crash the testcase server will register and store the JSON which cause the crash
  • PJFFactory - It's the main object used to do the real fuzz of JSON objects
  • PJFConfiguration - It's the configuration file for each of the available objects
  • PJFExternalFuzzer - Used by PJFactory is a auxiliary class which provide an interface to other command line fuzzer such as radamsa
  • PJFMutation - Used by PJFFactory provide all the mutation used during fuzzing session
  • PJFExecutor - Provides an interface to interact with external process

CLASSES

Examples

Below some trivial example of how-to implement PyJFuzz powered program

simple_fuzzer.py

from argparse import Namespace
from pyjfuzz.lib import *

config = PJFConfiguration(Namespace(json={"test": ["1", 2, True]}, nologo=True, level=6))
fuzzer = PJFFactory(config)
while True:
    print fuzzer.fuzzed

custom_techniques.py

from argparse import Namespace
from pyjfuzz.lib import *

# Techniques may be defined by group , or by technique number
# groups are CHTPRSX , to understand what they are , please run pyjfuzz with -h switch or look at the command line screenshot
# This below will initalizate a config object which use only the P group attacks where P stay for Path Traversal
config = PJFConfiguration(Namespace(json={"test": ["1", 2, True]}, nologo=True, level=6, techniques="P"))
# once a config object is defined you can access to config.techniques to view the selected techniques for your group
print("Techniques IDs: {0}".format(str(config.techniques)))
# you can eventually modify them!
config.techniques = [2]
# This way only attack number 2 (LFI Attack) will be performed!
fuzzer = PJFFactory(config)
while True:
    print fuzzer.fuzzed

simple_server.py

from argparse import Namespace
from pyjfuzz.lib import *

config = PJFConfiguration(Namespace(json={"test": ["1", 2, True]}, nologo=True, level=6, debug=True, indent=True))
PJFServer(config).run()

Sometimes you may need to modify standard non customizable settings such as HTTPS or HTTP server port, this can be done in the following way

from argparse import Namespace
from pyjfuzz.lib import *

config = PJFConfiguration(Namespace(json={"test": ["1", 2, True]}, nologo=True, level=6, indent=True))
print config.ports["servers"]["HTTP_PORT"]   # 8080
print config.ports["servers"]["HTTPS_PORT"]  # 8443
print config.ports["servers"]["TCASE_PORT"]  # 8888
config.ports["servers"]["HTTPS_PORT"] = 443  # Change HTTPS port to 443

Remember: When changing default ports, you should always handle exception due to needed privileges!

Below a comprehensive list of all available settings / customization of PJFConfiguration object:

Configuration table

Name Type Description
json dict JSON object to fuzz
json_file str Path to a JSON file
parameters list<str> List of parameters to fuzz (taken from JSON object)
techniques str<int> String of enable attacks, used to generate fuzzed JSON, such as XSS, LFI etc. ie "CHPTRSX" (Look techniques table)
level int Fuzzing level in the range 0-6
utf8 bool If true switch from unicode encode to pure byte representation
indent bool Set whenever to indent the result object
url_encode bool Set whenever to URLEncode the result object
strong_fuzz bool Set whenever to use strong fuzzing (strong fuzzing will not maintain JSON structure, usefull for parser fuzzing)
debug bool Set whenever to enable debug prints
exclude bool Exclude from fuzzing parameters selected by parameters option
notify bool Set whenever to notify process monitor when a crash occurs only used with PJFServer
html str Path to an HTML directory to serve within PJFServer
ext_fuzz bool Set whenever to use binary from "command" as an externale fuzzer
cmd_fuzz bool Set whenever to use binary from "command" as fuzzer target
content_type str Set the content type result of PJFServer (default application/json)
command list<str> Command to execute each paramester is a list element, you could use shlex.split from python

Techniques table

Index Description
0 XSS injection (Polyglot)
1 SQL injection (Polyglot)
2 LFI attack
3 SQL injection polyglot (2)
4 XSS injection (Polyglot) (2)
5 RCE injection (Polyglot)
6 LFI attack (2)
7 Data URI attack
8 LFI and HREF attack
9 Header injection
10 RCE injection (Polyglot) (2)
11 Generic templace injection
12 Flask template injection
13 Random character attack

Screenshots

Below some screenshot just to let you know what you should expect from PyJFuzz

CLI

CLI2

CLI3

Built-in tool

PyJFuzz is shipped with a built-in tool called PyJFuzz Web Fuzzer, this tool will provide an automatic fuzzing console via HTTP and HTTPS server, it can be used to easly fuzz almost any web browser even when you can't control the process state!

There are two switch used to launch this tool (--browser-auto and --fuzz-web), the first one perform automatic browser restart when a crash occur, the other one try to catch when a browser doesn't make requests anymore. Both of them always save the testcases, below some screenshots.

FUZZ

FUZZ2

BROWSERAUTO

BROWSERAUTO2 Issue

Please send any issue here via GitHub I'll provide a fix as soon as possible.

Result

Below a list of know issue found by PyJFuzz, the list will be updated weekly

End

Thanks for using PyJFuzz!

Happy Fuzzing from mseclab

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].