溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么使用Winstrument框架

發(fā)布時(shí)間:2021-10-29 11:37:03 來(lái)源:億速云 閱讀:130 作者:iii 欄目:編程語(yǔ)言

這篇文章主要介紹“怎么使用Winstrument框架”,在日常操作中,相信很多人在怎么使用Winstrument框架問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”怎么使用Winstrument框架”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!

Winstrument

Winstrument是一款針對(duì)Windows應(yīng)用程序的評(píng)估框架,Winstrument是一個(gè)基于Frida實(shí)現(xiàn)的模塊化框架,可以幫助廣大研究人員對(duì)Windows應(yīng)用程序進(jìn)行逆向工程分析,并尋找對(duì)應(yīng)的攻擊面。

Winstrument是基于Frida實(shí)現(xiàn)的,而Frida是一個(gè)功能強(qiáng)大的動(dòng)態(tài)檢測(cè)框架,它可以通過(guò)向進(jìn)程中注入Javascript運(yùn)行時(shí)來(lái)輔助逆向工程分析和調(diào)試,而注入的運(yùn)行時(shí)提供了API來(lái)實(shí)現(xiàn)函數(shù)的掛鉤和修改。

雖然社區(qū)有很多基于Frida的工具,但是這些工具往往是一些小型的單功能腳本,很難找到一個(gè)可以用來(lái)完成逆向任務(wù)的工具。除此之外,F(xiàn)rida的結(jié)構(gòu)可能需要我們使用大量的代碼來(lái)處理回調(diào)和數(shù)據(jù),這也增加了腳本開(kāi)發(fā)的難度。

Winstrument的目標(biāo)是通過(guò)創(chuàng)建一個(gè)簡(jiǎn)單的、模塊化的框架來(lái)解決這些問(wèn)題,并輔助研究人員對(duì)Windows應(yīng)用程序進(jìn)行分析。

功能介紹

Winstrument的主要功能是通過(guò)其模塊來(lái)實(shí)現(xiàn)的,在該工具內(nèi)置模塊的幫助下,研究人員可以完成下列任務(wù):

  • 查看文件的讀取和寫(xiě)入,以及讀取或?qū)懭氲淖止?jié)大?。?/p>

  • 查看注冊(cè)表的讀取和寫(xiě)入;

  • 查看LoadLibrary()函數(shù)的調(diào)用,檢查相關(guān)的DLL加載以識(shí)別潛在的DLL劫持攻擊;

  • 查看socket活動(dòng);

  • 查看CreateProcess生成的子進(jìn)程和參數(shù);

  • 審查命名管道相關(guān)的系統(tǒng)調(diào)用;

  • 檢測(cè)注冊(cè)表中的CLSID鍵;

  • 檢測(cè)偽造進(jìn)程;

Winstrument易于擴(kuò)展,雖然其內(nèi)置模塊提供了最基本的功能,但研究人員也可以通過(guò)自定義模塊來(lái)擴(kuò)展其功能。Winstrument還附帶了一個(gè)REPL用于管理模塊、生成和檢測(cè)目標(biāo)進(jìn)程。功能列表如下:

  • 查看可用模塊;

  • 動(dòng)態(tài)加載所需的模塊;

  • 配置設(shè)置信息并以TOML格式存儲(chǔ);

  • 使用所選的模塊對(duì)目標(biāo)進(jìn)行檢測(cè),并將輸出結(jié)果存儲(chǔ)到SQLite數(shù)據(jù)庫(kù)中;

  • 以各種格式查看和導(dǎo)出數(shù)據(jù),包括table、JSON和grep-able輸出;

工具安裝

該項(xiàng)目支持Python v3.7環(huán)境,如果你已經(jīng)安裝好了Python和pip的話,可以直接使用下列命令安裝、部署和配置該工具:

pip install winstrument

接下來(lái),使用下列命令運(yùn)行該工具:

winstrument

工具使用

研究人員跟Winstrument的大多數(shù)交互都是通過(guò)REPL進(jìn)行的,下面給出的是使用Winstrument的file_rw模塊來(lái)執(zhí)行檢測(cè)的例子:

>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針對(duì)notepad檢測(cè)的輸出樣例:

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

許可證協(xié)議

本項(xiàng)目的開(kāi)發(fā)與發(fā)布遵循GPL v3開(kāi)源許可證協(xié)議。

到此,關(guān)于“怎么使用Winstrument框架”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI