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

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

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

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

工具目录

分类

查看所有分类
Loading categories
whispers — 识别静态结构化文本中的硬编码机密 | Kitploit
工具/GitHubGitHub/skyscanner/whispers
静态分析漏洞分析代码分析配置审计DevSecOps秘密检测供应链安全Archived
GitHubskyscanner/whispers

whispers

识别静态结构化文本中的硬编码机密

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Whispers Whispers

“我的小鸟无处不在,即使在北方,它们也会向我低语最奇怪的故事。” —— 瓦里斯大人

Whispers 是一款静态代码分析工具,旨在解析各种常见数据格式,查找硬编码凭据和危险函数。Whispers 可以在命令行中运行,也可以集成到你的 CI/CD 流水线中。

检测内容

  • 密码
  • API 令牌
  • AWS 密钥
  • 私钥
  • 哈希凭据
  • 身份验证令牌
  • 危险函数
  • 敏感文件

支持的格式

Whispers 被设计为 结构化文本 解析器,而非代码解析器。

当前支持以下常用格式:

  • YAML
  • JSON
  • XML
  • .npmrc
  • .pypirc
  • .htpasswd
  • .properties
  • pip.conf
  • conf / ini
  • Dockerfile
  • Dockercfg
  • Shell 脚本
  • Python3

由于原生语言支持,Python3 文件被解析为抽象语法树(AST)。

声明与赋值格式

以下语言文件被作为文本解析,并检查常见的变量声明和赋值模式:

  • JavaScript
  • Java
  • Go
  • PHP

特殊格式

  • AWS 凭据文件
  • JDBC 连接字符串
  • Jenkins 配置文件
  • SpringFramework Beans 配置文件
  • Java Properties 文件
  • Dockercfg 私有注册表认证文件
  • Github 令牌

安装

从 PyPI 安装

root@kitploit:~
pip3 install whispers

从 GitHub 安装

root@kitploit:~
git clone https://github.com/Skyscanner/whispers
cd whispers
make install

使用

命令行

root@kitploit:~
whispers --help
whispers --info
whispers source/code/fileOrDir
whispers --config config.yml source/code/fileOrDir
whispers --output /tmp/secrets.yml source/code/fileOrDir
whispers --rules aws-id,aws-secret source/code/fileOrDir
whispers --severity BLOCKER,CRITICAL source/code/fileOrDir
whispers --exitcode 7 source/code/fileOrDir

Python

root@kitploit:~
from whispers.cli import parse_args
from whispers.core import run

src = "tests/fixtures"
configfile = "whispers/config.yml"
args = parse_args(["-c", configfile, src])
for secret in run(args):
  print(secret)

配置

Whispers 提供了多种配置选项。可以根据文件路径、键或值来包含/排除结果。文件路径规范被解释为 glob 模式。键和值支持正则表达式及其他参数。内置了一个默认配置文件,如果你不提供自定义文件,则会使用该默认配置。

config.yml 应当具有以下结构:

root@kitploit:~
include:
  files:
    - "**/*.yml"

exclude:
  files:
    - "**/test/**/*"
    - "**/tests/**/*"
  keys:
    - ^foo
  values:
    - bar$

rules:
  starks:
    message: Whispers from the North
    severity: CRITICAL
    value:
      regex: (Aria|Ned) Stark
      ignorecase: True

调整检测(即移除误报和不想要的结果)的最快方法是复制默认的 config.yml 到新文件中,修改后作为参数传递给 Whispers。

whispers --config config.yml --rules starks src/file/or/dir

自定义规则

规则指定了应从键值对中提取的具体内容。内置了多个常见规则,例如 AWS 密钥和密码,但该工具易于通过新规则扩展。

  • 自定义规则可以在主配置文件的 rules: 下定义
  • 自定义规则可以添加到 whispers/rules 目录下
root@kitploit:~
rule-id:  # unique rule name
  description: Values formatted like AWS Session Token
  message: AWS Session Token  # report will show this message
  severity: BLOCKER           # one of BLOCKER, CRITICAL, MAJOR, MINOR, INFO

  key:        # specify key format
    regex: (aws.?session.?token)?
    ignorecase: True   # case-insensitive matching

  value:      # specify value format
    regex: ^(?=.*[a-z])(?=.*[A-Z])[A-Za-z0-9\+\/]{270,450}$
    ignorecase: False  # case-sensitive matching
    minlen: 270        # value is at least this long
    isBase64: True     # value is base64-encoded
    isAscii: False     # value is binary data when decoded
    isUri: False       # value is not formatted like a URI

  similar: 0.35        # maximum allowed similarity between key and value 
                       # (1.0 being exactly the same)

插件

所有解析功能均通过插件实现。每个插件实现一个带有 pairs() 方法的类,该方法遍历文件并返回需要根据规则检查的键值对。

root@kitploit:~
class PluginName:
    def pairs(self, file):
        yield "key", "value"
下载工具