dlegs / php-jpeg-injector

Injects php payloads into jpeg images
454 stars 118 forks source link

payload not inserting in the right place #1

Closed 0xearl closed 4 years ago

0xearl commented 4 years ago

As i read the PoC of fakhrizulkifli i noticed your script isn't inserting the payload where it should be inserting which is "The place to be put PHP backdoor is right after the Scan Header (00 0C 03 01 00 02 11 03 11 00 3F 00)" according to fakhrizulkifli. it instead inserts the payload to 3c 3f on my case image

0xearl commented 4 years ago

fixed it by changing magic_number to 03010002100310000001c5

dlegs commented 4 years ago

Thanks for reporting this, looking into it!

0xearl commented 4 years ago

Thanks for reporting this, looking into it!

i have a question tho. does injecting the payload should affect the image quality? coz when i do the image quality gets broken. and my payload wont execute

dlegs commented 4 years ago

To be honest I haven't looked at this script in like 3 years lol. I think i remember it slightly distorting the image? I'll do more testing.

Also, just to be sure, you're saying the script doesn't work unless you change the magic number to the one you provided?

0xearl commented 4 years ago

To be honest I haven't looked at this script in like 3 years lol. I think i remember it slightly distorting the image? I'll do more testing.

Also, just to be sure, you're saying the script doesn't work unless you change the magic number to the one you provided?

yeah well.. it seems like the image itself was the problem it was compressed that's why it didnt find the right bytecodes and inserted it on the top

dlegs commented 4 years ago

Gotcha thanks!