是否曾经因为可以通过哈希查找二进制文件而觉得将恶意软件二进制上传到VirusTotal或其他反病毒网站不太安全?(示例:https://github.com/mubix/vt-notify)
使用Recomposer感觉稍微安全一些!
Recomposer会对你的二进制文件进行以下随机操作:
顺便一提,你的文件仍然可以执行,所以放心上传吧!*
支持win32/64 PE文件!!
两种模式:
通过从一个二进制文件创建11200个样本进行测试。结果:
./recomposer.py -f live.sysinternals.com/Tcpview.exe -a
Old file name: live.sysinternals.com/Tcpview.exe
New file name: zYmycO4NO2LYW.exe
[*] Checking if binary is supported
[*] Gathering file info
1 Section: .text | SectionFlags: 0x60000020
2 Section: .rdata | SectionFlags: 0x40000040
3 Section: .data | SectionFlags: 0xc0000040
4 Section: .rsrc | SectionFlags: 0x40000040
[*] Changing Section .text Name
[*] Changing Section .rdata Name
[*] Changing Section .data Flags
[*] Changing Section .data Name
[*] Changing Section .rsrc Name
Updated Binary:
updatedfile/zYmycO4NO2LYW.exe
[*] Checking if binary is supported
[*] Gathering file info
1 Section: .mhz | SectionFlags: 0x60000020
2 Section: .p1k | SectionFlags: 0x40000040
3 Section: .FSr0U | SectionFlags: 0xd0000443
4 Section: .q2X | SectionFlags: 0x40000040
Writing to log_recomposer.txt
你可能会看到这条警告:
[!] Warning, .text section hash is not changed!
[!] No caves available for nop injection.
这意味着.text节的哈希与原始文件相同,一旦谷歌索引了VT结果(如果你上传了文件的话),你就可以在网络上被搜索到。如果发生这种情况,对重组后的文件进行UPX编码应该可以解决这个问题(除非文件已经进行了UPX编码)。
重组完成后,你的文件将位于updatedfile目录中。随意将其上传到你最喜欢的恶意软件沙箱服务!
一个简单的PE编辑器:
./recomposer.py -f live.sysinternals.com/Tcpview.exe -m
[*] Checking if binary is supported
[*] Gathering file info
[?] What sections would you like to change:
1 Section: .text | SectionFlags: 0x60000020
2 Section: .rdata | SectionFlags: 0x40000040
3 Section: .data | SectionFlags: 0xc0000040
4 Section: .rsrc | SectionFlags: 0x40000040
Section number:1
[-] You picked the .text section.
[?] Would you like to (A) change the section name or (B) the section flags? b
[-] You picked: b
=========================
[*] Current attributes:
.text | 0x60000020
[-] IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_EXECUTE
[-] IMAGE_SCN_CNT_CODE
=========================
[*] Commands 'zero' out the flags, 'help', 'write', or ('exit', 'quit', 'q', 'done')
[*] Use 'write' to commit your changes or 'clear' to start over.
[?] Enter an attribute to add or type 'help' or 'exit':
[...]
只需按照菜单操作,你的结果将在updatedfile目录中,文件名为change.filename.exe,或者使用-o标志指定的任何输出名称。
如果你不确定文件在哪里,只需查看log_recomposer.txt,其中包含更改文件的路径和哈希值:
filename|filename_hash|changedfile|changedfile_hash
psinfo.exe|ae1554f2c1b1454a91c5610747603824|updatedfile/8dV5.exe|791ff4d4b2010accebc718afda58f83a
psexec.exe|d0df366711c8b296680002840336b6fd|updatedfile/udi6ieIVFi.exe|6fafa108d697a46a271a918436e60cd5
live.sysinternals.com/Tcpview.exe|9aa5a93712c584acdcaa7eef9d25ef4d|updatedfile/zYmycO4NO2LYW.exe|fd984b833443c457668a480a37cf9904
live.sysinternals.com/Tcpview.exe|9aa5a93712c584acdcaa7eef9d25ef4d|updatedfile/change.Tcpview.exe|c43eeec089a3e4f9e6fd0218a27ca4c2
*Recomposer并不能阻止恶意软件通知其所有者其二进制文件在非预期环境中运行。**
**例如:你的环境。***
***但如果你不在乎,那就上传吧!***