exiftool
2026/5/29工具工具元数据exiftool大约 3 分钟
exiftool
是什么
exiftool 是元数据查看和修改工具,常用于分析图片、PDF、Office 文档、音频、视频中的元信息。
CTF 中它常用于发现:
- 作者、软件、创建时间
- GPS 坐标
- 注释字段
- 缩略图
- 被隐藏在 metadata 里的字符串
安装与配置
Ubuntu/Kali:
sudo apt update
sudo apt install exiftoolmacOS:
brew install exiftoolWindows 可下载 ExifTool 官方发布包,或在 WSL 中使用。
验证:
exiftool -ver基本用法
查看元数据
exiftool image.jpg查看全部字段
exiftool -a -u -g1 image.jpg只看 GPS
exiftool -gps* image.jpg提取缩略图
exiftool -b -ThumbnailImage image.jpg > thumb.jpg删除元数据
exiftool -all= image.jpgCTF 分析时不要直接改原文件,先复制。
更多选项
查看特定标签
exiftool -Artist image.jpg
exiftool -Comment image.jpg
exiftool -Description image.jpg
exiftool -Copyright image.jpg
exiftool -Software image.jpg
exiftool -CreateDate image.jpg
exiftool -ModifyDate image.jpg按组查看
exiftool -g1 image.jpg # 按组分组
exiftool -G1 image.jpg # 显示组名
exiftool -g1 -a -u image.jpg # 完整分组输出为 JSON
exiftool -json image.jpg
exiftool -json -a -u image.jpg输出为 CSV
exiftool -csv -r ./images/查看所有标签名
exiftool -list查看特定格式支持
exiftool -listf # 支持的文件格式
exiftool -listw # 支持的写入标签修改元数据
# 设置作者
exiftool -Artist="CTF Player" image.jpg
# 设置注释
exiftool -Comment="flag{hidden}" image.jpg
# 设置 GPS
exiftool -GPSLatitude=40.7128 -GPSLongitude=-74.0060 image.jpg
# 清除所有元数据
exiftool -all= image.jpg
# 清除特定标签
exiftool -Comment= image.jpg批量处理
# 批量查看
exiftool -r ./images/
# 批量提取 GPS
exiftool -r -gps* ./images/
# 批量导出为 CSV
exiftool -csv -r ./images/ > metadata.csv
# 批量删除元数据
exiftool -all= -r ./images/提取嵌入文件
# 提取缩略图
exiftool -b -ThumbnailImage image.jpg > thumb.jpg
exiftool -b -PreviewImage image.jpg > preview.jpg
# 提取嵌入的 ICC 配置文件
exiftool -b -ICC_Profile image.jpg > profile.icc查看文件系统元数据
exiftool -fs image.jpgCTF常用技巧
查找可疑字段
exiftool -a -u -g1 file | grep -i "flag\|comment\|author\|gps\|description"批量分析目录
exiftool -r ./filesOSINT 坐标题
如果看到 GPS:
GPS Latitude
GPS Longitude将坐标转成地图位置,再结合题目要求判断 flag。
文档元数据
exiftool document.pdf
exiftool document.docxOffice 和 PDF 题可能把线索藏在作者、标题、注释、创建软件里。
音频元数据
exiftool audio.mp3
exiftool audio.wav音频文件可能包含:
Artist
Album
Comment
Lyrics
Encoded by视频元数据
exiftool video.mp4
exiftool video.avi检查修改痕迹
# 对比创建时间和修改时间
exiftool -CreateDate -ModifyDate image.jpg
# 查看软件版本
exiftool -Software image.jpg
# 查看历史修改
exiftool -History image.jpg隐藏数据技巧
1. 在 Comment 字段隐藏 flag
2. 在 GPS 坐标中编码信息
3. 在缩略图中嵌入不同图片
4. 在 XMP/ICC 中隐藏数据
5. 利用 MakerNotes 字段常见问题
没有 GPS 就没线索吗
不是。还要看注释、软件版本、缩略图、文件名、创建时间和其他嵌入对象。
exiftool 会修改文件吗
普通查看不会。执行写入命令会生成或修改文件,所以分析时先备份。
图片平台会清除 EXIF 吗
会。真实社交平台常清理元数据,但 CTF 题通常会保留或故意伪造。
某些标签看不到
# 使用 -a 显示所有标签
exiftool -a image.jpg
# 使用 -u 显示未知标签
exiftool -u image.jpg
# 组合使用
exiftool -a -u -g1 image.jpg批量处理很慢
# 使用 -r 递归但限制深度
exiftool -r -maxdepth 2 ./images/
# 只查看特定标签
exiftool -Comment -r ./images/关联
- OSINT基础
- PDF与Office文档结构
- 图片像素与LSB
- file
- zsteg
- StegSolve