Jump to content
Andrei

PHP EXIF Backdoors generator using custom shellcode

Recommended Posts

Posted

PHPEB is a small tool that generates and stores obfuscated shellcode in user specified EXIF handlers. The backdoor is divided into two parts. The first part is a mix of the exif_read_data function to read the image headers and the preg_replace function to execute the content and the second is the real payload obfuscated in EXIF a JPG/TIFF file headers.

Both functions are harmless by themselves. Exif_read_data is commonly used to read images and preg_replace to replace the content of strings. However, preg_replace has a hidden and tricky option where if you pass the “/e” modifier it will execute the content (eval), instead of just searching/replacing.

Another interesting point is that the image that we generate still loads and works properly.

Started from Sucuri Research.

If you have any other cool ideas for obfuscating the shellcode, feel free to commit.

https://github.com/CCSIR/PHP-EXIF-Backdoors-generator-using-custom-shellcode

Posted

Ha, nu stiam de preg_replace_callback. Ar putea zapaci AV-urile (gen Sucuri) ce se bazeaza pe white/black listing. Da, dar frumusetea in toata faza asta e ca ar trebui sa faci debugging pentru a vedea ca valoarea din preg_replace e o expresie regulata cu /e. Daca nu faci asta, sunt aproape sigur ca vor genera FA-uri.

Da, sunt constient de acest lucru, dar pana la urma uneltele automatizate forteaza deciziile in cazul celor care ar trebui sa ne fereasca de asa ceva.

Mersi de comentariu, daca mai cunosti astfel de functii "utile", da-mi de stire. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...