1、读取PDF文件的元数据
虽然有些pdf文件的正文并没有任何有价值的信息,但是犯罪分子可能会忘记抹除pdf元数据,元数据为破案人员提供了足够多的信息来判断作者,文档创建时间,等等很有价值的信息。
读取PDF文件元数据需求代码(from_pdf_metadata.py):
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
# 打开PDF文件
pdf_file = open('example.pdf', 'rb')
# 创建PDF解析器
parser = PDFParser(pdf_file)
# 创建PDF文档对象
document = PDFDocument(parser)
# 获取PDF属性
title = document.info[0]['Title']
author = document.info[0]['Author']
subject = document.info[0]['Subject']
keywords = document.info[0]['Keywords']
# 打印属性信息
print("Title:", title)
print("Author:", author)
print("Subject:", subject)
print("Keywords:", keywords)
# 关闭PDF文件
pdf_file.close()
运行结果(图):
2、下载并读取图片中的GPS信息
现在人们都喜欢使用手机拍照, 但是默认情况下手机拍摄的照片会保留拍照时的很多信息,包括GPS信息。调查者可以轻松提取GPS信息来跟踪罪犯。
提取GPS信息的脚本(python find_image_GPS.py)
exifread 库
exifread模块为python读取图片EXIF信息的库。
exifread模块的下载地址:https://pypi.python.org/pypi/...
安装exifread库(pip install exifread)
主要使用process_file函数进行解析,传入图片文件对象,返回一个包含图片信息的字典。其中,exif中GPS格式为DMS格式,即:D(degree,度)、M(minute,分)、S(second,秒),因此要进行转换才能得到常见的double类型的经纬度值。下面就用python + exifread读取图片的详细信息。
import exifread
with open('IMG_20190618_163339.jpg', 'rb') as f:
exif_dict = exifread.process_file(f)
print('拍摄时间:', exif_dict['EXIF DateTimeOriginal'])
print('照相机制造商:', exif_dict['Image Make'])
print('照相机型号:', exif_dict['Image Model'])
print('照片尺寸:', exif_dict['EXIF ExifImageWidth'], exif_dict['EXIF ExifImageLength'])
# 经度
lon_ref = exif_dict["GPS GPSLongitudeRef"].printable
lon = exif_dict["GPS GPSLongitude"].printable[1:-1].replace(" ", "").replace("/", ",").split(",")
lon = float(lon[0]) + float(lon[1]) / 60 + float(lon[2]) / float(lon[3]) / 3600
if lon_ref != "E":
lon = lon * (-1)
# 纬度
lat_ref = exif_dict["GPS GPSLatitudeRef"].printable
lat = exif_dict["GPS GPSLatitude"].printable[1:-1].replace(" ", "").replace("/", ",").split(",")
lat = float(lat[0]) + float(lat[1]) / 60 + float(lat[2]) / float(lat[3]) / 3600
if lat_ref != "N":
lat = lat * (-1)
print('照片的经纬度:', (lat, lon))
for key in exif_dict:
print("%s: %s" % (key, exif_dict[key]))
输出:
拍摄时间:2019:06:18 16:33:40
照相机制造商:HUAWEI
照相机型号:HRY-AL00Ta
照片尺寸:3968 2976
照片的经纬度:(13.787098884444445, 100.62936401361111)
Image ImageWidth: 3968
Image ImageLength: 2976
Image BitsPerSample: [8, 8, 8]
Image Make: HUAWEI
Image Model: HRY-AL00Ta
Image Orientation: 0
Image XResolution: 72
Image YResolution: 72
Image ResolutionUnit: Pixels/Inch
Image Software: HRY-AL00Ta 9.0.1.130(C00E130R4P1)
Image DateTime: 2019:06:18 16:33:40
Image YCbCrPositioning: Centered
Image ExifOffset: 290
GPS GPSVersionID: [2, 2, 0, 0]
GPS GPSLatitudeRef: N
GPS GPSLatitude: [13, 47, 847249/62500]
GPS GPSLongitudeRef: E
GPS GPSLongitude: [100, 37, 45710449/1000000]
............................省略
改图宝:照片Exif信息在线查看器 - 改图宝 (gaitubao.com)
- GPS查询网址1
查询链接:http://www.gpsspg.com/maps.htm
- GPS查询网址2
经纬度定位|经纬度定位软件|经纬度定位工具|全球卫星定位地图 (gzhatu.com)
- 地球在线
卫星地图-Google Earth高清卫星地图-谷歌地图-地球在线 (earthol.com)
3、调查PC曾经连接过的WIFI
通过查询PC曾经连接过的wifi信息,从而了解嫌疑犯曾经去过的地方,也会对破案提供更多的线索。
4、调查回收站中用户的文件
删除后的文件会被放入回收站,我们可以使用python脚本调查回收站文件所属的用户。
注册表查询SID和用户名对应,调查回收站中用户的文件。
原文始发于微信公众号(安全君呀):应急响应分享 | 调查取证
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论