npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fuzz-me-maybe

v1.0.2

Published

Easily create controllable, radamsa-backed fuzzers using third-party packages and environment variables.

Downloads

6

Readme

fuzz-me-maybe

Build Status Known Vulnerabilities Dependencies

An environment-variable-based fuzzing harness for Node applications

fuzz-me-maybe is a small harness that makes instrumentation of various network protocols easily. It is a small module that offers some command-line input directly into a radamsa+sinkdweller fuzzing system.

Using fuzz-me-maybe, you can grab an off-the-shelf module (e.g. rhea, mqtt-packet) and instrument it with this wrapper script, which will allow you to interact with the fuzzer from environment variables. This allows you to make fuzzers out of any off-the-shelf node module by hooking/instrumenting it directly, versus needing to rewrite potentially complex upstream logic.

Basic Usage

Basic usage (no custom parameters) is as follows. Take code such as:

function outputToStream(stream, data) {
    stream.write(data);
}

and change it to:

const FuzzMeMaybe = require('fuzz-me-maybe');
let fuzzer = new FuzzMeMaybe();

function outputToStream(stream, data) {
    stream.write(fuzzer.maybe(data));
}

Default environment variable control

fuzz-me-maybe turns off the fuzzer by default. This is such that it will allow tests and other systems to run unless there are explicit flags turning on the fuzzer, and lets you leave fuzzing infrastructure in place. To enable your fuzzer, you will need to set $ENVPREFIX_ENABLED=1 on your command line (by default, this environment prefix is FUZZER_, so you would set FUZZER_ENABLED=1 to turn on the fuzzer.)

If you want to show your I/O (for example, to save testcases or a log of fuzz output), you can show it by setting $ENVPREFIX_SHOW_IO=1 on your command line to print to stdout, and $ENVPREFIX_SHOW_IO=1 $ENVPREFIX_SHOW_IO_STDERR=1, where $ENVPREFIX is either FUZZER (the default) or what you set with the registerEnvironmentPrefix method.

Custom environment flags

fuzz-me-maybe allows for boolean, counted, and string matching flags. To get more functionality, tag your fuzzer calls for enable/disable:

const FuzzMeMaybe = require('fuzz-me-maybe');
let fuzzer = new FuzzMeMaybe();
fuzzer.registerEnvironmentPrefix('MYFUZZER_');
fuzzer.registerFlag('output_to_stream', 'boolean', true);

function outputToStream(stream, data) {
    stream.write(fuzzer.maybe(data, 'output_to_stream'));
}

Now, all calls with the tag 'output_to_stream' can be turned off on the command line by setting MYFUZZER_OUTPUT_TO_STREAM=0. In this case, the maybe method will no longer fire.

Integer (count) skips

You may also build integer skips:

const FuzzMeMaybe = require('fuzz-me-maybe');
let fuzzer = new FuzzMeMaybe();
fuzzer.registerEnvironmentPrefix('MYFUZZER_');
fuzzer.registerFlag('output_to_stream', 'skip_first', 10);

function outputToStream(stream, data) {
    stream.write(fuzzer.maybe(data, 'output_to_stream'));
}

This skip_first flag will now skip the first 10 calls of the output_to_stream flag. To change this, you can set the environment variable MYFUZZER_OUTPUT_TO_STREAM_SKIP_FIRST=20, and then the first 20 calls will be skipped instead.

String skips

Similar to integer skips, you can also register a flag to not allow for specific strings:

const FuzzMeMaybe = require('fuzz-me-maybe');
let fuzzer = new FuzzMeMaybe();
fuzzer.registerEnvironmentPrefix('MYFUZZER_');
fuzzer.registerFlag('output_to_stream', 'skip_string', 'ACCESS_KEY');

function outputToStream(stream, data) {
    stream.write(fuzzer.maybe(data, 'output_to_stream'));
}

In this case, if data contains the string ACCESS_KEY, it will not fuzz data. This can be changed on the command line with the environment variable MYFUZZER_OUTPUT_TO_STREAM_SKIP_STRING="POST", for example, to change the skipped string to POST instead.

License

MIT License.