Package: boofuzz
boofuzz: Network Protocol Fuzzing for HumansBoofuzz is a fork of and the successor to the venerableSulleyfuzzing
framework. Besides numerous bug fixes, boofuzz aims for extensibility.
The goal: fuzz everything.Why?Sulley has been the preeminent open source fuzzer for some time, but has
fallen out of maintenance.FeaturesLike Sulley, boofuzz incorporates all the critical elements of a fuzzer:Easy and quick data generation.Instrumentation – AKA failure detection.Target reset after failure.Recording of test data.Unlike Sulley, boofuzz also features:Onlinedocumentation.Support for arbitrary communications mediums.Built-in support for serial fuzzing, ethernet- and IP-layer, UDP broadcast.Better recording of test data – consistent, thorough, clear.Test result CSV export.Extensibleinstrumentation/failure detection.Much easier install experience!Far fewer bugs.Sulley is affectionately named after the giant teal and purple creature
from Monsters Inc. due to his fuzziness. Boofuzz is likewise named after
the only creature known to have scared Sulley himself: Boo!Boo from Monsters IncInstallationpip install boofuzzBoofuzz installs as a Python library used to build fuzzer scripts. SeeINSTALL.rstfor advanced and detailed instructions.DocumentationDocumentation is available athttps://boofuzz.readthedocs.io/, including nifty quickstart guides.ContributionsPull requests are welcome, as boofuzz is actively maintained (at the
time of this writing ;)). SeeCONTRIBUTING.rst.CommunityFor questions that take the form of “How do I… with boofuzz?” or “I got
this error with boofuzz, why?”, consider posting your question on Stack
Overflow. Make sure to use thefuzzingtag.If you’ve found a bug, or have an idea/suggestion/request, file an issue
here on GitHub.For other questions, check out boofuzz ongitterorGoogle Groups.For updates, follow@b00fuzzon Twitter.Changelogv0.4.2FeaturesRemove six compatibility module.Remove Python 2 compatibility code.Remove specifying object inheritance in classes.Added Web UI listening on specific IP address.Added Python 3.11 compatibility.FixesSpecified encoding on file write rather than assuming default encoding.Changed type ofdefault_valuefrom string to bytes forFromFile.s_updateprimitive was out of date.The minimum supported Python version is now 3.8.Removed duplicates fromBitFieldprimitive.Fixed unwanted deprecation warning when usingSession.fuzz(name=name).Changed type ofdep_valueargument ofBlockto bytes and added type checks.Split sessions.py into multiple files.Using poetry as package build system.v0.4.1FeaturesAdded support for fuzzing NETCONF servers with theNETCONFConnectionclass.Add support and tests for Python 3.10.AddedSessionargdb_filenameto modify the location of the log database.FixesFixed check for when to enable the web app.Documented the possibility to disable the web app.Correctly initialize all children of a request which inherits fromFuzzableBlock.Added type checking for arguments ofBytesprimitive to prevent incorrect use.Fixed TypeError ins_binaryinitialization.Remove redundant unicode strings.v0.4.0FeaturesFuzzing CLI – Use main_helper() to use boofuzz’s generic fuzzing CLI with your script.Combinatorial fuzzing – now fuzzes multiple mutations at once by default.Test cases can now be specified and re-run by name.Implemented visual request-graph rendering functions for Session.Added to web UIL: runtime, exec speed, current test case name.Added simple custom checksum and example usage.AddedSimpleprimitive that uses only the specified values for fuzzing.AddedFloatprimitive with support for IEEE 754 encoding.Added an example for s_float/Float usage.FixesClarified documentation of custom checksum function forChecksumprimitive.String and RandomData primitives now use a local and independent instance ofrandom.The minimum supported Python version is now 3.6.Fixed two memory leaks in the fuzz logger.v0.3.0FeaturesMemory optimization: Efficient mutation generation and smarter string reuse – decrease memory consumption by orders of magnitude.Alignedblock: Aligns content length to multiple of certain number of bytes.Relative names: Name references forChecksum,Size, etc. now resolve absolute and relative names. Block and primitive
names no longer need to be globally unique within a message, they only need to be locally unique within a block.Passing data between messages: Callbacks now have aTestCaseContextobject to which one can save data to be used
later in the test case.TestCaseSessionReferencecan be passed as a default value in a protocol definition. The name
it references must have been saved by the time that message in the protocol is reached.Fuzzablerewrite: Simpler definitions for new fuzz primitives. Seestatic.pyfor an example of a very simple primitive.Protocol definition: Protocols can now be defined with an object oriented rather than static approach.Independent mutation and encoding steps: Will enable multiple mutations and code coverage feedback.Procmon: Additional debug steps. Partial backwards compatibility for old interface.ProcessMonitorLocalallows running procmon as part of fuzzer process.Network monitor: improved network interface discovery (Linux support).Added support for fuzzing Unix sockets with theUnixSocketConnectionclass.Added metadata to ProtocolSession to support callbacks –current_message,previous_message.All primitive arguments are now optional keyword arguments.FixesVarious web interface fixes.Various refactors and simplifications.Fewer duplicates fromGroupprimitives.Network monitor: fixed data_bytes calculation and PcapThread synchronization.Fixed a crash when using the network monitor.Session can now be “quiet” by passing an empty list of loggers.Process Monitor: fixed Thread.isAlive for Python 3.9 compatibility.Correctly truncate values of the string primitive when max_len or size is set.The string primitive will no longer generate duplicates when max_len or size is set.Greatly improved string to bytes conversion speed.v0.2.1FeaturesAdded simple TFTP fuzzer example.FixesFixed UDPSocketConnection data truncation when sending more data than the socket supports.Fixed execution of procmon stop_commands.Fixed TCP and SSL server connections.v0.2.0FeaturesRewrote and split the SocketConnection class into individual classes per socket type.SocketConnectionis now deprecated. Use the classes derived fromBaseSocketConnectioninstead.Added support for receiving on raw Layer 2 and Layer 3 connections.Layer 2 and Layer 3 connections may now use arbitrary payload / MTU sizes.Moved connection related modules into newconnectionssubmodule.Added the ability to repeat sending of packages within a given time or count.Added optional timeout and threshold to quit infinite connection retries.Reworked Monitors, consolidated interface. Breaking change: session no longer has netmon_options and procmon_options.SessionInfohas had attributes renamed; procmon_results and netmon_results are deprecated and now aliases for monitor_results and monitor_data respectively.NewBoofuzzFailureexception type allows callback methods to signal a failure that should halt the current test case.Addedcapture_outputoption to process monitor to capture target process stderr/stdout .Added post-start-target callbacks (called every time a target is started or restarted).Added method to gracefully stop PED-RPC Server.Added new boofuzz logo and favicon to docs and webinterface.AddedFileConnectionto dump messages to files.Removed deprecated session argumentsfuzz_data_logger,log_level,logfile,logfile_levelandlog().Removed deprecated loggerFuzzLoggerFile.crc32cis no longer a required package. Install manually if needed.FixesFixed size of s_size block when output is ascii.Fixed issue with tornado on Python 3.8 and Windows.Fixed various potential type errors.Renamedrequestsfolder torequest_definitionsbecause it shadowed the name of therequestspython module.Examples are up to date with current Boofuzz version.Modified timings on serial_connection unit tests to improve test reliability.Refactored old unit-tests.Fixed network monitor compatibility with Python 3.Minor console GUI optimizations.Fixed crash_threshold_element handling if blocks are used.Fixed many bugs in which a failure would not stop the test case evaluation.v0.1.6FeaturesNew primitives_byteswhich fuzzes an arbitrary length binary value (similiar tos_string).We are now usingBlackfor code style standardization.Compatibility for Python 3.8Added crc32c as checksum algorithm (Castagnoli).Added favicon for web interface.Pushed Tornado to 5.x and unpinned Flask.FixesTest cases were not being properly closed when using the check_message() functionality.Some code style changes to meet PEP8.s_groupprimitive was not accepting empty default value.Timeout during opening TCP connection now raises BoofuzzTargetConnectionFailedError exception.SSL/TLS works again. Seeexamples/fuzz-ssl-server.pyandexamples/fuzz-ssl-client.py.Dropped six.binary_type in favor of b”” format.Fixed process monitor handling of backslashes in Windows start commands.Fixed and documentedboo open.Fixed receive function infuzz_logger_curses.Installing boofuzz withsudois no longer recommended, use the–useroption of pip instead.Fixed setting socket timeout options on Windows.If all sockets are exhausted, repeatedly try fuzzing for 4 minutes before failing.Fixed CSV logger send and receive data decoding.Handle SSL-related exception. Addedignore_connection_ssl_errorssession attribute that can
be set to True to ignore SSL-related error on a test case.Fixeds_from_filedecoding in Python 2 (the encoding parameter is now depreciated).Updated documentation ofs_checksum. It is possible to use a custom algorithm with this block.v0.1.5FeaturesNew curses logger class to provide a console gui similar to the webinterface. Use the session optionconsole_guito enable it.
This has not been tested under Windows!Compatibility for Python 3Large test cases are now truncated, unless a failure is detected.When a target fails to respond after restart, boofuzz will now continue to restart instead of crashing.New Session optionkeep_web_opento allow analyzing the test results after test completion.Process monitor creates new crash file for each run by default.Long lines now wrap in web view; longer lines no longer need to be truncated.Process monitor now stores crash bins in JSON format instead of pickled format.Process monitor in Windows will usetaskkill -Fiftaskkillfails.FixesWeb server no longer crashes when asked for a non-existing test case.EINPROGRESS socket error is now handled while opening a socket (note: this sometimes-transient error motivated the move to retry upon connection failure)v0.1.4FeaturesNew Session optionsrestart_callbacks,pre_send_callbacks, andpost_test_case_callbacksto hand over custom callback functions.New Session optionfuzz_db_keep_only_n_pass_cases. This allowes saving only n test cases preceding a failure or error to the database.Added logic to find next available port for web interface or disable the web interface.Removed sleep logs when sleep time is zero.Added option to reuse the connection to the target.FixesWindows process monitor now handles combination of proc_name and/or start_commands more reasonablyWindows process monitor handles certain errors more gracefullyFixed target close behavior so post send callbacks can use the target.Fixed a dependency issue in installation.v0.1.3FeaturesSocket Connections now allow client fuzzing.Log only the data actually sent, when sending is truncated. Helps reduce database size, especially when fuzzing layer 2 or 3.Targetrecvfunction now accepts amax_recv_bytesargument.FixesFixed install package – now includes JavaScript files.v0.1.2FeaturesClearer error message when procmon is unavailable at fuzz start.Web UI now refreshes current case even when snap-to-current-test-case is disabled.FixesWeb UI no longer permits negative test cases.Fix Windows procmon regression.Minor fixes and UI tweaks.v0.1.1FeaturesNewboo opencommand can open and inspect saved database log files.Unix procmon now saves coredumps by default.Improved “Cannot connect to target” error message.Improved API for registering callbacks.Made the globalREQUESTSmap available in top level boofuzz package.FixesHandle exceptions when opening crash bin files in process monitor.Fix Block.__len__ to account for custom encoder.v0.1.0FeaturesWeb UIStatistics now auto-update.Test case logs now stream on the main page.Cool left & right arrow buttons to move through test caseNewSessionparameterreceive_data_after_fuzz. Controls whether to execute a receive step after sending
fuzz messages. Defaults to False. This significantly speeds up tests in which the target tends not to respond to
invalid messages.FixesText log output would include double titles, e.g. “Test Step: Test Step: …”v0.0.13FeaturesWeb UITest case numbers are now clickable and link to test case detail view.Test case details now in color!FuzzLoggerDBAdded FuzzLoggerDB to allow querying of test results during and after test run. Saves results in a SQLite file.AddedSession.open_test_run()to read test results database from previous test run.NewSession.feature_check()method to verify protocol functionality before fuzzing.Process MonitorUnify process monitor command line interface between Unix and Windows.Added procmon optionproc_nameto support asynchronously started target processes.procmon is now checked for errors before userpost_send()is called, reducing redundant error messages.Improved procmon logging.Process monitor gives more helpful error messages when running 64-bit application (unsupported) or when a process is
killed before being attachedLogging ImprovementsTargetopen()andclose()operations are now logged.Added some optional debug output from boofuzz runtime.Improve capability and logging of messages’callbackmethods.NewSession& Connection OptionsAddSessionreceive_data_after_each_requestoption to enable disabling of data receipt after messages are sent.Sessionskipargument replaced withindex_startandindex_end.Sessionnow has separate crash thresholds for elements/blocks and nodes/messages.GiveSocketConnectionseparate timeouts forsend()/recv().Ease of UseTarget.recv()now has a defaultmax_bytesvalue.AddedDEFAULT_PROCMON_PORTconstant.Session.post_send()’ssockparameter now deprecated (usetargetinstead).FixesFixed bug in which failures were not recognized.BitFieldblocks with ASCII format reported incorrect sizes.Fixed bug ins_update.Handle socket errors that were getting missed.Fixed process monitor logging when providing more or less than 1 stop/start commands.Show graceful error on web requests for non-existent test cases.get_max_udp_size()was crashing in Windows.Stringpadding was not always being applied.Stringwas not accepting unicode strings invalueparameter.Stringwas skipping valid mutations and reporting wrongnum_mutations()whensizeparameter was used.Unix and Windows process monitors now share much more code.DevelopmentAdded unit tests forBitField.Cleaned up CSS on web pages.Added a unit test to verify restart on failure behavior0.0.12FeaturesTest cases now have descriptive namesAdded Session methods to fuzz a test cae by name:fuzz_by_nameandfuzz_single_node_by_pathFixesFixed test case numbers when usingfuzz_single_case0.0.11FeaturesSet Sessioncheck_data_received_each_requestto False to disable receive after send.FixesDosctring format fixes.0.0.10FeaturesAdd Session ignore_connection_reset parameter to suppress ECONNRESET errors.Add Session ignore_connection_aborted parameter to suppress ECONNABORTED errors.FixesFix Session class docstring formats.0.0.9Featuress_sizeis now fuzzable by default.Add new s_fuzz_list primitive to read fuzz value from files.Add new FuzzLoggerCsv to write log in CSV formatFixesFixed: Add missing dummy value for custom checksum, allowing recursive uses of length/checksum (issue #107)0.0.8FeaturesConsole output - now with colors!process_monitor_unix.py: added option to move coredumps for later analysis.The process monitor (procmon) now tracks processes by PID by default rather than searching by name. Therefore,
stop_commands and proc_name are no longer required.SIGINT (AKA Ctrl+C) now works to close both boofuzz and process_monitor.py (usually).Made Unix procmon more compatible with Windows.Improved procmon debugger error handling, e.g., when running 64-bit apps.Windows procmon now runs even if pydbg fails.Added--helpparameter to process monitor.Target class now takesprocmonandprocmon_optionsin constructor.Added example fuzz scripts.FixesSIGINT (AKA Ctrl+C) now works to close both boofuzz and process_monitor.py (usually).Fixed: The pedrpc module was not being properly included in imports.Made process_monitor.py--crash_binoptional (as documented).Improved procmon behavior when certain parameters aren’t given.Improved procmon error handling.Fixed a bug in which the procmon would not properly restart a target that had failed without crashing.0.0.7FeaturesAdded several command injection strings from fuzzdb.Blocks can now be created and nested usingwiths_block("my-block"):FixesFixed pydot import error message0.0.6FeaturesAddedRequest.original_value()function to render the request as if it were not fuzzed.
This will help enable reuse of a fuzz definition to generate valid requests.SocketConnectioncan now send and receive UDP broadcast packets using theudp_broadcastconstructor
parameter.Target.recv()now logs an entry before receiving data, in order to help debug receiving issues.FixesMaximum UDP payload value was incorrect, causing crashes for tests running over UDP. It now works on some systems,
but the maximum value may be too high for systems that set it lower than the maximum possible value, 65507.SocketConnectionclass now handles more send and receive errors:ECONNABORTED,ECONNRESET,ENETRESET, andETIMEDOUT.Fixed setup.py to not include superfluous packages.DevelopmentAdded two exceptions:BoofuzzTargetConnectionResetandBoofuzzTargetConnectionAborted.These two exceptions are handled insessions.pyand may be thrown by anyITargetConnectionimplementation.0.0.5FixesBoofuzz now properly reports crashes detected by the process monitor. It was calling log_info instead of log_fail.Boofuzz will no longer crash, but will rather give a helpful error message, if the target refuses socket connections.Add utils/crash_binning.py to boofuzz/utils, avoiding import errors.Fix procmon argument processing bug.Fix typos in INSTALL.rst.0.0.4Add Gitter badge to README.Add default sleep_time and fuzz_data_logger for Session to simplify boilerplate.0.0.3Fixed deployment from 0.0.2.Simplify CONTRIBUTING.rst for automated deployment.tox no longer runs entirely as sudo. The sudo has been moved into tox.ini and is more fine-grained.Reduced defaultSession.__init__restart_sleep_timefrom 5 minutes to 5 seconds.0.0.2Continuous deployment with Travis.DevelopmentAdded build and PyPI badges.Added CONTRIBUTING.rst.check-manifest now runs in automated build.Travis now deploys to PyPI!0.0.1-dev5DevelopmentTests now run on tox.Added Google Groups and Twitter link.0.0.1-dev4FixesMissing property setters inboofuzz.request.Requestnow implemented.Unit tests now pass on Windows.Fixed wheel build issue; boofuzz subpackages were missing.0.0.1-dev3FixesSession constructor paramsession_filenameis now optional.0.0.1-dev2New featuresNow on PyPI!pip install boofuzzAPI is now centralized so all classes are available at top levelboofuzz.*This makes it way easier to use. Everything can be used likeboofuzz.MyClassinstead ofboofuzz.my_file.MyClass.AddedEzOutletResetclass to support restarting devices using an
ezOutlet EZ-11b.Backwards-incompatibleTarget now only takes anITargetConnection. This separates
responsibilities and makes our code more flexible with different
kinds of connections.FixesBugs fixed:helpers.udp_checksumwas failing with oversized messages.Missing install requirements.Grammar and spelling.setup.pywas previously installing around five mostly unwanted
packages. Fixed.Removed deprecated unit tests.Removed overly broad exception handling in Session.Checksum.render()for UDP was not handling dependencies
properly.Back-end ImprovementsThis section took the most work. It has the least visible impact, but
all of the refactors enable new features, fixes, and unit tests.Primitives and Blocks:CreatedIFuzzablewhich properly defines interface forBlock,Request, and allBasePrimitiveclasses.Made effectively private members actually private.Eliminatedexhaust()function. It was used only once and was
primarily a convoluted break statement. Now it’s gone. :)Split all block and primitive classes into separate files.Many Unit tests added.OtherContinuous integration with Travis is running!Doc organization improvements.Can now install with extras[dev]Initial Development Release - 0.0.1-dev1Much easier install experience!Support for arbitrary communications mediums.Added serial communications support.Improved sockets to fuzz at Ethernet and IP layers.Extensible instrumentation/failure detection.Better recording of test data.Records all sent and received dataRecords errors in human-readable format, in same place as
sent/received data.Improved functionality in checksum blocks.Self-referential size and checksum blocks now work.post_sendcallbacks can now check replies and log failures.Far fewer bugs.Numerous refactors within framework code.