新西兰服务器

Nautilus是一款什么工具


Nautilus是一款什么工具

发布时间:2021-12-26 12:02:29 来源:高防服务器网 阅读:66 作者:小新 栏目:网络管理

这篇文章给大家分享的是有关Nautilus是一款什么工具的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

Nautilus介绍

Nautilus是一款基于覆盖指引和语法的反馈式模糊测试工具,广大研究人员可以使用Nautilus来提升模糊测试过程中的测试覆盖率,以寻找到更多的安全漏洞。在Nautilus的帮助下,研究人员可以通过指定半有效的输入语法,来执行更加复杂的变异操作,并生成更多有效的测试用例。

目前,Nautilus已发布了2.0版本,该版本相较于Nautilus原型,引入了很多功能性提升,目前该工具已经100%支持AFL++了。除了稳定性和可用性提升之外,还包括下列功能提升:

  • 支持AFL-Qemu模式

  • 支持Python格式语法

  • 支持使用Python脚本生成结构化输入

  • 支持指定源码协议/格式

  • 支持指定正则表达式

  • 避免生成相似的短输入

  • 提供了更好的错误输出

  • 修复大量Bug

Nautilus工作机制

我们可以使用类似EXPR -> EXPR + EXPR、EXPR -> NUM和NUM -> 1这样的规则来指定一个语法。针对这些规则,模糊测试器将构建一个树状结构,这种内部语法表达允许支持更加复杂的变异操作。接下来,这个树状结构将会转变为针对目标应用程序的真实输入,即拼接所有的叶子节点。在下方给出的示例中,左子树将会被解析为“a=1+2”,右子树则为“a=1+1+1+2”。为了提高语法的表达能力,Nautilus还可以允许广大研究人员使用Python脚本来实现对树状结构的解析,以支持更加复杂的操作。

 

工具安装&配置

首先,广大用户需要使用下列命令将该项目源码克隆至本地,并进行基础配置:

git clone 'git@github.com:nautilus-fuzz/nautilus.git'    cd nautilus    /path/to/AFLplusplus/afl-clang-fast test.c -o test #afl-clang-fast as provided by AFL

接下来,我们需要在config.ron文件中设置好所有需要使用的参数:

cargo run --release -- -g grammars/grammar_py_example.py -o /tmp/workdir -- ./test @@

如果想要使用QEMU模式的话,可以运行下列命令:

cargo run /path/to/AFLplusplus/afl-qemu-trace -- ./test_bin @@

工具使用样例

在这里,我们可以使用Python来生成一个语法,并生成一个有效的类XML输入。需要注意的是,Python脚本的语法规则,这里必须确保匹配起始标签:

#ctx.rule(NONTERM: string, RHS: string|bytes) adds a rule NONTERM->RHS. We can use {NONTERM} in the RHS to request a recursion.    ctx.rule("START","<document>{XML_CONTENT}</document>")    ctx.rule("XML_CONTENT","{XML}{XML_CONTENT}")    ctx.rule("XML_CONTENT","")         #ctx.script(NONTERM:string, RHS: [string]], func) adds a rule NONTERM->func(*RHS).    # In contrast to normal `rule`, RHS is an array of nonterminals.    # It's up to the function to combine the values returned for the NONTERMINALS with any fixed content used.    ctx.script("XML",["TAG","ATTR","XML_CONTENT"], lambda tag,attr,body: b"<%s %s>%s</%s>"%(tag,attr,body,tag) )    ctx.rule("ATTR","foo=bar")    ctx.rule("TAG","some_tag")    ctx.rule("TAG","other_tag")         #sometimes we don't want to explore the set of possible inputs in more detail. For example, if we fuzz a script    #interpreter, we don't want to spend time on fuzzing all different variable names. In such cases we can use Regex    #terminals. Regex terminals are only mutated during generation, but not during normal mutation stages, saving a lot of time.    #The fuzzer still explores different values for the regex, but it won't be able to learn interesting values incrementally.    #Use this when incremantal exploration would most likely waste time.         ctx.regex("TAG","[a-z]+")

接下来,我们可以使用模糊测试用例生成器来测试我们刚才生成的语法:

$ cargo run --bin generator -- -g grammars/grammar_py_exmaple.py -t 100    <document><some_tag foo=bar><other_tag foo=bar><other_tag foo=bar><some_tag foo=bar></some_tag></other_tag><some_tag foo=bar><other_tag foo=bar></other_tag></some_tag><other_tag foo=bar></other_tag><some_tag foo=bar></some_tag></other_tag><other_tag foo=bar></other_tag><some_tag foo=bar></some_tag></some_tag></document>

除此之外,我们还可以结合AFL来使用Nautilus。使用“-o”参数来指向AFL到同一工作目录,而AFL则会将数据跟Nautilus同步。在这里,AFL将导入Nautilus的输入:

#Terminal/Screen 1    ./afl-fuzz -Safl -i /tmp/seeds -o /tmp/workdir/ ./test @@         #Terminal/Screen 2    cargo run --release -- -o /tmp/workdir -- ./test @@

感谢各位的阅读!关于“Nautilus是一款什么工具”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

[微信提示:高防服务器能助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

[图文来源于网络,不代表本站立场,如有侵权,请联系高防服务器网删除]
[