Skip to content

Commit

Permalink
Add build script to unicorn. Improve docs for unicorn and qiling (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
muji-4ok authored and KurSh committed Jun 6, 2022
1 parent 3b72ef2 commit 9f79dd4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Examples/Crusher/Linux/qiling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
Необходимо дополнительно установить поддержку qiling/unicorn в python фаззера, см. пункт _Частичная
эмуляция с помощью Unicorn/Qiling_ в документации к Crusher.

## Описание

Этот пример демонстрирует фаззинг с использованием unicorn-mode и qiling. Причем qiling внутри использует unicorn-mode и
просто является более продвинутой оберткой, но взаимодействие с фаззером ровно такое же.

## Лицензия

Данный пример взят из [репозитория qiling](https://github.com/qilingframework/qiling), поэтому тоже
поставляется под лицензией GPL2

26 changes: 25 additions & 1 deletion Examples/Crusher/Linux/unicorn/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
## Установка

Необходимо дополнительно установить поддержку qiling/unicorn в python фаззера, см. пункт _Частичная
эмуляция с помощью Unicorn/Qiling_ в документации к Crusher.
эмуляция с помощью Unicorn/Qiling_ в документации к Crusher.

Также нужно запустить скрипт установки - `build.sh`

## Фаззинг с помощью unicorn

Инструментация работает ровно как статическая инструментация с форк сервером - запускается программа "обертка" (harness),
которая работает с измененным unicorn, который перед запуском включает форк сервер и таким образом общается
с фаззером.

Фундаментальной разницы нет на каком языке написана обертка, важно лишь то что она использует API, в котором реализован
протокол форк сервера.

## unicorn/c

Пример показывает как работает API unicorn-mode для языка c.

## unicorn/compcov_x64

Пример показывает как работает API unicorn-mode для языка Python 3.

## Замечание

Данный пример взят из [репозитория AFLplusplus](https://github.com/AFLplusplus/AFLplusplus/tree/stable/unicorn_mode)

19 changes: 19 additions & 0 deletions Examples/Crusher/Linux/unicorn/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

if [[ "$#" -ne 2 ]]; then
echo "Error: not enough arguments"
echo "Usage: ./build.sh -f <path/to/crusher/bin_x86-64>"
exit 1
fi

echo "Building Unicorn examples"
echo "Note: assuming qiling/unicorn module is installed"

export UNICORNAFL_DIR="$(readlink -e "$2/unicornafl")"

cd c
make clean
make

cd ..

0 comments on commit 9f79dd4

Please sign in to comment.