恶意文件分析工具

电子说

1.2w人已加入

描述

 

工具介绍

capa 检测可执行文件中的功能。您针对 PE、ELF、.NET 模块或 shellcode 文件运行它,它会告诉您它认为该程序可以做什么。例如,它可能表明该文件是后门、能够安装服务或依赖 HTTP 进行通信。                                           

工具使用针对未知二进制文件 ( suspicious.exe) 运行 capa,该工具报告该程序可以发送 HTTP 请求、通过 XOR 和 Base64 解码数据、安装服务并生成新进程。总而言之,这让我们认为这suspicious.exe可能是一个持久的后门。因此,我们的下一个分析步骤可能是在沙箱中运行suspicious.exe并尝试恢复命令和控制服务器。通过传递-vv标志(非常详细),capa 准确报告在哪里找到了这些功能的证据。这至少有两个原因:
  • 它有助于解释为什么我们应该相信结果,并使我们能够验证结论,并且
  • 它显示了经验丰富的分析师可以使用 IDA Pro 研究二进制文件中的哪些位置
$ capa.exe suspicious.exe -vv
...
execute shell command and capture output
namespace   c2/shell
author      matthew.williams@mandiant.com
scope       function
att&ck      Execution::Command and Scripting Interpreter::Windows Command Shell [T1059.003]
references  https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa
function @ 0x4011C0
  and:
    match: create a process with modified I/O handles and window @ 0x4011C0
      and:
        number: 257 = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW @ 0x4012B8
        or:
          number: 68 = StartupInfo.cb (size) @ 0x401282
        or: = API functions that accept a pointer to a STARTUPINFO structure
          api: kernel32.CreateProcess @ 0x401343
    match: create pipe @ 0x4011C0
      or:
        api: kernel32.CreatePipe @ 0x40126F, 0x401280
    optional:
      match: create thread @ 0x40136A, 0x4013BA
        or:
          and:
            os: windows
            or:
              api: kernel32.CreateThread @ 0x4013D7
        or:
          and:
            os: windows
            or:
              api: kernel32.CreateThread @ 0x401395
    or:
      string: "cmd.exe" @ 0x4012FD
...

HTTP

capa 使用一组规则来识别程序中的功能。这些规则很容易编写,即使对于逆向工程新手来说也是如此。通过编写规则,您可以扩展 capa 识别的功能。在某些方面,capa 规则是 OpenIOC、Yara 和 YAML 格式的混合。

以下是 capa 使用的规则示例:

rule:
  meta:
    name: hash data with CRC32
    namespace: data-manipulation/checksum/crc32
    authors:
      - moritz.raabe@mandiant.com
    scope: function
    mbc:
      - Data::Checksum::CRC32 [C0032.001]
    examples:
      - 2D3EDC218A90F03089CC01715A9F047F:0x403CBD
      - 7D28CB106CB54876B2A5C111724A07CD:0x402350  # RtlComputeCrc32
      - 7EFF498DE13CC734262F87E6B3EF38AB:0x100084A6
  features:
    - or:
      - and:
        - mnemonic: shr
        - or:
          - number: 0xEDB88320
          - bytes: 00 00 00 00 96 30 07 77 2C 61 0E EE BA 51 09 99 19 C4 6D 07 8F F4 6A 70 35 A5 63 E9 A3 95 64 9E = crc32_tab
        - number: 8
        - characteristic: nzxor
      - and:
        - number: 0x8320
        - number: 0xEDB8
        - characteristic: nzxor
      - api: RtlComputeCrc32

下载链接:

链接:https://pan.quark.cn/s/01e6d73b416b

项目地址:https://github.com/mandiant/capa

 


打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分