Git Product home page Git Product logo

png-idat-payload-generator's Introduction

PNG-IDAT-Payload-Generator

Generate a PNG with a payload embedded in the IDAT chunk (Based off of previous concepts and code -- credit given below) Additionally, bruteforce payloads matching a regex pattern

This is a Python3, PEP8-compatible, fully-working version of huntergregal's initial project. Rewritten and fixed by https://github.com/TheZ3ro @TheZ3Pro

Update: Added prepopulated payload tables, improved bruteforce speeds, added xqi.cc payload to table

Based Off of Previous Concepts and Research

Usage

usage: generate.py [-h] [-q] -m {xss,php} [-r REMOTE_DOMAIN] -o OUTPUT_IMAGE [-u UPDATE] [-p PAYLOAD] [-t THREADS]

Tool to generate PNG-IDAT Payloads.

options:
  -h, --help            show this help message and exit
  -q, --quiet           Optional: quiet mode
  -m {xss,php}, --method {xss,php}
                        Choose payload method, -h to view available methods
  -r REMOTE_DOMAIN, --remote-domain REMOTE_DOMAIN
                        Remote domain to retrieve payload from (shorter the better: ex. xx.xxx. use xqi.cc for generic XSS)
  -o OUTPUT_IMAGE, --output-file OUTPUT_IMAGE
                        Output payload to PNG file
  -u UPDATE, --update UPDATE
                        Update the payload tables
  -p PAYLOAD, --payload PAYLOAD
                        Use the provided payload - no bruteforce
  -t THREADS, --threads THREADS
                        Number of threads to use for bruteforce
  • use tld_tool.py and prefix_tool.py to help generate templates and populate payload tables
  • use a target of xqi.cc to create a payload for a generic XSS reflector. thanks idontplaydarts for the tip
    • usage for this payload is xqi.cc/?zz=alert(1)

Generic XSS Payload

  • usage target.com/evil.png?zz=alert(1)

s/o idontplaywithdarts for the domain tip

Concept

  1. Generate PNG payload
  2. Bruteforce hex string that Gzdeflates into target payload
  3. Engineer discovered Gzdeflate string to bypass PNG filters
  4. Generate PNG file with payload embeded in IDAT chunk
  5. Upload PNG payload to vulnerable target web application
  6. Take control of web application response content-type (example: .png.html)

To Do

  • Vavkamil Bruteforce method(s) , tld vs prefix
  • Pure Bruteforce method (long)
  • Port payloadPatternBruter.py to Python3

png-idat-payload-generator's People

Contributors

dependabot[bot] avatar huntergregal avatar ldionmarcil avatar thez3ro 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

png-idat-payload-generator's Issues

Possible with different file sizes?

Hey, I have found a vector vulnerable to this bug but requires specific sizes (ie 1000x1000, or 100x100). Did you have in mind to add this as a feature?

Four character domains support

Any idea to how to go about for four characters domain support? How to go about adding that extra byte for the extra character in the domain name?

RGB With Alpha

Is there a way to generate this payload to work with RGB with Alpha with this? The byte count per pixel is 4 with the alpha variable and I can't figure out how to repeat idontplaydart's blog steps with the $a varible (for alpha) accounted for manually.

Code does not work at all

Has this ever been tested at all? There is no way this can even function.

def generateFinalPayload(payload, outputImage):
	print "[+] Generating final PNG payload..."
	#Thanks to admanLogue and hLk_886 for this PNG Code
	im = Image.new('RGB', (32,32))
	i = 0
	c = 0
	if i >= len(payload):
		r = payload[i]
		g = payload[i+1]
		b = payload[i+2]
		im.putpixel((c,0), (r,g,b))
		i += 3
		c += 1

The if here will never be true! And even if it were true, im.putpixel() will ultimately fail because r,g and b are bytes (in string) and putpixel expects integers.

This was not tested at all and cannot work!

No module named 'PIL'

Traceback (most recent call last):
File "generate.py", line 14, in
from idat import bypass_filters, save_image, verify
File "/root/PNG-IDAT-Payload-Generator/idat.py", line 3, in
from PIL import Image
ModuleNotFoundError: No module named 'PIL'

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.