1. 程式人生 > 其它 >“百度杯”CTF比賽 2017 二月場---爆破-1

“百度杯”CTF比賽 2017 二月場---爆破-1

題目型別       Misc Web

 

開啟連結

 

進行程式碼審計,這個程式碼的作用是如果匹配正則表示式/^\w*/,就打印变量 /,就打印变量" role="presentation" style="box-sizing: border-box;outline: 0px;overflow-wrap: break-word; max-width: none;max-height: none;min-width: 0px;min-height: 0px;float:none; word-spacing:normal" id="MathJax-Element-1-Frame">/,就列印變數/,就列印變數/,就列印變數$a
a是hello, a是hello," role="presentation" style="box-sizing: border-box;outline: 0px;overflow-wrap: break-word; max-width: none;max-height: none;min-width: 0px;min-height: 0px;float:none; word-spacing:normal" id="MathJax-Element-2-Frame">a是hello,a是hello,a是hello,a是六位變數a是六位變數a是六位變數hello
由於$a在函式中,所以函式之外無法訪問。如果要訪問,將hello修改為超全域性變數GLOBALS。
在URL後加?hello=GLOBALS,將引數hello修改為Globals

 

獲取到flag,提交