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

인기 글

태그

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

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
vared

vared - Blog

Challenge 26 (100pt)
WriteUp/Webhacking.kr

Challenge 26 (100pt)

2020. 5. 10. 11:52
<?php
  include "../../config.php";
  if($_GET['view_source']) view_source();
?><html>
<head>
<title>Challenge 26</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }    
a { color:lightgreen; }
</style>
</head>
<body>
<?php
  if(preg_match("/admin/",$_GET['id'])) { echo"no!"; exit(); }
  $_GET['id'] = urldecode($_GET['id']);
  if($_GET['id'] == "admin"){
    solve(26);
  }
?>
<br><br>
<a href=?view_source=1>view-source</a>
</body>
</html>

Get['id'] 값이 admin이면 문제가 풀린다.

그대로 admin을 넣어주게 되면, if문의 preg_match에서 걸린다.

$_GET['id'] 를 urlencode 해준다. urlencode 해준 값이 admin이 되어야 하기 때문에

url encoding table

admin=%61%64%6d%69%6e 이다. 

이걸 한번 더 인코딩 해주기 때문에, %61%64%6d%69%6e를 변환해서 

?id=%2561%2564%256d%2569%256e 이렇게 넣어주면 된다.

 

clear!

저작자표시 (새창열림)

'WriteUp > Webhacking.kr' 카테고리의 다른 글

webhacking.kr : challenge 4  (0) 2020.09.11
challenge 57 (600pt)  (0) 2020.08.15
Challenge 18 (100pt)  (0) 2020.05.10
Challenge 38 (100pt)  (0) 2020.05.08
Challenge 15 (old) _50pt  (0) 2020.05.07
    'WriteUp/Webhacking.kr' 카테고리의 다른 글
    • challenge 57 (600pt)
    • Challenge 18 (100pt)
    • Challenge 38 (100pt)
    • Challenge 15 (old) _50pt
    vared
    vared

    티스토리툴바