文件类型识别工具:TrID(trid)下载安装及使用

引言:

本文章结合 Marco Pontello’s Home - Software - TrID (mark0.net) 官方首页及本地测试编写,如有不足还望不吝赐教。

TrID(trid)下载:

win32、64位也能运行:https://www.mark0.net/download/trid_w32.zip

linux32:https://www.mark0.net/download/trid_linux.zip

linux64:https://www.mark0.net/download/trid_linux_64.zip

TrID定义规则库:https://www.mark0.net/download/triddefs.zip

更新规则库脚本:https://www.mark0.net/download/tridupdate.zip

TrID安装:

根据系统下载TrID和TrID定义规则库,然后把它们解压在同一个文件夹里:

TrId介绍

原文节选:

TrID is an utility designed to identify file types from their binary signatures. While there are similar utilities with hard coded logic, TrID has no fixed rules. Instead, it’s extensible and can be trained to recognize new formats in a fast and automatic way.

TrID has many uses: identify what kind of file was sent to you via e-mail, aid in forensic analysis, support in file recovery, etc.

TrID uses a database of definitions which describe recurring patterns for supported file types. As this is subject to very frequent update, it’s made available as a separate package. Just download both TrID and this archive and unpack in the same folder.

The database of definitions is constantly expanding; the more that are available, the more accurate an analysis of an unknown file can be. You can help! Use the program to both recognize unknown file types and develop new definitions that can be added to the library. See the TrIDScan page for information about how you can help. Just run the TrIDScan module against a number of files of a given type. The program will do the rest.

Because TrID uses an expandable database it will never be out of date. As new file types become available you can run the scan module against them and help keep the program up to date. Other people around the world will be doing the same thing making the database a dynamic and living thing. If you have special file formats that only you use, you can also add them to your local database, making their identification easier.

To get you started, the current library of definitions is up to 14552 file types and growing fast.

TrID is simple to use. Just run TrID and point it to the file to be analyzed. The file will be read and compared with the definitions in the database. Results are presented in order of highest probability.

翻译:

TrID是一个应用程序,它可以根据文件的二进制特征识别文件类型。相比一些相似的程序是固定的代码逻辑,TrID则没有固定的规则。所以它是可扩展的,并且可以在训练后快速、自动地识别新格式。

TrID有很多用法:识别通过邮件发送给你的文件是什么类型,帮助进行取证分析,支持文件恢复。

TrID使用一个定义数据库,其中描述了对所支持文件类型的匹配模式。因为它会频繁的更新,所以它作为一个单独的包(triddefs.trd)提供。请下载TrID和这个单独的包,然后把它们解压在同一个文件夹里。

这个定义数据库会持续拓展;定义数据库越丰富,对未知文件的分析就会越准确。你可以帮助我们!可以用这个程序识别未知的文件类型然后添加新的定义在数据库中。至于怎么帮助拓展数据库,参见TrLDScan页面。针对给定类型的一些文件运行TrIDScan模块。程序便会测试。

因为它使用的是一个可拓展的数据库,所以它永远不会过时。当新的文件类型可用时,你就可以针对这些文件运行scan模块从而帮助保持程序更新。世界上其他的人也将会做相同的事情,这样数据库就是动态的。如果你有仅仅你在使用的文件类型时,你可以将它们加入到你自己的数据库,让他们的类型识别更容易。

目前,现有的定义数据库一共有超过14552种文件类型,并且在快速增加。

TrID使用

以下示例命令执行环境为windows10 CMD。

官方help:

Usage: TrID <[path]filespec(s)...> [-ae|-ce] [-d:file] [-ns] [-n:nn]
                                   [-@] [-v] [-w] [-?]

Where: <filespec> Files to identify/analyze
       -ae        Add guessed extension to filename
       -ce        Change filename extension
       -d:file    Use the specified defs package
       -ns        Disable unique strings check
       -n:nn      Number of matches to show (default: 5)
       -@         Read file list from stdin
       -v         Verbose mode - display def name, author, etc.
       -w         Wait for a key before exiting
       -?         This help!

TrID的使用非常简单,只需要运行并且指定要分析的文件。文件会被读取然后和数据库中的定义进行对比,结果按照更高的可能性来排序。

 .\trid.exe targetfile

通配符可以用来扫描一组文件、整个文件夹。

使用参数 -ae 将会让TrID给文件名增加猜测的扩展名,这在处理由恢复软件所恢复的大量数据文件时非常方便。

另一个参数 -ce 可以改变扩展名;如果文件没有扩展名,将会被添加一个。比如:

  • 左边的图片其实是png,右边的其实是个exe程序,这里为了演示参数功能

TrID使用 -@参数可以从标准流中获取文件。所以,只需通过管道获得其他命令的输出,然后就可以处理整个tree的文件或特定的文件集。

  • dir命令的参数:/s指列出指定目录及其子目录的所有文件;-b使用空格式(没有标题信息或摘要),也就是只要文件绝对路径。

还可以告诉TrID去展示关于每个匹配的更多信息(比如mime类型,谁创建了这个定义,以及扫描了多少文件),并且还可以限制展示结果的数量。参数 -v即可打开这个开关。

而参数 -r:n可以指定TrID要在屏幕展示的最大匹配数量。

当程序启动时,TrLD会检查TrIDDefs。TRD规则库要在当前文件夹(和TrID.exe在同一文件夹)。也可以指定defs文件所在的地方,使用参数 -d:filespec

可以强制让TrID在展示程序运行结果后,必须按下某个按键才能退出:

更新

为了提高更新最新定义库的速度,可以使用TrIDUpdate Python 脚本更新。它会首先比对现有TRD文件和网上可更新文件的MD5值,如果一样的话会很快。

  • 5
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值