库以简化收集有关文件的可标识属性的过程
atklite的Python项目详细描述
Atklite
atklite是一个旨在帮助轻松确定可识别属性的库 关于正在调查的文件。下面是一个简单的用法语法 可以通过调用应用程序来确定信息:
- MD5哈希
- SHA-1哈希
- SHA-256哈希
- CRC32校验和
- 文件大小
- 文件类型(来自魔法字节)
- 通过ssdeep的模糊哈希(ctph)
atklite主要用于分析恶意软件样本,但可能 对于任何寻找用于分析文件的简单api的人都很有用。
此外,atklite可以用作二进制存储系统,使用标准 文件系统,使用 用户选择使用的哈希(MD5、SHA1、SHA256或SHA512)。
设置
要求
- python(用python 2.7测试)
- python-magic。在大多数系统上,这需要libmagic库 安装。
- python ssdeep wrapper,其中之一:
安装必备组件
在ubuntu系统上安装先决条件相当容易。
- 首先,我们必须安装python ssdeep的先决条件:
- $apt get安装cython ssdeep python dev
安装
使用pip安装很简单:
$ pip install atklite
如果是从源位置安装,请拆下分发tarball,然后安装为 如下:
$ python setup.py build $ python setup.py install
配置和使用
用法:
From the cli using atk-info: jpleger@jupiter:~$ atk-info ~/glyphicons-halflings-white.png [-] Using binary store at: /home/jpleger/binary_store -- glyphicons-halflings-white.png ---------------------------------------------- Analyze time: Mon Jul 29 18:23:10 2013 File name: glyphicons-halflings-white.png File size: 8777 File type: PNG image data, 469 x 159, 8-bit colormap, non-interlaced CRC-32: 43808ba4 MD5 hash: 9bbc6e9602998a385c2ea13df56470fd SHA1 hash: a25c4705320fd63c33790e666872910e702b9bf6 SHA256 hash: f0e0d95a9c8abcdfabf46348e2d4285829bb0491f5f6af0e05af52bffb6324c4 Fuzzy hash: 192:41MFu/STZChMGLw/LtI30ukSCeQm9F+xZdqdfQpTTTIyQY7thi7uWB:iMdZ/GLILBmWEiTTTIyQY5hi71 Stored File: /home/jpleger/binary_store/9/b/b/9bbc6e9602998a385c2ea13df56470fd jpleger@jupiter:~$ From the python interpreter: >>> import atklite >>> file_analysis = atklite.FileAnalysis(filename='9ba57b128089f0a5a07b262511307f9c.exe') >>> print file_analysis.dump() sha1: 63738713f1e22425e06dd1f20e5cd22c630fd7d3 analyzetime: Sat Mar 2 00:57:50 2013 ftype: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows crc32: 9083b5e6 ttime: 1362211070.21 sha256: 04a191e1d7526025ee911f8a55d5c329af456cbd48d507dc2040b4ead1e4a525 ssdeep: 1536:o+I6XtaJU0ikjlcCGXM6ds6GGA2P+ly+Hmuh81HSR:o+fXtBYcCiX1xP0Hmk8s md5: 9ba57b128089f0a5a07b262511307f9c size: 77824 >>> analysis = file_analysis.return_analysis() >>> analysis['analyzetime'] 'Sat Mar 2 00:57:50 2013' >>> print analysis['md5'] 9ba57b128089f0a5a07b262511307f9c >>> print analysis['sha1'] 63738713f1e22425e06dd1f20e5cd22c630fd7d3 >>> print analysis['sha256'] 04a191e1d7526025ee911f8a55d5c329af456cbd48d507dc2040b4ead1e4a525 >>> print analysis['size'] 77824 >>> print analysis['crc32'] 9083b5e6 >>> print analysis['ftype'] PE32 executable (DLL) (GUI) Intel 80386, for MS Windows >>> print analysis['ssdeep'] 1536:o+I6XtaJU0ikjlcCGXM6ds6GGA2P+ly+Hmuh81HSR:o+fXtBYcCiX1xP0Hmk8s
待办事项
很高兴拥有
- Storing the reports with the files
- Tagging within the saved reports