首页/安全/取证与溯源速查/ext4 时间戳与 crtime 获取
Linux 取证135 条

ext4 时间戳与 crtime 获取

ext4 为每个 inode 保存创建时间(crtime),常规 stat 未必显示,可用 debugfs 直接读取;四类时间戳互为补充用于还原文件生命周期。

取证与溯源速查安全更新于 2026-10-12
时间atime 访问、mtime 内容修改、ctime 元数据修改、crtime 创建
命令stat -c '%n %w %y %z %x'、debugfs -R 'stat <路径>'

获取

获取
stat -c '%n B=%w M=%y C=%z A=%x' /etc/passwd
debugfs -R 'stat /etc/passwd' /dev/sda1 2>/dev/null | grep -i crtime
stat 的 %w 在部分文件系统或内核上显示为短横线,此时改用 debugfs 读取。

易错点

  • debugfs 需要直接访问块设备,镜像分析时对镜像文件同样可用
  • 日志文件系统的 ctime 随元数据变化而更新,不能当作创建时间

数据来源与参考

  • ext4 文档(inode 时间戳)
  • man 8 debugfs(e2fsprogs)
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌