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

인기 글

태그

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

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
vared

vared - Blog

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

    티스토리툴바