Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Fnord — 混淆代码模式提取器 | Kitploit
工具/GitHubGitHub/neo23x0/fnord
静态分析恶意软件分析
GitHubneo23x0/fnord

Fnord

混淆代码模式提取器

查看仓库
303444年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Build Status Actively Maintained

Fnord

Fnord 是一个用于混淆代码的模式提取器

描述

Fnord 有两个主要功能:

  1. 提取字节序列并生成统计信息
  2. 利用这些统计信息,结合序列长度、出现次数、相似性和关键词来创建 YARA 规则

1. 统计

Fnord 使用大小可变的滑动窗口处理文件,提取所有长度从 -m X(默认:4)到 -x X(默认:40)的序列。对于每个长度,Fnord 将以表格形式展示出现最频繁的序列 -t X(默认:3)。

表格中的每一行包含:

  • 长度
  • 出现次数
  • 序列(字符串)
  • 格式化(ASCII/宽/十六进制)
  • 十六进制编码形式
  • 熵

2. YARA 规则创建

Fnord 还会生成一条实验性的 YARA 规则。在创建 YARA 规则时,它会根据序列长度和出现次数计算一个分数(长度 × 出现次数)。然后,它会处理每个序列,移除所有非字母字符,并与关键词列表(不区分大小写)进行比较,以检测比其他序列更有趣的序列。在将每个字符串写入规则之前,Fnord 会计算 Levenshtein 距离,并跳过与已集成到规则中的序列过于相似的序列。

状态

[实验性] Fnord 是几天前创建的,我已经用少量样本进行了测试。我预计在未来几周内会调整默认值,并添加更多关键词、过滤器和评分选项。

改进结果

如果你在样本中发现了混淆代码,使用十六进制编辑器提取样本中的混淆部分并保存到一个新文件中。使用这个新文件进行分析。

尝试使用 -s、-k、-r、--yara-strings、-m 和 -e 等标志。

请将产生弱 YARA 规则(可以改进)的样本发送给我。

用法

root@kitploit:~
        ____                 __
       / __/__  ___  _______/ /
      / _// _ \/ _ \/ __/ _  /
     /_/ /_//_/\___/_/  \_,_/ Pattern Extractor for Obfuscated Code
     v0.7, Florian Roth

    usage: fnord.py [-h] [-f file] [-m min] [-x max] [-t top] [-n min-occ]
                    [-e min-entropy] [--strings] [--include-padding] [--debug]
                    [--noyara] [-s similarity] [-k keywords-multiplier]
                    [-r structure-multiplier] [-c count-limiter] [--yara-exact]
                    [--yara-strings max] [--show-score] [--show-count]
                    [--author author]

    Fnord - Pattern Extractor for Obfuscated Code

    optional arguments:
      -h, --help            show this help message and exit
      -f file               File to process
      -m min                Minimum sequence length
      -x max                Maximum sequence length
      -t top                Number of items in the Top x list
      -n min-occ            Minimum number of occurrences to show
      -e min-entropy        Minimum entropy
      --strings             Show strings only
      --include-padding     Include 0x00 and 0x20 in the extracted strings
      --debug               Debug output

    YARA Rule Creation:
      --noyara              Do not generate an experimental YARA rule
      -s similarity         Allowed similarity (use values between 0.1=low and
                            10=high, default=1.5)
      -k keywords-multiplier
                            Keywords multiplier (multiplies score of sequences if
                            keyword is found) (best use values between 1 and 5,
                            default=2.0)
      -r structure-multiplier
                            Structure multiplier (multiplies score of sequences if
                            it is identified as code structure and not payload)
                            (best use values between 1 and 5, default=2.0)
      -c count-limiter      Count limiter (limts the impact of the count by
                            capping it at a certain amount) (best use values
                            between 5 and 100, default=20)
      --yara-exact          Add magic header and magic footer limitations to the
                            rule
      --yara-strings max    Maximum sequence length
      --show-score          Show score in comments of YARA rules
      --show-count          Show count in sample in comments of YARA rules
      --author author       YARA rule author

快速开始

  1. git clone https://github.com/Neo23x0/Fnord.git 然后 cd Fnord
  2. pip3 install -r ./requirements.txt
  3. python3 ./fnord.py --help

示例

root@kitploit:~
python3 fnord.py -f ./test/wraeop.sct --yara-strings 10
root@kitploit:~
python3 fnord.py -f ./test/vbs.txt --show-score --show-count -t 1 -x 20
root@kitploit:~
python3 fnord.py -f ./test/inv-obf.txt --show-score --show-count -t 1 --yara-strings 4 --yara-exact

截图

Fnord 截图

Fnord 截图

Fnord 截图

警告

./test 文件夹包含恶意脚本,可能被本地防病毒软件检测到。只要不运行它们,就不会对系统造成损害。

常见问题

为什么没有将 Fnord 集成到 yarGen 中?

yarGen 使用白名单方法来过滤最适合创建 YARA 规则的字符串。yarGen 在创建 YARA 规则之前应用一些正则表达式来调整字符串的分数。但其方法与 Fnord 使用的方法有很大不同,Fnord 基于统计计算字节序列的分数。

虽然 yarGen 最适合用于未混淆的代码,但 Fnord 仅适用于混淆代码,并且应该能比 yarGen 产生更好的结果。

联系方式

关注我的 Twitter 获取更新 @cyb3rops

下载工具