CTF中的神兵利刃-foremost工具之文件分离

2023-08-05,,

原理

Foremost可以依据文件内的文件头和文件尾对一个文件进行分离,或者识别当前的文件是什么文件。比如拓展名被删除、被附加也仍然可以对其分离。

使用

安装:

需要使用这个工具,首先我们需要安装他,在Linux系统中,我们可以直接apt install foremost中进行安装。

使用:

foremost file

这样会直接指定一个文件进行分析,然后输出到output文件夹下

foremost -I file -o output

这里 -o 后面的参数就是输出的路径,-i则是指定一个文件,当然这个-i你也可以去掉(做题速度很关键)

当然,foremost的使用肯定不止这么一点点,不然也不会成为“神器”被我们放到这里。

我们使用foremost -h之后,会有下面的文档:

foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus.
$ foremost [-v|-V|-h|-T|-Q|-q|-a|-w-d] [-t <type>] [-s <blocks>] [-k <size>]
[-b <size>] [-c <file>] [-o <dir>] [-i <file] -V - display copyright information and exit
-t - specify file type. (-t jpeg,pdf ...)
-d - turn on indirect block detection (for UNIX file-systems)
-i - specify input file (default is stdin)
-a - Write all headers, perform no error detection (corrupted files)
-w - Only write the audit file, do not write any detected files to the disk
-o - set output directory (defaults to output)
-c - set configuration file to use (defaults to foremost.conf)
-q - enables quick mode. Search are performed on 512 byte boundaries.
-Q - enables quiet mode. Suppress output messages.
-v - verbose mode. Logs all messages to screen

对其翻译之后,内容有下:

-V-显示版权信息并退出
-t-指定文件类型。(-t jpeg,pdf…)
-d-启用间接块检测(对于UNIX文件系统)
-i-指定输入文件(默认为stdin)
-a-写入所有标头,不执行错误检测(损坏的文件)
-w-仅写入审核文件,不将任何检测到的文件写入磁盘
-o-设置输出目录(默认为输出)
-c-设置要使用的配置文件(默认为forest.conf)
-q-启用快速模式。在512字节边界上执行搜索。
-Q-启用静音模式。抑制输出消息。
-v-冗余模式。将所有消息记录到屏幕。

其实我们上面提到的主要使用方法已经能满足我们日常使用了,所以这些复杂的我们就只在这里说明。

补充

是的,我们QQ群里的机器人也已经加入了foremost功能了!对于需要分离的文件我们只需要按照如下的过程操作即可:

接着我们就能在返回的报告中看到我们的结果哦!

CTF中的神兵利刃-foremost工具之文件分离的相关教程结束。

《CTF中的神兵利刃-foremost工具之文件分离.doc》

下载本文的Word格式文档,以方便收藏与打印。