-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from gfarida/java
java
- Loading branch information
Showing
7 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Общее описание | ||
|
||
Этот пример показывает фаззинг JAVA приложения | ||
|
||
# Инструментация проекта | ||
В системе должна быть установлена JAVA 8 версии. Если Ваш проект не принимает на вход файл, то необходимо написать driver, | ||
на вход которому передается файл с данными, а он в свою очередь запускает JAVA приложение, которое Вы хотите фаззить. | ||
|
||
В данном примере скомпилированный driver и jar файл с проектом находятся в директории `target`. | ||
|
||
Находясь в данной директории, запустите скрипт ./instrumentation.sh для инструментации приложения(driver-а) и используемых библиотек, | ||
он принимает один аргумент - путь до jar файла `kelinci.jar` с классами для запуска инструментации JAVA приложения. | ||
|
||
# Фаззинг | ||
|
||
Находясь в данной директории, запустите скрипт `./fuzz.sh`; | ||
он принимает один аргумент - путь до `fuzz_manager`. | ||
|
||
Запустите в другом терминале `UI` фаззера (укажите актуальные пути): | ||
```shell | ||
/path/to/crusher/bin_x86-64/ui --outdir /path/to/out | ||
``` | ||
|
||
Как только будут найдены аварийные завершения, значение поля `unique_crashes` (в окне `UI` - наверху справа) станет ненулевым. | ||
|
||
Прервать фаззинг (в первом терминале, `Ctrl + С`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$#" -ne 1 ]]; then | ||
echo "Usage: ./fuzz.sh <path/to/fuzz_manager>" | ||
exit 1 | ||
fi | ||
|
||
FUZZ_MAN=$1 | ||
|
||
$FUZZ_MAN --start 4 -i in -o out -F -I java --instrumented-class test -- ./bin-instr:./target/commons-math3-3.6.1-instr.jar __DATA__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 12 23 67 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$#" -ne 1 ]]; then | ||
echo "Usage: ./instrumentation.sh <path/to/kelinci.jar>" | ||
exit 1 | ||
fi | ||
|
||
KELINCI=$1 | ||
|
||
mkdir bin | ||
cp target/test.class bin/test.class | ||
|
||
echo "instrument project" | ||
/usr/bin/java -cp ${KELINCI} edu.cmu.sv.kelinci.instrumentator.Instrumentor \ | ||
-i target/commons-math3-3.6.1.jar -o target/commons-math3-3.6.1-instr.jar | ||
|
||
/usr/bin/java -cp ${KELINCI}:target/commons-math3-3.6.1-instr.jar edu.cmu.sv.kelinci.instrumentator.Instrumentor -i bin -o bin-instr | ||
|
Binary file not shown.
Binary file not shown.