Exif file data configuration Header Thumbnail Number of pixels Compression Mode
ID: 3917224 • Letter: E
Question
Exif file data configuration Header Thumbnail Number of pixels Compression Mode Date captured Camera make/model Aperture setting Shutter setting Color space, etc. Primary image data Many forensic investigations require the analysis of images However, because of the significant number of images that are stored on many modern computers, tablets, and even phones, it has become a challenge to the investigator to be able to manually view, hash, and check metadata for every image. If the investigation also happens to be related to child exploitation, then the investigator has the additional challenge of determining if any of the images are illegal.Explanation / Answer
The tag names will differ from image to image that are taken on different devices. So, I've just read the images' tags and didn't print them. Please access the tags that you wish to print. The rest of the code is given below::
instructions
# code is from here
import os
import glob
import hashlib
import exifread
def get_md5(f):
return hashlib.md5(f.read()).hexdigest()
illicit_checksum_filepath = "./illicit_checksum.txt"
illicit_checksum_list = []
images_filepath = "./images"
image_ext = "*.jpeg"
def get_illicit_list(filepath):
return [line.rstrip(' ') for line in open(filepath)]
def get_image_paths(path):
files = []
for filename in glob.glob(os.path.join(path, image_ext)):
files.append(filename)
return files
def main():
#read and store the list of illicit checksums
illicit_checksum_list = get_illicit_list(illicit_checksum_filepath)
print("List of illicit files is read and stored")
print(illicit_checksum_list)
#get the list of images to loop on
images_list = get_image_paths(images_filepath)
for image in images_list:
data = open(image, "rb")
tags = exifread.process_file(data)
md5 = get_md5(data)
#print("md5 for '"+image+"' is : "+md5)
for item in illicit_checksum_list:
if item.find(md5) != -1:
print image+" is illicit"
break
main()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.