Inspired by the Gareth Heyesarticle I haven’t found any tool to automatticaly generate a polyglot image like that, so I decide to do my own.
This is tool is simple, the user need to pass in the first argument a normal image (a valid image) and in the second argument a output name for the new image:
1
python polyglothing.py image.jpg out.jpg
Doesn’t have too much explain here. Anyway I comeback to the Gareth Heyes article recently because I’ve found a bug exactly like that however my image need to have a specific width & height, so I was almost forced to write this tool. However playing with the image provided by the portswigger another problem came, when I change the payload of the image this image become a invalid Image. I resolved learn a little more about it and have created the following code. This is a simple code that receive the portswigger image and exchange the payload and also exchange the dimensions.