{"id":18292090,"url":"https://github.com/seemoo-lab/virtfuzz","last_synced_at":"2025-04-12T10:38:03.077Z","repository":{"id":240220978,"uuid":"670214303","full_name":"seemoo-lab/VirtFuzz","owner":"seemoo-lab","description":"VirtFuzz is a Linux Kernel Fuzzer that uses VirtIO to provide inputs into the kernels subsystem. It is built with LibAFL.","archived":false,"fork":false,"pushed_at":"2024-06-07T15:16:12.000Z","size":23253,"stargazers_count":119,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-26T05:33:12.585Z","etag":null,"topics":["fuzzing","libafl","linux-kernel"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seemoo-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-24T14:41:17.000Z","updated_at":"2025-03-14T10:01:51.000Z","dependencies_parsed_at":"2024-12-22T23:40:31.511Z","dependency_job_id":"89bb72a3-c256-4463-a396-06306c82c120","html_url":"https://github.com/seemoo-lab/VirtFuzz","commit_stats":null,"previous_names":["seemoo-lab/virtfuzz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seemoo-lab%2FVirtFuzz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seemoo-lab%2FVirtFuzz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seemoo-lab%2FVirtFuzz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seemoo-lab%2FVirtFuzz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seemoo-lab","download_url":"https://codeload.github.com/seemoo-lab/VirtFuzz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248555503,"owners_count":21123916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuzzing","libafl","linux-kernel"],"created_at":"2024-11-05T14:16:42.027Z","updated_at":"2025-04-12T10:38:03.042Z","avatar_url":"https://github.com/seemoo-lab.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VirtFuzz\nVirtFuzz is a Linux Kernel Fuzzer that uses VirtIO to provide inputs into the kernels subsystem. It is built with [LibAFL](https://github.com/AFLplusplus/LibAFL).\n\nRead our paper:\nSönke Huster, Matthias Hollick, Jiska Classen: \"[To Boldly Go Where No Fuzzer Has Gone Before: Finding Bugs in Linux’ Wireless Stacks through VirtIO Devices](https://doi.ieeecomputersociety.org/10.1109/SP54263.2024.00024)\". 45th IEEE Symposium on Security and Privacy (S\u0026P), 2024.\n\n# Instructions\n\n## Requirements\n* Rust with the cargo toolchain\n* Patched QEMU\n* Image for VM\n* Patched Kernel\n\n### Patched QEMU\nPlease see QEMUs requirements for building [here](https://wiki.qemu.org/Hosts/Linux#Building_QEMU_for_Linux).\nQEMU with our universal VirtIO device is built as follows:\n\n    curl https://download.qemu.org/qemu-8.2.2.tar.xz -o qemu.tar.xz\n    tar xvJf qemu.tar.xz\n    mv qemu-8.2.2 qemu\n    cd qemu\n    patch -p1 \u003c $SCRIPT_DIR/../qemu-patch.patch\n    mkdir build\n    cd build\n    ../configure --target-list=x86_64-softmmu\n    make -j$(nproc)\n\n### Debian Image for the VM\nThis script is adopted from [Syzkaller](https://github.com/google/syzkaller/blob/master/tools/create-image.sh). To generate a guestimage for the VM, run the following:\n\n    cd guestimage\n    ./create-image.sh -d stretch\n    \n### Patched Kernel\nFinally, VirtFuzz requires a patched kernel. Therefore, pull a kernel version and apply our patches.\nFor example:\n\n    git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git\n    cd linux\n    git checkout v6.0\n    ../virtfuzz/kernel-patches/apply.sh\n    # Depending on the target, apply the patches to annotate for a specific device\n    ../virtfuzz/kernel-patches/annotate-80211.sh\n    \n    # Make the config\n    make x86_64_defconfig\n    make kvm_guest.config\n    scripts/kconfig/merge_config.sh -m .config ../virtfuzz/kernel-config/base.config\n    \n    # For example enable KASAN\n    scripts/kconfig/merge_config.sh -m .config ../virtfuzz/kernel-config/kasan.config\n    make olddefconfig\n    make -j$(nproc)\n\n## Usage\nThe following programs exist:\n\n* virtfuzz-fuzz - the fuzzer\n* virtfuzz-proxy - the proxy\n* virtfuzz-replay - several utility scripts to e.g. minimize and replay crashes\n\n### Fuzzer\nSee `cargo run --release --bin virtfuzz-fuzz` for all options.\nFor example, to fuzz the WLAN stack compiled in the requirements, run the following:\n\n    export QEMU=PATH_TO-qemu-system-x86_64\n    export IMAGE=guestimage/stretch.img\n    export KERNEL=PATH_TO/linux/arch/x86/boot/bzImage\n    cargo run --release --package virtfuzz-fuzz -- --device-definition device-definitions/hwsim-scan.json --cores 0-1 --stages standard\n\nNow, the fuzzer runs two instances on the 802.11 stack through the mac802.11_hwsim driver.\n\nRun `cargo run --release --package virtfuzz-fuzz -- --help` to see all available options.\n\n#### Fuzzing Options\nDuring the development, several options to support fuzzing where introduced. We'll explain selected ones here in the following:\n\n##### Choosing a target\nBy now, a JSON file with a device definition can be passed to our fuzzer with the argument `--device-definition`. Still, pre-built device definitions can be used instead, using the `--device` argument.\n\n```\n-d, --device \u003cDEVICE\u003e\n      Device that should be fuzzed\n      \n      [possible values: bluetooth, bluetooth-scan, net, wifi-scan, wifi-ap, wifi-ibss, wifi-syzkaller, console, input]\n\n  --device-definition \u003cDEVICE_DEFINITION\u003e\n      A JSON device defintion to be used instead of --device\n```\n\n##### Tracking comparisons\nThe argument `--stages` chooses the kind of coverage that should be used: Either AFL-Map style (standard) or tracking comparisons (cmplog).\n```\n-s, --stages \u003cSTAGES\u003e\n      Stages to be used\n      \n      [possible values: standard, cmplog]\n```\n\n##### Quirks\nSome subsystems, e.g., the Bluetooth subsystem, usually exchange some messages for initialization with the hardware before being fully available. To speed up fuzzing, a PCAP file with such a recorded initialization can be provided. When the VM starts, the fuzzer first sends the messages from the PCAP file before starting to fuzz. See our recorded example in `resources/setup.pcap`.\n```\n--init-path \u003cINIT_PATH\u003e\n  Path to a PCAP file containing the initialization sequence\n```\n\nSimilarly, wait until the VM sends a first frame before starting to fuzz.\n```\n--wait-for-rx\n  Start fuzzing after receiving a frame from the VM\n```\n\nIf the VM  sends a command, the fuzzer fakes a command complete message when provided with the following argument.\n```\n--bt-fake-cc\n  Respond to Bluetooth commands with dummy command complete frames\n```\n\n# History\nOur fuzzer evolved from a Linux Kernel fuzzer purely focused on the Bluetooth stack to a more universal kernel fuzzer.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseemoo-lab%2Fvirtfuzz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseemoo-lab%2Fvirtfuzz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseemoo-lab%2Fvirtfuzz/lists"}