Git Product home page Git Product logo

ffpuppet's Introduction

FFPuppet

Build Status Build status Coverage Status IRC

FFPuppet is a python module that automates browser process related tasks to aid in fuzzing. Happy bug hunting!

Installation

To install after cloning the repository
pip install --user -e <ffpuppet_repository>
Installing python modules
pip install -r requirements.txt
Xvfb on Linux

On Linux xvfb can be used in order to run headless (this is not the same as Firefox's -headless mode).

To install xvfb on Ubuntu run:

apt-get install xvfb
Installing minidump_stackwalk

minidump_stackwalk is used to extract a crash report when the browser crashes without a debugger (GDB/Valgrind) or instrumentation (ASan). If desired, minidump_stackwalk should be installed in the users path after obtaining it from tooltool. Choose the appropriate platform from tooltool-manifests in the mozilla-central tree, then open or download releng.manifest. Either use tooltool.py fetch -m releng.manifest or copy the digest from the file and download it from https://api.pub.build.mozilla.org/tooltool/sha512/<digest>. In either case, the file should be renamed to minidump_stackwalk and marked executable (or minidump_stackwalk.exe on Windows).

fuzzPriv Extension

This provides access to operations that are helpful when fuzzing such as calling the garbage collector. At the moment there are two versions:

The legacy version (the fuzzPriv you know and love) can only be used with Nighty, mozilla-central builds and old versions of Firefox.

The WebExtension version can be used with any build that supports WebExtensions but certain features are only available when combined with fuzzing builds.

Browser Builds

If you are looking for builds to use with FFPuppet here are a few options.

Taskcluster

Taskcluster has a collection of many different build types for multiple platforms and branches. An index of the latest mozilla-central builds can be found here. Or you can use fuzzfetch which is very helpful in automation.

Build your own

If you would like to compile your own build instructions can be found here

Usage

Once installed FFPuppet can be run using the following command:

python -m ffpuppet
$ python -m ffpuppet -h
usage: __main__.py [-h] [-a ABORT_TOKEN] [-d] [-e EXTENSION] [-g]
                   [--ignore-crashes] [-l LOG] [--log-limit LOG_LIMIT]
                   [-m MEMORY] [-p PREFS] [-P PROFILE] [--safe-mode]
                   [-t TIMEOUT] [-u URL] [--valgrind] [-v] [--xvfb]
                   binary

Firefox launcher/wrapper

positional arguments:
  binary                Firefox binary to execute

optional arguments:
  -h, --help            show this help message and exit
  -a ABORT_TOKEN, --abort-token ABORT_TOKEN
                        Scan the log for the given value and close browser on
                        detection. For example '-a ###!!! ASSERTION:' would be
                        used to detect soft assertions.
  -d, --dump            Display browser logs on process exit
  -e EXTENSION, --extension EXTENSION
                        Use the fuzzPriv extension. Specify the path to the
                        xpi or the directory containing the unpacked extension.
  -g, --gdb             Use GDB (Linux only)
  --ignore-crashes      Do not close the browser when a crash is detected
                        (e10s only)
  -l LOG, --log LOG     Location to save log files
  --log-limit LOG_LIMIT
                        Log file size limit in MBs (default: no limit)
  -m MEMORY, --memory MEMORY
                        Process memory limit in MBs (default: no limit)
  -p PREFS, --prefs PREFS
                        Custom prefs.js file to use (default: profile default)
  -P PROFILE, --profile PROFILE
                        Profile to use. This is non-destructive. A copy of the
                        target profile will be used. (default: new temporary
                        profile is created)
  --safe-mode           Launch browser in 'safe-mode'. WARNING: Launching in
                        safe mode blocks with a dialog that must be dismissed
                        manually.
  -t TIMEOUT, --timeout TIMEOUT
                        Number of seconds to wait for the browser to become
                        responsive after launching. (default: 300)
  -u URL, --url URL     Server URL or local file to load.
  --valgrind            Use Valgrind (Linux only)
  -v, --verbose         Output includes debug prints
  --xvfb                Use Xvfb (Linux only)
Replaying a test case
python -m ffpuppet <firefox_binary> -p <custom_prefs.js> -d -u <testcase>

This will open the provided test case file in Firefox using the provided prefs.js file and any log data (stderr, stdout, ASan logs... etc) will be dumped to the console when the browser process terminates.

ffpuppet's People

Contributors

tysmith avatar jschwartzentruber avatar choller avatar pyoor avatar revskills avatar

Watchers

James Cloos avatar  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.