Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let's get start to fuzzing firefox browser with grizzly and domato #89

Open
mylamour opened this issue Mar 23, 2022 · 0 comments
Open
Labels
Fuzzing 学习 learning 安全 security 工具 tools 总结 summary

Comments

@mylamour
Copy link
Owner

In previously blog( Let's get start to fuzzing firefox browser with grizzly ),we started browser fuzzing tutorial with grizzly. Today i will show you how to working with domato as the custom adapter.

  1. clone the code and cd to adapter folder
git clone https://github.com/MozillaSecurity/grizzly
cd grizzly/grizzly/adapter
mkdir do_ma_adapter
touch do_ma_adapter/setup.py
touch do_ma_adapter/domata.py

here is the content:

setup.py

from setuptools import setup

setup(
    name='do-ma',
    version='0.0.1',
    install_requires=[
        'grizzly-framework',
    ],
    entry_points={
       "grizzly_adapters": ["do-ma = domata:DoMaAdapter"]
    },
)

domata.py Don't forget to change the DOMATO_PATH

from pathlib import Path
from shutil import rmtree
from subprocess import check_output
from tempfile import mkdtemp
from grizzly.adapter import Adapter

DOMATO_PATH = "/mnt/f/fuzzing/fuzzer/domato/generator.py"

class DoMaAdapter(Adapter):
    
    NAME = "do-ma"

    def setup(self, input_path, server_map):
        self.enable_harness()
        self.fuzz["working"] = Path(mkdtemp(prefix="fuzz_gen_"))

        # command to run the fuzzer (generate test data)
        self.fuzz["cmd"] = [
            'python3',
            DOMATO_PATH,  # binary to call
            "--no_of_files", "1",
            "--output_dir", str(self.fuzz["working"])
        ]

    def generate(self, testcase, _):
        check_output(self.fuzz["cmd"])
        gen_file = next(self.fuzz["working"].iterdir())
        testcase.add_from_file(
            gen_file, file_name=testcase.landing_page, required=True, copy=False
        )

    def shutdown(self):
        if self.fuzz["working"].is_dir():
            rmtree(self.fuzz["working"], ignore_errors=True)

image

  1. install your adapter
python3 -m pip install -e do_ma_adapter
  1. run new adapter with grizzly
python3 -m grizzly ./browsers/firefox/firefox do-ma

image

@mylamour mylamour added 工具 tools 总结 summary 学习 learning 安全 security Fuzzing labels Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fuzzing 学习 learning 安全 security 工具 tools 总结 summary
Projects
None yet
Development

No branches or pull requests

1 participant