Files in the top-level directory from the latest check-in
- .fossil-settings
- cwe369
- cwe617
- cwe805
- cwe823
- generic
- collect.in
- common.c
- COPYING
- cover.c
- e9cd
- filter.zig
- fix.in
- guard.in
- helpers.cc
- helpers.hh
- helpers.in
- init.in
- jump.c
- Makefile
- no-crash.in
- README.md
- refine.in
- scout.cc
- sort-inputs.in
- sort-values.in
- split-brch.in
- stack.c
- trace-call.cc
Taosc
Taosc is an automated makeshift patcher for binary programs.
Installation
Taosc depends on AFL++, Dyninst, E9Patch, FANN, GNU Findutils,
FUZZOLIC, GNU Parallel, Valgrind and POSIX utilities. Shell scripts
in this project are written for GNU Bash, though patches for compatibility
with other shells are welcomed. To build and install taosc
to $prefix (default to /usr/local), you need install(1p)
and a compiler for C++23 and Zig 0.16:
make -j$(nproc) PREFIX=$prefix install
Usage
taosc-fix TIMEOUT WORKDIR PROOFS_OF_CONCEPT EXECUTABLE ARG...
Fix EXECUTABLE, which crashes for PoC(s) in the PROOFS_OF_CONCEPT directory
when it is run with ARG(s), where @@ is the placeholder for input files.
The subject program's behavior is observed QEMU with QASan or Valgrind,
and processes taking more than TIMEOUT seconds to terminate
are treated the same as crashes.
Files in WORKDIR are overwritten without any confirmation.
A successful invocation of taosc-fix should create the following files.
patch-location: address of the patch locationpatch-destination: address of the instruction the patch jumps topatch-format: based on the recognized weakness and the distance between the patch and the crashPROG.patched, wherePROGis the basename ofEXECUTABLE: patched program expecting the mentioned environment variables
Depending on the content of the file patch-format,
additional output may be expected as follows.
Single CWE-*:PROG.brpatchedandPROG.brpatched.jsonfor BinRadarERM CWE-8*:predicates,PROG.brpatchedandPROG.brpatched.jsonERM generic: FANN modelpredicate.fann
Internally, taosc-fix evaluates the patched binary with additional inputs
generated by FUZZOLIC. If you want to bring your own inputs, run:
# First, generate patch-location, destinations and patch-format.
taosc-init TIMEOUT WORKDIR PROOFS_OF_CONCEPT EXECUTABLE ARG...
# After populating WORKDIR/input/{benign,malicious} manually,
# continue with fixing process to insert the guarding patches.
taosc-guard TIMEOUT WORKDIR
Copying
Taosc is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.