327 Commits

Author SHA1 Message Date
Toka
f63b862160
Frida for Windows (#287)
* harness.cc for win

* no backtrace for frida_gum

* build.rs message

* cfg guards

* at least libafl_frida builds with cfg guards

* fuzzer.rs builds on win

* clean up

* build instructions

* ps

* fix

* clang

* fix

* article

* static option to make it run on powershell

* vscode build instructions

* dllexport!

* fix

* build.rs

* fix & fmt

* message

* msys not necessary anymore

* Update README.md

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-09-29 22:10:15 +02:00
Dominik Maier
5a722994ac
Still fixing CI (#305)
* clippy

* clippy on windows

* clippy fixes on windows

* clippy, fmt

* fixed testcases for windows

* fixing workspace.yml

* testcase no longer fails without clang

* fix github dependencies to specific revisions

* fix qemu without python

* cleanup HookResult
2021-09-29 17:58:09 +02:00
Andrea Fioraldi
2f2634db02
Python basic bindings for sugar and qemu (#302)
* InMemoryBytesCoverageSugar python binding

* InMemoryBytesCoverageSugar python binding

* python mod for qemu in libafl_sugar

* libafl_qemu python

* fix

* clippy fixes

* clippy

* added pyo3-build-config for MacOS builds

* gitignor

* python is not default

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-09-27 09:39:21 +02:00
Dominik Maier
3fe8c2c044
cbz, tbz, tbnz support for aarch64 cmplog (#298)
* add support for cbz/tbz

* remove unecessary print

* implemented support for tbz

* add support for tbnz

* fix an error in the emitted code for both tbz/tbnz

Co-authored-by: Omree <Omree10@gmail.com>
2021-09-17 03:03:27 +02:00
Andrea Fioraldi
951b6fef36 Bump 0.6.1 2021-08-23 10:01:22 +02:00
Dominik Maier
5caeb46b67
renamed target_os macos to target_vendor apple (#273)
* renamed target_os macos to target_vendor apple

* fix yaml
2021-08-23 09:45:25 +02:00
julihoh
dcf107a30a
symcc_runtime dependency fix for next libafl version & bump to 0.6.0 (#268)
* symcc_runtime dependency fix for next libafl version

* bump to 0.6.0

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
2021-08-18 10:57:55 +02:00
Fabian Freyer
15c6e6b73b
libafl_frida: remove non-gnu hooks on macos (#262)
The following functions are GNU extensions and therefore
not available on superior systems:
- explicit_bzero
- malloc_usable_size
- memalign
- mempcpy
- memrchr
2021-08-15 08:51:47 +02:00
Dominik Maier
16c3a07be7
ShMem Server for MacOS (#238)
* generalized ashmem server

* fixed macos testcases

* added StdShMemService

* no_st

* fmt

* added testcase, fixed some bugs (not all)

* solidified unix shmem

* initial impl for MmapShMem

* Added shmem service start to more testcases

* clippy

* fixed tetcases

* added frida_libpng makefile for easy use

* trying to fix build on ubuntu

* fixed ubuntu build for libpng

* no_std

* fixed testcase
2021-08-05 17:08:01 +02:00
s1341
3fac056b58
strdup is an allocating function, treat it as such (#241)
* strdup is an allocating function, treat it as such; poison target bytes after run

* Add cfg guards
2021-08-04 15:03:49 +02:00
julihoh
7750707fee
fix ci for latest clippy version (#239)
* clippy

* fix ubuntu as well
2021-08-03 12:29:30 +02:00
Andrea Fioraldi
a1fc2a5453 Bump to 0.5.0 2021-07-05 14:12:40 +02:00
Andrea Fioraldi
44f6e4c389
Improve introspection (#200)
* remove NUM_FEEDBACKS

* working introspection

* adust introspection stats

* bugfixes, clippy

* removed outdated define

* more clippy;

* no_std

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-07-02 10:58:36 +02:00
Andrea Fioraldi
5b54f0f068
Llvm passes (#185)
* enable llvm passes in libafl_cc

* cmplog rtn pass in fuzzbench fuzzer

* improve libafl_cc

* silence fuzzbench compiler wrapper

* instrumentation and runtime for rtn cmplog

* fix test

* fix test

* fuck clippy

* remove anon union in CmpLogMap

* windows.h

* remove libafl_targets_cmplog_wrapper

* no inline linking

* adapt fuzzers/
2021-06-23 09:38:15 +02:00
Andrea Fioraldi
bdb5efbf5b
Configurations (#162)
* print sender id

* storing sender id to env

* executor in llmp handle_in_client

* compile the lib

* compiling generic_inmemory

* fix forkserver

* adapt from fuzzers

* instrospection fix

* exitkind in NewTestcase

* fix libafl_frida

* fix firda_libpng

* send conf with Newtestcase event

* bump to 0.4.0

* no_std fix

* fmt

* fix libfuzzer_libmozjpeg

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2021-06-22 15:04:14 +02:00
Andrea Fioraldi
8f5e2515dd Fix CI 2021-06-18 09:12:15 +02:00
s1341
ca4bdd3e3b
frida: small fixes (#169)
* Too large allocs should return 0; Don't forcibly free unfreed allocations in reset

* Make max ASAN allocation configurable
2021-06-13 12:27:27 +02:00
Dominik Maier
022dc33251 clippy 2021-06-10 22:07:18 +02:00
Omree
48af1661b4 change error message 2021-06-09 17:20:26 +03:00
Omree
f1c646dd1c Merge branch 'main' into cmplog_instrumentation 2021-06-09 17:05:37 +03:00
Omree
1181728a4f changed command line parameter from cmplog_cores to cmplog-cores 2021-06-09 16:55:42 +03:00
Omree
ed26319a21 add cmplog_cores command line argument support 2021-06-09 16:27:22 +03:00
OB
7abd7c8162
Cmplog instrumentation for Frida (#99)
* libafl_targets: refactor sancov trace-pc

* cmp observer

* libaf_targets: new structure to isolate sancov

* fix C warning

* combined executor

* cmp observer and feedback

* I2SRandReplace mutator

* impl CmpMap for CmpLogMap in libafl_targets

* cmplog observer

* clippy

* TracingStage

* working random cmplog mutations

* enable cmplog for libfuzzer_stb_image

* re-enable new testcase stats print

* fix update stats display

* bump 0.3.1

* clippy

* clippy

* no clippy for fuzzers/

* fix

* add cmplog runtime instrumentation

* test cmplog against value profile feature

* fix compile error

* add target arch aarch64 for is_interesting_cmplog_instruction

* add cfg target aarch64 on cmplog related code within stalker loop

* revert changes in cargo.toml

* align code with 'main' branch

* revert accidently changed Cargo.toml file

* update cmplog runtime code to work with the cmplog backend implementation

* change magic to 8 bytes

* cmplog runs with observer- no crashes

* clippy fixes

* add cmplog_runtime as feature

* set cmplog command-line argument to false by default

* setup cmplog observer and mutator correctly

* decrease emitted code opcode count

* add cmplog testing to the harness

* get rid of irrelevant changes and unused code, add comments, change
feature name to "cmplog"

* get rid of some unessecery whitespaces and new lines

* fix clippy errors

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: Omree <you@example.com>
2021-06-09 14:11:43 +02:00
Omree
b8e4f4c6fa fix clippy errors 2021-06-09 13:16:05 +03:00
Omree
0e2a280eae get rid of irrelevant changes and unused code, add comments, change
feature name to "cmplog"
2021-06-09 13:01:22 +03:00
Omree
584b034a52 decrease emitted code opcode count 2021-06-09 12:05:35 +03:00
Omree
e8295988f2 set cmplog command-line argument to false by default 2021-06-09 12:01:55 +03:00
Omree
6f98bbe6cf add cmplog_runtime as feature 2021-06-09 12:01:39 +03:00
Omree
5de4c9305e Merge branch 'main' into cmplog_instrumentation 2021-06-09 10:37:43 +03:00
s1341
609939b5ec Use rlimit_cur as rlimit_max is set to MAX_LONG 2021-06-09 10:36:15 +03:00
s1341
cbf271d99f Remove stray print 2021-06-09 07:35:44 +03:00
Dominik Maier
36b823548a
nightly clippy fixes (#155)
* nightly clippy fixes

* more niglty clippy fixes

* added Safety section

* no_std fixes

* final fixes
2021-06-07 12:30:56 +02:00
Dominik Maier
0d0bcc1796 clippy fixes 2021-06-07 01:44:07 +02:00
Dominik Maier
f858206ab1 macos fixes 2021-06-07 01:28:17 +02:00
Dominik Maier
3b2ee4bb70
Added MacOS CI (#131)
* added macos ci

* running tests on macos

* some macos fixes

* fmt

* some must_use infos

* trying' to fix MacOs testcases

* no main in test

* fixed MacOS testcases

* tried to fix build errors

* unified shmem_limits

* Revert "unified shmem_limits"

This reverts commit 8c6bb8d6a2cec71d72bb181b5b491737a771298e.

* hopefully fixed macos testcase

* removed unneeded values
2021-06-07 01:24:41 +02:00
Dominik Maier
370c652838 Merge branch 'main' into cmplog_instrumentation 2021-06-07 00:52:24 +02:00
s1341
636194de0e
Frida switch from walk-proc-maps to frida-gum based extraction of ranges (#149)
* Bump frida-gum version

* Move from walk of /proc/pid/maps to frida based range/module locatoin
2021-06-06 10:40:07 +02:00
Omree
ac27efb954 update cmplog runtime code to work with the cmplog backend implementation 2021-06-02 10:04:03 +03:00
Omree
5bd08a6eee align code with 'main' branch 2021-06-02 10:04:03 +03:00
Omree
23b2b4a06e add cfg target aarch64 on cmplog related code within stalker loop 2021-06-02 10:04:03 +03:00
Omree
2c0548a757 add target arch aarch64 for is_interesting_cmplog_instruction 2021-06-02 10:04:03 +03:00
Omree
8b2e86e7e6 fix compile error 2021-06-02 10:04:03 +03:00
Omree
85a90c7d21 test cmplog against value profile feature 2021-06-02 10:04:03 +03:00
Omree
2bbff1b7ab add cmplog runtime instrumentation 2021-06-02 10:04:03 +03:00
Andrea Fioraldi
69d87b3763 bump 0.3.1 2021-06-02 10:04:03 +03:00
s1341
83bef6e85a
Fix frida bugs (#132)
* Get rid of extra deactivate

* Fix realloc, posix_memalign/memalign bugs

* Fix cfg attributes; Add instrumented ranges and translated PC to func errors

* Formatting

* Make hook_functionss aarch64 only for now.
2021-05-27 11:17:42 +02:00
Dominik Maier
945693f6ed fixed example testcase 2021-05-26 16:50:10 +02:00
Dominik Maier
ca869cd70a macos frida fixes 2021-05-26 14:01:33 +02:00
Dominik Maier
7493b59ba8 bringing back light clippy for fuzzers :) 2021-05-25 14:53:57 +02:00
s1341
3a21ad59a4
Hook using frida gum interceptor instead of gothook (#112)
* Move from gothook to frida-based hooks

* Force link against libc++

* Clippy + cleanup prints

* exclude ranges

* Add back guard pages; Implement libc hooks

* Bump frida-rust version

* Add hooks for mmap/munmap, as per issue #105

* Refactor to get rid of global allocator singleton

* Cleanup imports; Fix free out-of-range; Move to fixed addresses for asan allocatoins

* use frida-rust from crates.io now that it has caught up

* cargo fmt

* Clippy fixes

* Better clippy fix

* More clippy fix

* Formatting

* Review changes
2021-05-25 13:45:06 +02:00