我们正在使用boofuzz通过 tcp 协议对远程服务进行模糊测试。模糊器脚本如下。
session = Session(target = Target(connection = SocketConnection(host, port, proto='tcp')))
s_initialize("Test")
s_string("Fuzz", fuzzable = True)
session.connect(s_get("Test"))
session.fuzz()
过了一会儿,我们注意到远程服务崩溃了,但模糊器只是反复尝试重新启动。fuzzer 没有检测到远程服务被关闭并且崩溃的测试用例没有被存储。
[2022-02-02 04:18:42,231] Test Step: Restarting target
[2022-02-02 04:18:42,231] Info: Restarting target process using CallbackMonitor
[2022-02-02 04:18:42,231] Test Step: Cleaning up connections from callbacks
[2022-02-02 04:18:42,231] Info: Closing target connection...
[2022-02-02 04:18:42,231] Info: Connection closed.
[2022-02-02 04:18:42,231] Info: No reset handler available... sleeping for 5 seconds
[2022-02-02 04:18:47,236] Info: Opening target connection (xxx)...
[2022-02-02 04:18:47,237] Info: Cannot connect to target; retrying. Note: This likely indicates a failure caused by the previous test case, or a target that is slow to restart.
[2022-02-02 04:18:47,237] Test Step: Restarting target
[2022-02-02 04:18:47,237] Info: Restarting target process using CallbackMonitor
[2022-02-02 04:18:47,237] Test Step: Cleaning up connections from callbacks
[2022-02-02 04:18:47,237] Info: Closing target connection...
[2022-02-02 04:18:47,237] Info: Connection closed.
[2022-02-02 04:18:47,237] Info: No reset handler available... sleeping for 5 seconds
[2022-02-02 04:18:52,243] Info: Opening target connection (xxx)...
[2022-02-02 04:18:52,244] Info: Cannot connect to target; retrying. Note: This likely indicates a failure caused by the previous test case, or a target that is slow to restart.
我们如何自定义 boofuzz 脚本,以便:
- 我们可以检测到远程服务是否关闭(例如,尝试 tcp connect)?
- 我们可以将未截断的崩溃测试用例存储到磁盘吗?