Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

File Upload Issue (Found Image Backdoor)

Please look at this code - https://gyazo.com/f292c173dbebccde90b1a8b4cd02b7ea

whcih i found in one of the web server and that site is using some FILE UPLOAD functionality and someone uploaded a valid .GIF file and when i extracted that gif file with the help of Notepad and then i found a file upload backdooring code in the middle of the file.

So my question is, how a hacker can execute this backdooring code even that file upload code is very much secured.
The code will be executed when the image is loaded. Have a look at some other examples to understand how this works.

https://hackerone.com/reports/135072
https://secgeek.net/bookfresh-vulnerability/
[Image: 4YPLYme.gif]

I already read that links, and i tried to open that .GIF file in my browser and it actually displays a image but i'm unable to execute that PHP code.

I tried all best possible ways like .gif.php, .php.gif, .gif.php2, .gif.php3, .php etc
(Aug 23, 2017 12:06 AM)Numinous Wrote:  I already read that links, and i tried to open that .GIF file in my browser and it actually displays a image but i'm unable to execute that PHP code.

I tried all best possible ways like .gif.php, .php.gif, .gif.php2, .gif.php3, .php etc

Use ASCII encoding, you are probably saving the file UTF-8

Send a paste, i'm too lazy to type it out.
[Image: 4YPLYme.gif]

If you send proper headers they shouldn't be able to execute it.

How did it get uploaded?
Not enough information really, but this should help you: ForceType.
Like Charger said, headers. Although I suggest you still fix the issue at the root; checking if an image is valid.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[The Brotherhood] by VinavilMar 27, 2026 09:05 AM 25 860 Mar 27, 2026 09:05 AM
Last Post: Vinavil
[PHP] by N1l0cAug 8, 2017 10:47 AM 9 237 Aug 8, 2017 10:47 AM
Last Post: Fresku
[PHP] by EssenceDec 12, 2016 06:18 PM 2 166 Dec 12, 2016 06:18 PM
Last Post: Essence