Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 457 Bytes

challenge-61.md

File metadata and controls

19 lines (16 loc) · 457 Bytes

Challenge

 <?php
    $sandbox = "sandbox/" . md5("orange" . $_SERVER["REMOTE_ADDR"]);
    @mkdir($sandbox);
    @chdir($sandbox);

    $data = shell_exec("GET " . escapeshellarg($_GET["url"]));
    $info = pathinfo($_GET["filename"]);
    $dir  = basename($info["dirname"]);
    @mkdir($dir);
    @chdir($dir);
    @file_put_contents(basename($info["basename"]), $data);
    highlight_file(__FILE__);

Refference

  • hitcon ctf 2017 SSRFme?