温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么使用Winstrument框架

发布时间:2021-10-29 11:37:03 来源:亿速云 阅读:128 作者:iii 栏目:编程语言

这篇文章主要介绍“怎么使用Winstrument框架”,在日常操作中,相信很多人在怎么使用Winstrument框架问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么使用Winstrument框架”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

Winstrument

Winstrument是一款针对Windows应用程序的评估框架,Winstrument是一个基于Frida实现的模块化框架,可以帮助广大研究人员对Windows应用程序进行逆向工程分析,并寻找对应的攻击面。

Winstrument是基于Frida实现的,而Frida是一个功能强大的动态检测框架,它可以通过向进程中注入Javascript运行时来辅助逆向工程分析和调试,而注入的运行时提供了API来实现函数的挂钩和修改。

虽然社区有很多基于Frida的工具,但是这些工具往往是一些小型的单功能脚本,很难找到一个可以用来完成逆向任务的工具。除此之外,Frida的结构可能需要我们使用大量的代码来处理回调和数据,这也增加了脚本开发的难度。

Winstrument的目标是通过创建一个简单的、模块化的框架来解决这些问题,并辅助研究人员对Windows应用程序进行分析。

功能介绍

Winstrument的主要功能是通过其模块来实现的,在该工具内置模块的帮助下,研究人员可以完成下列任务:

  • 查看文件的读取和写入,以及读取或写入的字节大小;

  • 查看注册表的读取和写入;

  • 查看LoadLibrary()函数的调用,检查相关的DLL加载以识别潜在的DLL劫持攻击;

  • 查看socket活动;

  • 查看CreateProcess生成的子进程和参数;

  • 审查命名管道相关的系统调用;

  • 检测注册表中的CLSID键;

  • 检测伪造进程;

Winstrument易于扩展,虽然其内置模块提供了最基本的功能,但研究人员也可以通过自定义模块来扩展其功能。Winstrument还附带了一个REPL用于管理模块、生成和检测目标进程。功能列表如下:

  • 查看可用模块;

  • 动态加载所需的模块;

  • 配置设置信息并以TOML格式存储;

  • 使用所选的模块对目标进行检测,并将输出结果存储到SQLite数据库中;

  • 以各种格式查看和导出数据,包括table、JSON和grep-able输出;

工具安装

该项目支持Python v3.7环境,如果你已经安装好了Python和pip的话,可以直接使用下列命令安装、部署和配置该工具:

pip install winstrument

接下来,使用下列命令运行该工具:

winstrument

工具使用

研究人员跟Winstrument的大多数交互都是通过REPL进行的,下面给出的是使用Winstrument的file_rw模块来执行检测的例子:

>winstrument

> list

Loaded Modules:

Available Modules:

dlls

com_hijack

file_rw

process

pipes

impersonate

registry

socket

> use file_rw

> set target "C:\Windows\System32\mspaint.exe"

> run

Spawned 7720

instrumented process with pid: 7720 and path: C:\Windows\System32\mspaint.exe

detached from 7720 for reason process-terminated

 

module    time                 target              function    fh      path                                                                                                                     mode             bytes

--------  -------------------  ------------------  ----------  ------  -----------------------------------------------------------------------------------------------------------------------  -------------  -------

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x4d4   C:\Windows\Fonts\staticcache.dat                                                                                         GENERIC_READ        60

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x60c   C:\WINDOWS\Registration\R000000000001.clb                                                                                GENERIC_READ      5941

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x6d4   C:\Users\oster\AppData\Local\IconCache.db                                                                                GENERIC_READ    140547

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x75c   \\.\MountPointManager                                                                                                    0x0                174

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x768   C:\Users                                                                                                                 0x100081           504

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x798   C:\Users\oster\Desktop\desktop.ini                                                                                       GENERIC_READ      2070

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x7d8   C:\Users\oster\Pictures\Camera Roll\desktop.ini                                                                          GENERIC_READ       570

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x87c   C:\Users\Public\Desktop\desktop.ini                                                                                      GENERIC_READ       174

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x8d4   C:\Users\oster\Dropbox\desktop.ini                                                                                       GENERIC_READ       176

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x908   C:\                                                                                                                      0x100081           402

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x914   C:\                                                                                                                      0x100081           298

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0xd28   C:\Users\oster\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations\f01b4d95cf55d32a.automaticDestinations-ms  GENERIC_READ    294329

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0xddc   C:\Users\oster\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations\f01b4d95cf55d32a.automaticDestinations-ms  GENERIC_READ     90728

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  ReadFile    0x5f4   C:\Users\oster\Pictures\Untitled.png                                                                                     GENERIC_READ        40

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  WriteFile   0x450   C:\WINDOWS\Debug\WIA\wiatrace.log                                                                                        GENERIC_WRITE     2940

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  WriteFile   0xebc   \\.\MountPointManager                                                                                                    0x0               5941

file_rw   2020-07-10 20:57:30  C:/.../mspaint.exe  WriteFile   0x1010  C:\Users\oster

下面给出的是Winstrument针对notepad检测的输出样例:

Spawned 31076

instrumented process with pid: 31076 and path: C:\Windows\System32\notepad.exe

Child removed: 31076

instrumented process with pid: 53004 and path: C:\Users\oster\AppData\Local\Temp\frida-69a0a581de60aa12d04f3bc2e3bde82d\frida-winjector-helper-32.exe

Child removed: 53004

instrumented process with pid: 33820 and path: C:\Users\oster\AppData\Local\Temp\frida-69a0a581de60aa12d04f3bc2e3bde82d\frida-winjector-helper-32.exe

Child removed: 33820

instrumented process with pid: 31092 and path: C:\Users\oster\AppData\Local\Temp\frida-69a0a581de60aa12d04f3bc2e3bde82d\frida-winjector-helper-64.exe

Child removed: 31092

detached from 31076 for reason process-terminated

 

module    time                 target                                dll                                              writeable_path

--------  -------------------  ------------------------------------  -----------------------------------------------  ------------------------------------------------------------------------------------------------------

dlls      2020-07-10 22:54:48  C:/.../winstrument.exe                ntdll.dll                                        C:\Python38\Scripts

dlls      2020-07-10 22:54:48  c:/.../python.exe                     pywintypes38.dll                                 c:\python38\lib\site-packages\pywin32_system32\pywintypes38.dll

dlls      2020-07-10 22:54:48  c:/.../python.exe                     pythoncom38.dll                                  c:\python38

dlls      2020-07-10 22:54:48  c:/.../python.exe                     frida-winjector-helper-32.exe                    C:\Users\oster\AppData\Local\Temp\frida-69a0a581de60aa12d04f3bc2e3bde82d\frida-winjector-helper-32.exe

dlls      2020-07-10 22:54:48  C:/.../frida-winjector-helper-32.exe  iphlpapi.dll                                     C:\Users\oster\AppData\Local\Temp\frida-69a0a581de60aa12d04f3bc2e3bde82d

dlls      2020-07-10 22:54:48  C:/.../notepad.exe                    frida-agent.dll

许可证协议

本项目的开发与发布遵循GPL v3开源许可证协议。

到此,关于“怎么使用Winstrument框架”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI