[go: nahoru, domu]

Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 637 Bytes

challenge-45.md

File metadata and controls

28 lines (23 loc) · 637 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