207 Commits

Author SHA1 Message Date
andreafioraldi
7564ce1e87 libfuzzer_stb_image with build.rs and win32 fixes 2021-03-26 10:39:02 +01:00
andreafioraldi
40fe286cf9 run on win32 using the clang wrapper 2021-03-25 20:04:52 +01:00
root
a0550b3154 compile libfuzzer_libpng on windows 2021-03-25 18:50:40 +01:00
Toka
82f5dad784
Add mutator stats method (#40)
* add LogMutation trait

* change &self to &mut self

* move self.scheduler out of StdFuzzer

* reorder generics?, implement post_exec

* append metadata to the corresponding testcase in the corpus

* turn mutations into Mutators

* impl Named for mutations

* add LoggerScheduledMutator, add fn get_name() to MutatorTuple

* Fix BytesDeleteMutator, and format

* remove TupleList bound on Tail

* turn TokenInsert, TokenReplace into Mutator, fill havoc_mutations

* libfuzzer_libpng

* libfuzzer_libpng_cmpalloc

* libfuzzer_libmozjpeg

* fix tests

* fix libfuzzer_libmozjpeg

* fix tests

* fix LoggerScheduledMutator::mutate

* use vec<u8> instead of String

* fix post_exec and get_name

* fmt

* NamedTuple and HasNameIdTuple

* always clear mutations log

* fix tests

* format

* remove libafl_targets default features

* use vec<string> instead of vec<vec<u8>>

* add alloc::string::String

* format

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2021-03-25 13:04:18 +01:00
Andrea Fioraldi
21b790060d readme 2021-03-24 16:24:37 +01:00
Andrea Fioraldi
79dbdf8251 readme 2021-03-24 16:23:08 +01:00
Andrea Fioraldi
9c0fdee007 complete libfuzzer_libpng example with compiler wrapper 2021-03-24 16:15:07 +01:00
Andrea Fioraldi
8d2713c4d9 libfuzzer_libpng wrappers 2021-03-24 15:28:58 +01:00
Andrea Fioraldi
1c8cdc76a8 create libafl_targets and start new structure for libfuzzer_libpng 2021-03-23 20:39:23 +01:00
Dominik Maier
7f72d70977
Windows Fuzzing Example (#41)
* windows fuzzer target and minor changes - breaks android support and maybe linux build

* adapted windows example

* removed warnings from build.rs

* fixed build on unix

* fixed no_std

* build fix, silenced warnings

* no_std warning silenced

* clippy fixes

* fmt

* windows fuzzer target and minor changes - breaks android support and maybe linux build

* adapted windows example

* removed warnings from build.rs

* fixed build on unix

* fixed no_std

* build fix, silenced warnings

* no_std warning silenced

* clippy fixes

* fmt

* clippy

* trying to add clang support

* debugging win build

* debugging win build more

* debuggin..

* debuggin....

* more debugging

* giving up

Co-authored-by: richinseattle <richinseattle@gmail.com>
2021-03-23 13:50:22 +01:00
Dominik Maier
556141e9a3 ignored frida on windows 2021-03-22 16:54:31 +01:00
s1341
a02cc39bba
Frida Executor Example (#27)
* inprocess: Allow InProcessExecutor to take a function pointer or a closure

* frida: initial working (but slow + buggy) frida helper

Issues:
- it's slow as ****
- there is an Llmp exception after the 227th corpus entry is found
- Cargo.toml lines currently import from a local ../frida-rust dir, as frida-rust is still under development

* inprocess: let the InProcessExecutor take a closure or a function pointer

* frida: working FridaHelper with InProcessExecutor

* frida: Apply suggestions; Move to RefCell; Cleanup warnings

* frida: link libstdc++_static.a on android

* take an FnMut in InProcessExecutor

* adapt libfuzzer_libpng to FnMut in InProcessExecutor

* create FridaInProcessExecutor and FridaEdgeCoverageHelper

* fix frida build.rs

* frida: move gum to main, get rid of lazy_static; use PageProtection enum

* stalker exclude

* frida: implement inline map-update for x86_64

* inprocess: add harness/harness_mut accessors

* format

* remove get_module_size from FridaEdgeCoverageHelper

* frida: implement aarch64 inline map update

* frida: add missing IndexMode

* add timeouts for executors

* move timeouts to observer

* add with_timeout constructor for Observer

* cast to i64 later in pre_exec

* add cfg(unix) guards

* add TimeoutExecutor

* add TimeoutFeedback and send ExitKind::Timeout from the handler

* pass Duration and move timeout stuff to post_exec

* format

* add timeouts to libpng_libfuzzer

* 10 sec timeout

* timeout executor file

* fix timeout executor no_std

* format

* todos

* Win32ShMem

* win32 exceptions

* fixes

* fix win32 build.rs

* fix win32 build.rs

* fixes fro win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* fixes for win32

* inprocess::windows_exception_handler

* inprocess::windows_exception_handler fixes

* windows_exception_handler in InProcessExecutor

* inprocess::windows_exception_handler fix

* fix windows exceptions mapping

* format

* format

* inprocess: Allow InProcessExecutor to take a function pointer or a closure

* frida: initial working (but slow + buggy) frida helper

Issues:
- it's slow as ****
- there is an Llmp exception after the 227th corpus entry is found
- Cargo.toml lines currently import from a local ../frida-rust dir, as frida-rust is still under development

* inprocess: let the InProcessExecutor take a closure or a function pointer

* frida: Apply suggestions; Move to RefCell; Cleanup warnings

* take an FnMut in InProcessExecutor

* adapt libfuzzer_libpng to FnMut in InProcessExecutor

* reenabled ci for prs

* frida: update to frida-rust 0.3.2

* frida: fix buid errors

* frida: fix build_and_test.yml

* frida: uses crates.io for frida-gum and frida-gum-sys

* fix merge errors

* fix typo

* frida: x86_64 now working

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
Co-authored-by: toka <tokazerkje@outlook.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-03-22 12:45:38 +01:00
Andrea Fioraldi
8a3e4301fb format 2021-03-17 17:19:33 +01:00
Andrea Fioraldi
cd7030443e timeout executor file 2021-03-17 17:08:17 +01:00
Andrea Fioraldi
774dbc82d1 10 sec timeout 2021-03-17 16:46:29 +01:00
Andrea Fioraldi
46c69aeee8 add timeouts to libpng_libfuzzer 2021-03-17 15:36:56 +01:00
toka
b321675aa9 add TimeoutFeedback and send ExitKind::Timeout from the handler 2021-03-16 18:48:40 +09:00
toka
ab3d070f1a add TimeoutExecutor 2021-03-16 18:13:18 +09:00
Dominik Maier
f7db29d213 workaround for recursive malloc in release mode 2021-03-10 19:40:39 +01:00
Andrea Fioraldi
dbe935b078 time feedback in libfuzzer example 2021-03-09 15:18:50 +01:00
s1341
b048ddf470
Better Unix Signal Handling Abstractions (#22)
* WIP: unix_signal_handling

* WIP: unix_signal_handling, another try

* only emit a single illegal instruction

* unix_signal_handling: Now working

* unix_signal_handling: squash warnings

* unix_signal_handling: formatting

* fix spelling

* unix_signal_handling: add missing file

* unix_signal_handling: port LlmpBroker

* unix_signal_handling: fix missing import

* moving towards no_std compatibility

* unix_signal_handling: get rid of HashMap, Mutex and lazy-static

* unix_signal_handling: formatting

* readme

* no_std fixes

* fixed windows build

Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2021-03-05 15:36:44 +01:00
Dominik Maier
bb54d551ac included more clippy suggestions 2021-03-04 19:11:36 +01:00
Dominik Maier
eaa3dc786b
Fork (#20)
* wip forking

* fixed build

* fixed build

* import cleanup

* more fork

* added windows ci

* fmt

* no_std fixes

* windows

* unix build fixed

* ignoring tests on windows

* fixed windows tests
2021-03-03 17:06:17 +01:00
s1341
fde48be53e
unix_domain_sockets/ashmem: Add ability to connect over unix domain sockets instead of just TCP; Add ashmem support for android (#19)
* unix_domain_sockets: Added Listener abstraction

Tested and TCP is still working

* unix_domain_sockets: turn off the unstable feature except on android

* unix_domain_sockets: more turn off the unstable feature except on android

* unix_domain_sockets: always import UnixListener

* unix_domain_sockets: Finished implementation. Tested working on android when both sides are root

* unix_domain_sockets: adjust conditional compilation

* unix_domain_sockets: formatting

* unix_domain_sockets/android: implement ashmem hooks

* unix_domain_sockets/android: formatting

* unix_domain_sockets: make Listener abstraction public

* unix_domain_sockets: add cfg(std) to Listener

* unix_domain_sockets: add cfg(std) to imports

* unix_domain_sockets: formatting

* unix_domain_sockets: Handle SIGTERM, SIGQUIT and SIGINT gracefully and cleanup the unix socket

* unix_domain_sockets: formatting

* unix_domain_sockets: fix conditional compilation

* unix_domain_sockets: use String::default instead of a literal

* unix_domain_sockets: socket_name should be an Option<>

* fixed build

* fmt

* fixed warnings

* using volatile reads and writes for shutdown flag

* reordered compiler fence on write

* moved the signal handler method to its own function

* readme

* moved to HasShmId

* unix_domain_sockets: fix warnings

* renamed HasShmId to HasFd

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-03-03 12:31:29 +01:00
Marcin Kozlowski
959c8f0dd8
Libmozjpeg example added (#15)
* WIP Harness for libmozjpeg

* Taskset removal (wrong invocation, without -c)

* Clean up
Fixed taskset in test.sh

* Docs

* Formatting

* Formatting

* Formatting

* Formatting

* jpeg example now uses a tokens file

* fixed testcases

* fixing build

* fixed more bugs

* metadatas->metadata

* token files

* added doctest test

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-03-01 17:54:47 +01:00
s1341
d0d9d2887f
Support running on Android aarch64 (#17)
* android: cleanup build.rs and allow for cross-compilation

* aarch64: use an aarch64 undefined instruction

* android: i8 should be u8

* android: siginfo_t is different on arm

* android: cast to c_char instead of u8/i8

It turns out that c_char is different on android and linux

* android: handle LDFLAGS being empty

* android: formatting

* fixed warning

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-03-01 15:18:27 +01:00
Andrea Fioraldi
24e9f70b83
Merge pull request #16 from AFLplusplus/dev
Minimizer Corpus Scheduler & hitcounts
2021-03-01 10:59:50 +01:00
Andrea Fioraldi
bd800b63f5 hitcounts observer in libpng example 2021-03-01 10:34:59 +01:00
Andrea Fioraldi
7c9fc88e66 use hitcounts in libfuzzer rt 2021-03-01 10:20:08 +01:00
Andrea Fioraldi
dc39a5591a format 2021-03-01 10:04:59 +01:00
Andrea Fioraldi
9ba508f77a IndexesLenTimeMinimizerCorpusScheduler in libpng example 2021-03-01 10:04:28 +01:00
Andrea Fioraldi
ff0b6089b4 have libpng example compiling 2021-03-01 09:55:00 +01:00
Dominik Maier
061a8dd77c OnDiskCorpus autocreates dictionaries 2021-03-01 02:27:21 +01:00
Andrea Fioraldi
3aa9439e80 scheduler half finished 2021-02-28 23:22:18 +01:00
Andrea Fioraldi
0f40ac05d4 readme 2021-02-27 15:12:19 +01:00
Andrea Fioraldi
fd83c10c1e finish minimizer scheduler 2021-02-26 22:22:10 +01:00
Andrea Fioraldi
bb29e6dd72 errors in minset for missing meta 2021-02-26 17:21:03 +01:00
Dominik Maier
fb0d47dc2e tiny fixes 2021-02-26 13:21:12 +01:00
Dominik Maier
4c392de98d more docu 2021-02-26 11:45:30 +01:00
Dominik Maier
15a64c3e17 moved new -> with_seed, with_random_seed -> new 2021-02-26 09:27:34 +01:00
Dominik Maier
d48524168a Moved fuzzer to examples 2021-02-26 08:35:18 +01:00
Dominik Maier
ea278a0dd6 fixed testcases, removed mutator param from mutators 2021-02-25 18:55:37 +01:00
Andrea Fioraldi
5695b4326a comments 2021-02-23 20:49:15 +01:00
Andrea Fioraldi
9f12f9506c comments 2021-02-23 20:45:22 +01:00
Andrea Fioraldi
a5cc8313db new ondisk corpus 2021-02-22 15:19:35 +01:00
Andrea Fioraldi
1575a3994b impl serdeany macro 2021-02-16 14:49:18 +01:00
Andrea Fioraldi
97ad4e92f9 windows crate 2021-02-16 10:47:15 +01:00
Andrea Fioraldi
e99c2daa41 libafl package 2021-02-15 16:54:33 +01:00
Andrea Fioraldi
7236fd9f3c fmt 2021-02-15 15:28:40 +01:00
Andrea Fioraldi
a599a9f998 forward NewTestcase, executor as arg to EventManager::process 2021-02-15 15:27:55 +01:00