从本期开始我们会讲解APT攻击技术中的一些分析技术,主要会教大家如何分析word和pdf中的恶意程序等。本期讲解的是一个word恶意样本的提取出来恶意EXE文件的方法。
注册登录后即可下载原始的word恶意样本
https://malwr.com/analysis/MjQxOTQ5NWNjMGZlNGFiZmJkYzcwOTlkNDE3ZDdhZTU/
1.
wget https://bitbucket.org/decalage/olefileio_pl/downloads/olefile-0.41.zip unzip oldfile-0.41.zip cd oldfile-0.41 sudo python setup.py install
2.
wget http://didierstevens.com/files/software/oledump_V0_0_4.zip wget http://didierstevens.com/files/software/pecheck_v0_3_0.zip
1. 查看word恶意样本信息
python oledump.py 1.doc
结果说明: 模块7包含了一个宏。
2.查看宏脚本
python oledump.py -s 7 -v 1.doc
输出内容:
3.查看word中插入的内容
python oledump.py -s 14 1.doc
结果:
4.
a) 解码脚本:
#!/usr/bin/env python __description__ = '&H decoder for oledump.py' __author__ = 'Didier Stevens' __version__ = '0.0.1' __date__ = '2014/12/19' """ Source code put in public domain by Didier Stevens, no Copyright https://DidierStevens.com Use at your own risk History: 2014/12/19: start Todo: """ import re class cAmpersandHexDecoder(cDecoderParent): name = '&H decoder' def __init__(self, stream, options): self.stream = stream self.options = options self.done = False def Available(self): return not self.done def Decode(self): decoded = ''.join([chr(int(s[2:], 16)) for s in re.compile('&H[0-9a-f]{2}', re.IGNORECASE).findall(self.stream)]) self.name = '&H decoder' self.done = True return decoded def Name(self): return self.name AddDecoder(cAmpersandHexDecoder)
python oledump.py -s 14 -D decoder_ay.py 1.doc | more
b) 进行解码
结果输出:
5.
python oledump.py -s 14 -D decoder_ay.py -d 1.doc >1.exe
6. 查看virustotal结果
【原文:阿里巴巴cnbird SP小编发布 期待下篇放出“从流量中提取文件”的技巧】
本文作者:SP小编
本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/3792.html
涨姿势了。。
这直接写个oledump usage 哪有这么多事