Skip to content

Instantly share code, notes, and snippets.

View fuzzamos's full-sized avatar
🤑

fuzzamos

🤑
View GitHub Profile
@fuzzamos
fuzzamos / apatching_for_AFL_Persistent_fuzzing.diff
Created October 25, 2017 09:34 — forked from n30m1nd/apatching_for_AFL_Persistent_fuzzing.diff
Patch for Apache httpd to make it fuzzable through afl-clang-fast
Index: server/main.c
===================================================================
--- server/main.c (revision 1794475)
+++ server/main.c (working copy)
@@ -434,11 +434,157 @@
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
" -X : debug mode (only one worker, do not detach)");
- destroy_and_exit_process(process, 1);
+ destroy_and_exit_process(process, 0);
@fuzzamos
fuzzamos / apatching_apache_for_AFL_fuzzing.diff
Created October 25, 2017 09:35 — forked from n30m1nd/apatching_apache_for_AFL_fuzzing.diff
This patch adds the "-F" switch. This switch reads a file from the command line arguments and feeds it to Apache httpd server
Index: server/main.c
===================================================================
--- server/main.c (revision 1794194)
+++ server/main.c (working copy)
@@ -371,7 +371,11 @@
ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
" -c \"directive\" : process directive after reading "
"config files");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
+ " -F : hackish file to read as request "
#!/bin/bash
PREFIX="${PREFIX:-/usr/local/apache_clean}"
echo -e " \e[32mAPR"
echo
echo "Running apr with: c-compiler:$CC $CFLAGS c++-compiler:$CXX $CXXFLAGS"
sleep 2
cd apr-1* && ./configure --prefix="$PREFIX" && apr=$(pwd) && make clean && make -j4 && sudo make install && cd ..

TL;DR: Using symbolic execution to recover driver IOCTL codes that are computed at runtime.

The goal here is to find valid IOCTL codes for the HackSysExtremeVulnerableDriver by analyzing the binary. The control flow varies between the binary and source due to compiler optimizations. This results in a situation where only a few IOCTL codes in the assembly are represented as a constant with the remaining being computed at runtime.

The code in hevd_ioctl.py is a approximation of the control flow of the compiled IrpDeviceIoCtlHandler function. The effects of the compiler optimization are more pronounced when comparing this code to the original C function. To comply with requirements of the PyExZ3 module, the target function is named after the script's filename, and the `ex

#!/bin/sh
#
# american fuzzy lop - pause a set of fuzzers
# --------------------------------------
#
# By @rantyben, based on afl-whatsup, which is:
# Written and maintained by Michal Zalewski <lcamtuf@google.com>
#
# Copyright 2015 Google Inc. All rights reserved.
#
// Launch WinAFL with current function as hook location
//@author richinseattle
//@category _NEW_
//@keybinding
//@menupath
//@toolbar
// Usage:
// Install DynamoRIO and WinAFL
// Add LaunchWinAFL to Ghidra scripts

History

@fuzzamos
fuzzamos / ghidra_processor_docs_downloader.py
Created May 25, 2019 11:55 — forked from richinseattle/ghidra_processor_docs_downloader.py
Ghidra Processor Documentation Downloader
#!/usr/bin/env python
# vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab:
import os
import requests
import sys
docs = {
'68000': {
'M68000PRM.pdf': 'https://www.nxp.com/files-static/archives/doc/ref_manual/M68000PRM.pdf',

Choco Install

Install Choco

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Install Ghidra 9.0.2

choco install ghidra
/*
VLC harness
sudo apt-get install libvlc-dev
gcc fuzz-harness-vlc.c -l vlc -o fuzz-harness-vlc
*/
#include <stdio.h>
#include <vlc/vlc.h>