我正在尝试学习模糊测试未知协议的复杂性,以查找应用程序中的漏洞。我正在使用一个众所周知的易受攻击的应用程序 Disk Savvy Enterprise 10.4.18,其中有一个已知的 SEH 缓冲区溢出。
我目前有一个boofuzz脚本,我正在尝试使用该process_monitor.py脚本,但无法重新启动崩溃的服务。我process_monitor.py在目标机器上运行该脚本,并成功从模糊测试机器连接到该脚本。我的问题是问题标题中的错误——当应用程序崩溃时,它会“尝试”重新启动该进程,但我收到错误
process_monitor.py
PED-RPC> remote method restart_target cannot be found
我的python脚本的相关部分是:
session = sessions.Session( crash_threshold="10000", # Arbitrary, high crash threshold check_data_received_each_request=0, # Don't check data after every request (slow) restart_sleep_time=0.1, sleep_time=0.1, ) # Define target target = sessions.Target( connection = SocketConnection(dst, dport, proto='tcp') ) # Define procmon options target.procmon = pedrpc.Client(dst, 26002) target.procmon_options = { "proc_name" : "disksvs.exe", "stop_commands" : ['net stop "Disk Savvy Enterprise"'], "start_commands" : ['net start "Disk Savvy Enterprise"'] }
我process_monitor.py在目标机器上开始执行以下行:
python process_monitor.py --port 26002 --crash_bin diskSaavy_Crashes.txt
以下是启动后和崩溃后的输出结果:
Couldn't import dot_parser, loading of dot files will not be possible. [03:11.00] Process Monitor PED-RPC server initialized: [03:11.00] crash file: C:\Python27\Lib\site-packages\boofuzz\diskSaavy_Crashes.txt [03:11.00] # records: 3 [03:11.00] proc name: None [03:11.00] log level: 1 [03:11.00] awaiting requests... [03:23.29] updating target process name to 'disksvs.exe' [03:23.30] updating stop commands to: ['net stop "Disk Savvy Enterprise"'] [03:23.30] updating start commands to: ['net start "Disk Savvy Enterprise"'] [03:23.30] debugger thread-1523215410 looking for process name: disksvs.exe [03:23.42] debugger thread-1523215410 found match on pid 2908 [03:23.48] updating target process name to 'disksvs.exe' [03:23.48] updating stop commands to: ['net stop "Disk Savvy Enterprise"'] [03:23.48] updating start commands to: ['net start "Disk Savvy Enterprise"'] [03:23.49] debugger thread-1523215410 caught access violation: 'libpal.dll:004a9 19f movsx ebp,[eax+ebx] from thread 2424 caused access violation' [03:23.49] debugger thread-1523215410 exiting PED-RPC> remote method restart_target cannot be found
以下是我的模糊测试机器上针对同一次崩溃的 boofuzz 的输出:
[2018-04-08 15:23:49,996] Test Step: Failure summary [2018-04-08 15:23:49,996] Info: procmon detected crash on test case #2: libpal.dll:004a919f movsx ebp,[eax+ebx] from thread 2424 caused access violation [2018-04-08 15:23:49,996] Test Step: restarting target [2018-04-08 15:23:49,996] Info: restarting target process [2018-04-08 15:23:50,206] Error!!!! Restarting the target failed, exiting. Traceback (most recent call last): File "./boofuzz-diskSaavy.py", line 72, in <module> main() File "./boofuzz-diskSaavy.py", line 17, in main fuzz(dst, dport) File "./boofuzz-diskSaavy.py", line 69, in fuzz session.fuzz() File "/usr/local/lib/python2.7/dist-packages/boofuzz/sessions.py", line 414, in fuzz self._fuzz_current_case(*fuzz_args) File "/usr/local/lib/python2.7/dist-packages/boofuzz/sessions.py", line 893, in _fuzz_current_case self._process_failures(target=target) File "/usr/local/lib/python2.7/dist-packages/boofuzz/sessions.py", line 603, in _process_failures self.restart_target(target) File "/usr/local/lib/python2.7/dist-packages/boofuzz/sessions.py", line 680, in restart_target raise sex.BoofuzzRestartFailedError() boofuzz.sex.BoofuzzRestartFailedError
我尝试过不同的变体start_commands,既不发送proc_name也不发送stop_commands,并在运行时process_monitor.py指定不同的start_commands,例如在服务名称周围包含完整的路径net.exe和不同的引号转义符等。到目前为止,我尝试过的所有方法均无效。
start_commands
proc_name
stop_commands
net.exe
查看sessions.py和pedrpc.py其他多个文件,我发现__getattr__正用于处理方法调用,但据我所见,restart_target存在于 中sessions.py,所以我不确定为什么 PEDRPC 会说找不到 restart_target……我快要抓狂了。boofuzz 正在做我想要它做的一切,除了重启。
sessions.py
pedrpc.py
__getattr__
restart_target
如果这还不够的话,我可以提供更多信息,并且我将非常感激任何能得到的帮助。
TL;DR 该方法不存在,因为process_monitor.py已过时;从boofuzz下载最新副本并重试。
感谢您在问题中提供详尽的调试信息。如果 process_monitor.py 打印了堆栈跟踪,那么包括它也会有所帮助。:)
我在代码库中搜索了“PED-RPC> remote”,并在boofuzz/pedrpc.py第 2 行 ( permalink ) 找到了它:
boofuzz/pedrpc.py
sys.stderr.write('PED-RPC> remote method "{0}" of {1} cannot be found\n'.format(method_name, self))
注意输出中存在的细微差别of {1}。这表明您的 process_monitor.py 来自旧版本的 boofuzz。git blame显示此更改发生在e4723204d43bd758077f56df419af1c7c7424f14处,它首次包含在 v0.0.8 中。
of {1}
git blame
下载最新版本process_monitor.py应该就可以了。