-
在pyrebox.conf中有一个
mw_monitor.mw_monitor: False
的参数,将其设为True -
将mw_monitor/config_examples中的两个配置文件复制到pyrebox.conf所在的文件夹下
-
将生成的500MB的数据库文件deviare32_populated.sqlite替换掉原有的50MB的mw_monitor/third_party/deviare2_db/文件夹下的数据库文件
-
修改mw_monitor.conf的数据库配置路径,
[general]
中的output_bundle
参数是输出的结果的名字,api_database
是上面的.sqlite数据库的地址[general] output_bundle: bundle.tar.gz api_database: mw_monitor/third_party/deviare2_db/deviare32_populated.sqlite [interproc] bin_log_name: interproc.bin text_log_name: interproc.log basic_stats_name: basic_stats [api_tracer] text_log_name: function_calls.log bin_log_name: function_calls.bin [coverage] cov_log_name: coverage.bin cov_text_name: coverage.log [dumper] path = dumper/
-
修改mw_monitor_run.json配置文件,其中
api_tracer
的light_mode
参数决定是以轻量级运行api tracer还是正常运行api tracer,light模式会快很多;bin_log
参数是决定是否记录二进制日志,text_log
决定是否记录文本格式的日志。下面的general
中的参数:files_path
是Guest Agent拷贝可执行文件(或dll)到虚拟机中的目标文件夹;main_executable
是解压出来的可执行文件的名字,就是zip文件里面压缩的文件的名字,不要自己另取一个名字,不然会无法执行;files_bundle
是Ubuntu上想拷贝到虚拟机中的zip文件的路径;modules
参数可以控制是否执行这四个模块:{ "api_tracer": { "bin_log": false, "exclude_apis": [], "exclude_modules": [], "exclude_origin_modules": [], "include_apis": [], "light_mode": true, "procs": null, "text_log": true }, "coverage": { "procs": null }, "dumper": { "dump_at": "kernel32.dll!CopyFileA", "dump_on_exit": false }, "general": { "files_path": "C:\\", "main_executable": "malware.exe", "files_bundle": "malware/malware.zip" }, "interproc": { "basic_stats": true, "bin_log": true, "text_log": true }, "modules": { "api_tracer": true, "coverage": false, "dumper": false, "interproc": false } }
-
只有运行完后卸载模块才会输出api tracer的结果,直接按q是直接退出,不会生成结果。具体做法:先在qemu命令行中
list_modules
,然后看到mw_monitor对应的Hdl序号(一般是2),然后使用命令unload_module 2
卸载脚本,pyrebox就会生成结果并保存在pyrebox.conf所在的文件夹下
具体运行流程(正常模式下),和light模式的区别就是多了一行加载API tracer数据库的提示:
api tracer的light mode要快很多,正常mode运行一个程序会一直卡着,很慢
比如说将计算器作为malware.exe传入pyrebox虚拟机中运行,light模式下2分钟就能将计算器启动运行出界面并运算;而正常模式要等15分钟才出现计算器等界面,如图,然后一个个地加载计算器的按钮
最后生成结果,根据上面的设置得出的结果中有三个文件,分别是生成的二进制格式调用日志function_calls.bin、文本格式调用日志function_calls.log和json配置文件mw_monitor_run.json。
light模式一下就生成了结果。
正常模式还是很慢,要3分钟,主要是function_calls.bin太大,有1.4G。