我是一名硕士生,致力于复制论文的结果:https://www.microsoft.com/en-us/research/publication/not-all-bytes-are-equal-neural-byte-sieve-for-fuzzing/
我想创建一个增强型模糊器,它拒绝对它认为无用的种子进行修改。实现这一目标的任何帮助都将非常有帮助。
我为增强模糊器创建了一个简单的 python 函数。为了测试实现,我采用了简单的“deadbeef”程序并编写了 python 函数,这样每当种子被修改为“deadbeef”时,该函数就会向 AFL 的“common_fuzz_stuff()”函数发送一个“无用”的返回值- 模糊代码。这应该意味着模糊器不应该能够找到崩溃。但它仍然能够找到崩溃,我无法确定哪里出了问题。
这是 AFL 的 python 函数:
def check_useful(seed):
my_string = str.encode('deadbeef')
file = open(seed, 'rb')
value = file.read()
if (value == my_string):
print('[*] Crash Found!')
return True
else:
return False
这是 afl-fuzz.c 代码片段:
/* Write a modified test case, run program, process results. Handle
error conditions, returning 1 if it's time to bail out. This is
a helper function for fuzz_one(). */
EXP_ST u8 common_fuzz_stuff(char** argv, u8* out_buf, u32 len) {
if (PyCallable_Check(pFuncCheckModel)){
pArgs = PyTuple_New(1);
PyTuple_SetItem(pArgs, 0, PyUnicode_FromString(queue_cur->fname));
pFuncReturn = PyObject_CallObject(pFuncCheckModel, pArgs);
if (PyObject_IsTrue(pFuncReturn)){
skip_requested = 1;
return 1;
}
} else
{
PyErr_Print();
}
即使种子“deadbeef”的 common_fuzz_stuff() 函数的返回值为 1,我的程序如何仍然能够找到崩溃?
最佳答案
如果您决定此输入是否有用仅取决于输入本身(而不是突变),据我所知,您可以使用experimental/post_library
东西。该文档包含在示例 post_library 中,并包含一条注释,这可能不是您想要的——不是您的特定需要,这是该文档的近似引用。 :)
另一方面,此单功能 API 描述包含以下内容:
2) If you want to skip this test case altogether and have AFL generate a
new one, return NULL. Use this sparingly - it's faster than running
the target program with patently useless inputs, but still wastes CPU
time.
关于python - 如何创建跳过某些种子的增强型 AFL 模糊器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54277963/