Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
php-jpeg-injector — Injects PHP payloads into JPEG images for web application exploitation, bypassing GD library image processing to achieve remote code execution. | Kitploit
Tools/GitHubGitHub/dlegs/php-jpeg-injector
Payload GenerationExploitationWeb Application ExploitationPenetration Testing
GitHubdlegs/php-jpeg-injector

php-jpeg-injector

Injects PHP payloads into JPEG images for web application exploitation, bypassing GD library image processing to achieve remote code execution.

View Repository
5401245 years agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

php-jpeg-injector

Injects php payloads into jpeg images. Related to this post.

Use Case

You have a web application that runs a jpeg image through PHP's GD graphics library.

Description

This script injects PHP code into a specified jpeg image. The web application will execute the payload if it interprets the image. Make sure your input jpeg is uncompressed!

Usage

python3 gd-jpeg.py [JPEG] [PAYLOAD] [OUTPUT_JPEG]

e.g. python3 gd-jpeg.py cat.jpeg '<?php system($_GET["cmd"]);?>' infected_cat.jpeg

How it works

PHP code is injected in the null/garbage (brown) space after the scan header:

header

The new infected jpeg is run through PHP's gd-library. PHP interprets the payload injected in the jpeg and executes it.

Download Tool