Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 547 Bytes

challenge-31.md

File metadata and controls

27 lines (23 loc) · 547 Bytes

Challenge

<?php
if(isset($_GET) && !empty($_GET)){
    $url = $_GET['file'];
    $path = 'upload/'.$_GET['path'];
}else{
    show_source(__FILE__);
    exit();
}
 
if(strpos($path,'..') > -1){
    die('SYCwaf!');
}
 
if(strpos($url,'http://127.0.0.1/') === 0){
    file_put_contents($path, file_get_contents($url));
    echo "console.log($path update successed!)";
}else{
    echo "Hello.Geeker";
}

Solution

Refference