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

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

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

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

工具目录

分类

查看所有分类
Loading categories
rusty-hog — 多源秘密扫描器,通过正则表达式和熵分析检测Git仓库、S3存储桶、文件系统、Confluence、JIRA、Slack和Google Docs中的API密钥、密码和个人身份信息(PII)。 | Kitploit
工具/GitHubGitHub/newrelic/rusty-hog
代码分析云安全DevSecOps秘密检测
GitHubnewrelic/rusty-hog

rusty-hog

多源秘密扫描器,通过正则表达式和熵分析检测Git仓库、S3存储桶、文件系统、Confluence、JIRA、Slack和Google Docs中的API密钥、密码和个人身份信息(PII)。

查看仓库
5556316天前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Rusty Hog 是一个用 Rust 构建的高性能秘密扫描器,基于用 Python 编写的 TruffleHog。Rusty Hog 提供以下二进制文件:

  • Ankamali Hog: 扫描 Google 文档中的秘密。
  • Berkshire Hog: 扫描 S3 存储桶中的秘密。
  • Choctaw Hog: 扫描 Git 仓库中的秘密。
  • Duroc Hog: 扫描目录、文件和归档中的秘密。
  • Essex Hog: 扫描 Confluence Wiki 页面中的秘密。
  • Gottingen Hog: 扫描 JIRA 议题中的秘密。
  • Slack Hog: 扫描 Slack 频道中的秘密。

目录

  • 使用方法
    • 如何通过下载的二进制文件安装
    • 如何通过 DockerHub 运行
    • 如何构建
    • 如何在 Windows 上构建
    • Anakamali Hog(GDoc 扫描器)使用方法
    • Berkshire Hog(S3 扫描器 - CLI)使用方法
    • Berkshire Hog(S3 扫描器 - Lambda)使用方法
    • Choctaw Hog(Git 扫描器)使用方法
    • Duroc Hog(文件系统扫描器)使用方法
    • Essex Hog(Confluence 扫描器)使用方法
    • Gottingen Hog(JIRA 扫描器)使用方法
    • Hante Hog(Slack 扫描器)使用方法
    • 正则表达式 JSON 文件格式
    • 允许列表 JSON 文件格式
  • 项目信息
    • 开源许可证
    • 支持
    • 社区
    • 问题 / 功能增强请求
    • 贡献指南
    • 功能路线图
    • 名称含义

使用方法

本项目提供一组扫描器,使用正则表达式来尝试检测敏感信息的存在,例如 API 密钥、密码和个人信息。它默认包含一组正则表达式,但也接受包含自定义正则表达式的 JSON 对象。

如何通过下载的二进制文件安装

下载并解压发布标签页上的 最新 ZIP。然后,使用 -h 运行每个二进制文件以查看使用方法。```shell script wget https://github.com/newrelic/rusty-hog/releases/download/v1.0.11/rustyhogs-darwin-choctaw_hog-1.0.11.zip unzip rustyhogs-darwin-choctaw_hog-1.0.11.zip darwin_releases/choctaw_hog -h

root@kitploit:~
## 如何使用 DockerHub 运行
Rusty Hog Docker 镜像可以在作者的个人 DockerHub 页面 [这里](https://hub.docker.com/u/wetfeet2000) 找到
每个 Hog 和每个版本都会构建一个 Docker 镜像。因此,要使用 choctaw_hog,你可以运行以下命令:```shell script
docker pull wetfeet2000/choctaw_hog:1.0.10
docker run -it --rm wetfeet2000/choctaw_hog:1.0.10 --help

如何构建

  • 确保你已安装 Rust 并已将其添加到环境路径中。
  • 克隆此仓库,然后运行 cargo build --release。二进制文件位于 target/release 目录中。
  • 要构建并查看 HTML 文档,请运行 cargo doc --no-deps --open。
  • 要运行单元测试,请运行 cargo test。
  • 要为 AWS Lambda 环境交叉编译 Berkshire Hog,请运行以下命令并将 berkshire_lambda.zip 上传到你的 AWS Lambda 仪表板:```shell script docker run --rm -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder cargo build --release cp target/x86_64-unknown-linux-musl/release/berkshire_hog bootstrap zip -j berkshire_lambda.zip bootstrap
root@kitploit:~
## 如何在 Windows 上构建
您需要编译静态 OpenSSL 二进制文件,并告诉 Rust/Cargo 在哪里找到它们:```
mkdir \Tools
cd \Tools
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg.exe install openssl:x64-windows-static

$env:OPENSSL_DIR = 'C:\Tools\vcpkg\installed\x64-windows-static'
$env:OPENSSL_STATIC = 'Yes'
[System.Environment]::SetEnvironmentVariable('OPENSSL_DIR', $env:OPENSSL_DIR, [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable('OPENSSL_STATIC', $env:OPENSSL_STATIC, [System.EnvironmentVariableTarget]::User)

现在你可以按照上面列出的主要构建说明进行操作。

如何为 Lambda 构建 Berkshire Hog

macOS

使用 Homebrew 获取依赖项:``` brew install rpm2cpio FiloSottile/musl-cross/musl-cross

root@kitploit:~
然后运行 `./build_lambda_macos.sh`。

构建脚本将基于 OpenSSL 3.0.12 进行构建。使用 `export OPENSSL_BUILD_VER=3.0.12` 进行覆盖。

构建脚本将基于 Amazon Linux 内核头文件(由其 RPM 提供)进行构建;使用 `export AMAZON_KERNEL_HEADERS_RPM_URL=...` 覆盖 RPM 的下载位置。(不禁止使用其他发行版的 linux-headers RPM,我们只需要 linux-headers 来为 Linux 构建 openssl)

构建脚本将在当前源码根目录创建一个 build-deps 目录。你可以安全地 `rm -rf` 该目录,但下次运行构建脚本时会重新创建。它还会进行各种一致性检查,确保构建能够正常进行,如果检查失败,可能会要求你 `rm -rf` 该目录以重新尝试。

### Linux

确保已安装 `cross`(`cargo install cross`),然后只需运行 `./build_lambda.sh`。

# 命令

## Anakamali Hog(GDoc 扫描器)用法```
USAGE:
    ankamali_hog [FLAGS] [OPTIONS] <GDRIVEID>

FLAGS:
        --caseinsensitive    Sets the case insensitive flag for all regexes
        --entropy            Enables entropy scanning
        --oauthsecret        Path to an OAuth secret file (JSON) ./clientsecret.json by default
        --oauthtoken         Path to an OAuth token storage file ./temp_token by default
        --prettyprint        Outputs the JSON in human readable format
    -v, --verbose            Sets the level of debugging information
    -h, --help               Prints help information
    -V, --version            Prints version information

OPTIONS:
    -a, --allowlist <ALLOWLIST>                                    Sets a custom allowlist JSON file
        --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD>    Default entropy threshold (0.6 by default)
    -o, --outputfile <OUTPUT>                                      Sets the path to write the scanner results to (stdout by default)

        --regex <REGEX>                                            Sets a custom regex JSON file

ARGS:
    <GDRIVEID>    The ID of the Google drive file you want to scan

Berkshire Hog (S3 Scanner - CLI) 使用```

USAGE: berkshire_hog [FLAGS] [OPTIONS]

FLAGS: --caseinsensitive Sets the case insensitive flag for all regexes --entropy Enables entropy scanning --prettyprint Outputs the JSON in human readable format -r, --recursive Recursively scans files under the prefix -v, --verbose Sets the level of debugging information -h, --help Prints help information -V, --version Prints version information

OPTIONS: -a, --allowlist Sets a custom allowlist JSON file --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD> Default entropy threshold (0.6 by default) -o, --outputfile Sets the path to write the scanner results to (stdout by default)

root@kitploit:~
    --profile <PROFILE>                                        When using a configuration file, enables a non-default profile

    --regex <REGEX>                                            Sets a custom regex JSON file

ARGS: The location of a S3 bucket and optional prefix or filename to scan. This must be written in the form s3://mybucket[/prefix_or_file] Sets the region of the S3 bucket to scan

root@kitploit:~
## Berkshire Hog(S3 扫描器 - Lambda)使用说明

Berkshire Hog 目前设计为作为 Lambda 函数使用。以下是基本数据流:
<pre>
    ┌───────────┐              ┌───────┐     ┌────────────────┐     ┌────────────┐
    │ S3 bucket │ ┌────────┐   │       │     │ Berkshire Hog  │     │ S3 bucket  │
    │  (input) ─┼─┤S3 event├──▶│  SQS  │────▶│    (Lambda)    │────▶│  (output)  │
    │           │ └────────┘   │       │     │                │     │            │
    └───────────┘              └───────┘     └────────────────┘     └────────────┘
</pre>

若要按此方式运行 Berkshire Hog,请设置以下内容:
1) 配置输入存储桶,使其针对每个 PUSH/PUT 事件向 SQS 发送“事件”。
2) 设置 SQS 主题以接受来自 S3 的事件,包括 IAM 权限。
3) 使用对 SQS 和 S3 具有 IAM 访问权限的方式运行 Berkshire Hog。

## Choctaw Hog(Git 扫描器)使用说明```
USAGE:
    choctaw_hog [FLAGS] [OPTIONS] <GITPATH>

FLAGS:
        --caseinsensitive    Sets the case insensitive flag for all regexes
        --entropy            Enables entropy scanning
        --prettyprint        Outputs the JSON in human readable format
    -v, --verbose            Sets the level of debugging information
    -h, --help               Prints help information
    -V, --version            Prints version information

OPTIONS:
        --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD>    Default entropy threshold (4.5 by default)
        --httpspass <HTTPSPASS>                                    Takes a password for HTTPS-based authentication
        --httpsuser <HTTPSUSER>                                    Takes a username for HTTPS-based authentication
    -o, --outputfile <OUTPUT>                                      Sets the path to write the scanner results to (stdout by default)
        --recent_days <RECENTDAYS>                                 Filters commits to the last number of days (branch agnostic)
    -r, --regex <REGEX>                                            Sets a custom regex JSON file
        --since_commit <SINCECOMMIT>                               Filters commits based on date committed (branch agnostic)
        --sshkeypath <SSHKEYPATH>                                  Takes a path to a private SSH key for git authentication, defaults to ssh-agent
        --sshkeyphrase <SSHKEYPHRASE>                              Takes a passphrase to a private SSH key for git authentication, defaults to none
        --until_commit <UNTILCOMMIT>                               Filters commits based on date committed (branch agnostic)
    -a, --allowlist <ALLOWLIST>                                    Sets a custom ALLOWLIST JSON file

ARGS:
    <GITPATH>    Sets the path (or URL) of the Git repo to scan. SSH links must include username (git@)

Duroc Hog (文件系统扫描器) 用法```

USAGE: duroc_hog [FLAGS] [OPTIONS]

FLAGS: --caseinsensitive Sets the case insensitive flag for all regexes --entropy Enables entropy scanning --norecursive Disable recursive scanning of all subdirectories underneath the supplied path --prettyprint Outputs the JSON in human readable format -z, --unzip Recursively scans archives (ZIP and TAR) in memory (dangerous) -v, --verbose Sets the level of debugging information -h, --help Prints help information -V, --version Prints version information

OPTIONS: -a, --allowlist Sets a custom allowlist JSON file --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD> Default entropy threshold (0.6 by default) -o, --outputfile Sets the path to write the scanner results to (stdout by default) -r, --regex Sets a custom regex JSON file

ARGS: Sets the path of the directory or file to scan.

root@kitploit:~
## Essex Hog (Confluence 扫描器) 使用```
USAGE:
    essex_hog [FLAGS] [OPTIONS] <PAGEID> <URL>

FLAGS:
        --caseinsensitive    Sets the case insensitive flag for all regexes
        --entropy            Enables entropy scanning
        --prettyprint        Outputs the JSON in human readable format
    -v, --verbose            Sets the level of debugging information
    -h, --help               Prints help information
    -V, --version            Prints version information

OPTIONS:
    -a, --allowlist <ALLOWLIST>                                    Sets a custom allowlist JSON file
        --authtoken <BEARERTOKEN>                                  Confluence basic auth bearer token (instead of user & pass)

        --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD>    Default entropy threshold (0.6 by default)
    -o, --outputfile <OUTPUT>                                      Sets the path to write the scanner results to (stdout by default)
        --password <PASSWORD>                                      Confluence password (crafts basic auth header)
        --regex <REGEX>                                            Sets a custom regex JSON file
        --username <USERNAME>                                      Confluence username (crafts basic auth header)

ARGS:
    <PAGEID>    The ID (e.g. 1234) of the confluence page you want to scan
    <URL>       Base URL of Confluence instance (e.g. https://newrelic.atlassian.net/)

Gottingen Hog (JIRA 扫描器) 用法```

Jira secret scanner in Rust.

USAGE: gottingen_hog [FLAGS] [OPTIONS]

FLAGS: --caseinsensitive Sets the case insensitive flag for all regexes --entropy Enables entropy scanning --prettyprint Outputs the JSON in human readable format -v, --verbose Sets the level of debugging information -h, --help Prints help information -V, --version Prints version information

OPTIONS: -a, --allowlist Sets a custom allowlist JSON file --authtoken Jira basic auth bearer token (instead of user & pass) --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD> Default entropy threshold (0.6 by default) --url Base URL of JIRA instance (e.g. https://jira.atlassian.net/) -o, --outputfile Sets the path to write the scanner results to (stdout by default) --password Jira password (crafts basic auth header) --regex Sets a custom regex JSON file --username Jira username (crafts basic auth header)

ARGS: The ID (e.g. PROJECT-123) of the Jira issue you want to scan

root@kitploit:~
## Hante Hog (SLACK scanner) 用法```
Slack secret scanner in Rust.

USAGE:
    hante_hog [FLAGS] [OPTIONS] --authtoken <BEARERTOKEN> --channelid <CHANNELID> --url <SLACKURL>

FLAGS:
        --caseinsensitive    Sets the case insensitive flag for all regexes
        --entropy            Enables entropy scanning
        --prettyprint        Outputs the JSON in human readable format
    -v, --verbose            Sets the level of debugging information
    -h, --help               Prints help information
    -V, --version            Prints version information

OPTIONS:
    -a, --allowlist <ALLOWLIST>                                    Sets a custom allowlist JSON file
        --authtoken <BEARERTOKEN>                                  Slack basic auth bearer token
        --channelid <CHANNELID>
            The ID (e.g. C12345) of the Slack channel you want to scan

        --default_entropy_threshold <DEFAULT_ENTROPY_THRESHOLD>    Default entropy threshold (0.6 by default)
        --latest <LATEST>                                          End of time range of messages to include in search
        --oldest <OLDEST>                                          Start of time range of messages to include in search
    -o, --outputfile <OUTPUT>
            Sets the path to write the scanner results to (stdout by default)

        --regex <REGEX>                                            Sets a custom regex JSON file
        --url <SLACKURL>
            Base URL of Slack Workspace (e.g. https://[WORKSPACE NAME].slack.com)

正则表达式 JSON 文件格式

扫描器上的正则表达式选项允许用户提供指向其自定义 JSON 文件的路径,该文件包含可匹配敏感内容的正则表达式。当前,任何提供的文件将会替换(而不是追加)SecretScanner 提供的默认正则表达式。该文件的预期格式为单个 JSON 对象。

键应为每个正则表达式条目所检测的秘密类型的名称,因为这些键将用于扫描器输出的原因(reason)属性。

每个值应为一个字符串,包含一个有效的 [https://docs.rs/regex/1.3.9/regex/#syntax](针对 Rust 的正则表达式),该表达式应匹配其对应键所描述的秘密类型。

自版本 1.0.8 起,Rusty Hog 引擎还支持将对象作为每个秘密的值。该对象可以包含以下所有属性:

  • 一个 pattern 属性,包含匹配的正则表达式(必需)
  • 一个 entropy_filter 属性,带有布尔值,用于为此信息启用熵扫描(必需)
  • 一个 threshold 属性,用于自定义熵容限,范围为 0 - 1(可选;会自动适应旧的 1-8 格式,默认值为 0.6)
  • 一个 keyspace 属性,用于指示键中可能有多少个值,例如 16 表示十六进制,64 表示 base64,128 表示 ASCII(可选,默认值为 128)
  • 一个 make_ascii_lowercase 属性,用于指示 Rust 是否应在计算熵之前对键执行 .make_ascii_lowercase()(可选,默认值为 false)

阈值越高,匹配秘密所需的熵越多。

以下是一个此格式的示例:```json { "Generic Secret": { "pattern": "(?i)secret[\s[[:punct:]]]{1,4}[0-9a-zA-Z-]{16,64}[\s[[:punct:]]]?", "entropy_filter": true, "threshold": "0.6" }, "Slack Token": { "pattern": "(xox[p|b|o|a]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32})", "entropy_filter": true, "threshold": "0.6", "keyspace": "36", "make_ascii_lowercase": true }, "Google API Key": { "pattern": "AIza[0-9A-Za-z\-]{35}", "entropy_filter": true }, "PGP private key block": "-----BEGIN PGP PRIVATE KEY BLOCK-----" }

root@kitploit:~
自1.0.11版本以来,当前使用的默认正则表达式JSON如下:```json
{
	"Slack Token": "(xox[p|b|o|a]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32})",
	"RSA private key": "-----BEGIN RSA PRIVATE KEY-----",
	"SSH (DSA) private key": "-----BEGIN DSA PRIVATE KEY-----",
	"SSH (EC) private key": "-----BEGIN EC PRIVATE KEY-----",
	"PGP private key block": "-----BEGIN PGP PRIVATE KEY BLOCK-----",
	"Amazon AWS Access Key ID": "AKIA[0-9A-Z]{16}",
	"Amazon MWS Auth Token": "amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
	"Facebook Access Token": "EAACEdEose0cBA[0-9A-Za-z]+",
	"Facebook OAuth": "(?i)facebook[\\s[[:punct:]]]{1,4}[0-9a-f]{32}[\\s[[:punct:]]]?",
	"GitHub": "(?i)(github|access[[:punct:]]token)[\\s[[:punct:]]]{1,4}[0-9a-zA-Z]{35,40}",
	"Generic API Key": {
		"pattern": "(?i)(api|access)[\\s[[:punct:]]]?key[\\s[[:punct:]]]{1,4}[0-9a-zA-Z\\-_]{16,64}[\\s[[:punct:]]]?",
		"entropy_filter": true,
		"threshold": "0.6",
		"keyspace": "guess"
	},
	"Generic Account API Key": {
		"pattern": "(?i)account[\\s[[:punct:]]]?api[\\s[[:punct:]]]{1,4}[0-9a-zA-Z\\-_]{16,64}[\\s[[:punct:]]]?",
		"entropy_filter": true,
		"threshold": "0.6",
		"keyspace": "guess"
	},
	"Generic Secret": {
		"pattern": "(?i)secret[\\s[[:punct:]]]{1,4}[0-9a-zA-Z-_]{16,64}[\\s[[:punct:]]]?",
		"entropy_filter": true,
		"threshold": "0.6",
		"keyspace": "guess"
	},
	"Google API Key": "AIza[0-9A-Za-z\\-_]{35}",
	"Google Cloud Platform API Key": "AIza[0-9A-Za-z\\-_]{35}",
	"Google Cloud Platform OAuth": "(?i)[0-9]+-[0-9A-Za-z_]{32}\\.apps\\.googleusercontent\\.com",
	"Google Drive API Key": "AIza[0-9A-Za-z\\-_]{35}",
	"Google Drive OAuth": "(?i)[0-9]+-[0-9A-Za-z_]{32}\\.apps\\.googleusercontent\\.com",
	"Google (GCP) Service-account": "(?i)\"type\": \"service_account\"",
	"Google Gmail API Key": "AIza[0-9A-Za-z\\-_]{35}",
	"Google Gmail OAuth": "(?i)[0-9]+-[0-9A-Za-z_]{32}\\.apps\\.googleusercontent\\.com",
	"Google OAuth Access Token": "ya29\\.[0-9A-Za-z\\-_]+",
	"Google YouTube API Key": "AIza[0-9A-Za-z\\-_]{35}",
	"Google YouTube OAuth": "(?i)[0-9]+-[0-9A-Za-z_]{32}\\.apps\\.googleusercontent\\.com",
	"Heroku API Key": "[h|H][e|E][r|R][o|O][k|K][u|U][\\s[[:punct:]]]{1,4}[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}",
	"MailChimp API Key": "[0-9a-f]{32}-us[0-9]{1,2}",
	"Mailgun API Key": "(?i)key-[0-9a-zA-Z]{32}",
	"Credentials in absolute URL": "(?i)((https?|ftp)://)(([a-z0-9$_\\.\\+!\\*'\\(\\),;\\?&=-]|%[0-9a-f]{2})+(:([a-z0-9$_\\.\\+!\\*'\\(\\),;\\?&=-]|%[0-9a-f]{2})+)@)((([a-z0-9]\\.|[a-z0-9][a-z0-9-]*[a-z0-9]\\.)*[a-z][a-z0-9-]*[a-z0-9]|((\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5]))(:\\d+)?)(((/+([a-z0-9$_\\.\\+!\\*'\\(\\),;:@&=-]|%[0-9a-f]{2})*)*(\\?([a-z0-9$_\\.\\+!\\*'\\(\\),;:@&=-]|%[0-9a-f]{2})*)?)?)?",
	"PayPal Braintree Access Token": "(?i)access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}",
	"Picatic API Key": "(?i)sk_live_[0-9a-z]{32}",
	"Slack Webhook": "(?i)https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}",
	"Stripe API Key": "(?i)sk_live_[0-9a-zA-Z]{24}",
	"Stripe Restricted API Key": "(?i)rk_live_[0-9a-zA-Z]{24}",
	"Square Access Token": "(?i)sq0atp-[0-9A-Za-z\\-_]{22}",
	"Square OAuth Secret": "(?i)sq0csp-[0-9A-Za-z\\-_]{43}",
	"Twilio API Key": "SK[0-9a-fA-F]{32}",
	"Twitter Access Token": "(?i)twitter[\\s[[:punct:]]]{1,4}[1-9][0-9]+-[0-9a-zA-Z]{40}",
	"Twitter OAuth": "(?i)twitter[\\s[[:punct:]]]{1,4}['|\"]?[0-9a-zA-Z]{35,44}['|\"]?",
	"New Relic Partner & REST API Key": "[\\s[[:punct:]]][A-Fa-f0-9]{47}[\\s[[:punct:]][[:cntrl:]]]",
	"New Relic Mobile Application Token": "[\\s[[:punct:]]][A-Fa-f0-9]{42}[\\s[[:punct:]][[:cntrl:]]]",
	"New Relic Synthetics Private Location": "(?i)minion_private_location_key",
	"New Relic Insights Key (specific)": "(?i)insights[\\s[[:punct:]]]?(key|query|insert)[\\s[[:punct:]]]{1,4}\\b[\\w-]{32,40}\\b",
	"New Relic Insights Key (vague)": "(?i)(query|insert)[\\s[[:punct:]]]?key[\\s[[:punct:]]]{1,4}b[\\w-]{32,40}\\b",
	"New Relic License Key": "(?i)license[\\s[[:punct:]]]?key[\\s[[:punct:]]]{1,4}\\b[\\w-]{32,40}\\b",
	"New Relic Internal API Key": "(?i)nr-internal-api-key",
	"New Relic HTTP Auth Headers and API Key": "(?i)(x|newrelic|nr)-?(admin|partner|account|query|insert|api|license)-?(id|key)[\\s[[:punct:]]]{1,4}\\b[\\w-]{32,47}\\b",
	"New Relic API Key Service Key (new format)": "(?i)NRAK-[A-Z0-9]{27}",
	"New Relic APM License Key (new format)": "(?i)[a-f0-9]{36}NRAL",
	"New Relic APM License Key (new format, region-aware)": "(?i)[a-z]{2}[0-9]{2}xx[a-f0-9]{30}NRAL",
	"New Relic REST API Key (new format)": "(?i)NRRA-[a-f0-9]{42}",
	"New Relic Admin API Key (new format)": "(?i)NRAA-[a-f0-9]{27}",
	"New Relic Insights Insert Key (new format)": "(?i)NRII-[A-Za-z0-9-_]{32}",
	"New Relic Insights Query Key (new format)": "(?i)NRIQ-[A-Za-z0-9-_]{32}",
	"New Relic Synthetics Private Location Key (new format)": "(?i)NRSP-[a-z]{2}[0-9]{2}[a-f0-9]{31}",
	"Email address": "(?i)\\b(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*)@[a-z0-9][a-z0-9-]+\\.(com|de|cn|net|uk|org|info|nl|eu|ru)([\\W&&[^:/]]|\\A|\\z)",
	"New Relic Account IDs in URL": "(newrelic\\.com/)?accounts/\\d{1,10}/",
	"Account ID": "(?i)account[\\s[[:punct:]]]?id[\\s[[:punct:]]]{1,4}\\b[\\d]{1,10}\\b",
	"Salary Information": "(?i)(salary|commission|compensation|pay)([\\s[[:punct:]]](amount|target))?[\\s[[:punct:]]]{1,4}\\d+"
}

允许列表 JSON 文件格式

扫描器提供允许列表功能。这允许你为每个模式指定一个正则表达式列表,扫描器会忽略这些正则表达式。现在,你还可以选择提供一个正则表达式列表,这些正则表达式会针对文件路径进行评估。

该允许列表文件的格式应为单个 JSON 对象。允许列表中的每个键应与正则表达式 JSON 中的键匹配,其值可以是以下两种之一:

  1. 一个字符串数组,表示该正则表达式模式的例外。例如:
  2. 一个对象,包含至少一个键(patterns),并可选择包含第二个键(paths)。

此外,你可以指定键 <GLOBAL>,它将针对所有模式进行评估。

以下是所有扫描中包含的默认允许列表:```json { "Email address": { "patterns": [ "(?i)@newrelic.com", "(?i)noreply@", "(?i)test@" ], "paths": [ "(?i)authors", "(?i)contributors", "(?i)license", "(?i)maintainers", "(?i)third_party_notices" ] }, "Credentials in absolute URL": { "patterns": [ "(?i)(https?://)?user:pass(word)?@" ] }, "New Relic API Key Service Key (new format)": { "patterns": [ "NRAK-123456789ABCDEFGHIJKLMNOPQR" ] }, "Generic API Key": { "patterns": [ "(?i)sanitizeAPIKeyForLogging" ] }, "New Relic License Key": { "patterns": [ "(?i)bootstrap_newrelic_admin_license_key", "(?i)xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "(?i)YOUR_NEW_RELIC_LICENSE_KEY__LICENSE", "(?i)YOUR_NEW_RELIC_APPLICATION_TOKEN" ] }, "Generic Secret": { "patterns": [ "(?i)secret:NewRelicLicenseKeySecret" ] }, "": [ "(?i)example", "(?i)fake", "(?i)replace", "(?i)deadbeef", "(?i)ABCDEFGHIJKLMNOPQRSTUVWX", "1234567890" ] }

root@kitploit:~
请注意,这些是字符串,而非正则表达式,并且此允许列表的键必须是正则 JSON 中存在的键。键区分大小写。

# 项目信息
## 开源许可证

本项目基于 [Apache 2 许可证](https://github.com/newrelic/rusty-hog/blob/HEAD/LICENSE) 发布。

## 支持

New Relic 已将本项目开源。本项目按“现状”提供,不附带任何担保或支持,但您可以在 GitHub 上报告问题并参与贡献。

_请不要向 New Relic 全球技术支持报告本软件的问题。_

## 社区

New Relic 主持并管理着一个在线论坛,客户可在此与 New Relic 员工及其他客户互动,获取帮助并分享最佳实践。与所有 New Relic 官方开源项目一样,New Relic Explorer's Hub 中有一个相关的社区主题。您可以在此处找到该项目的主题/讨论:

https://discuss.newrelic.com/t/rusty-hog-multi-platform-secret-key-scanner/90117

## 问题 / 功能增强请求

请在本仓库的 [Issues 标签页](https://raw.githubusercontent.com/newrelic/issues) 提交问题和功能增强请求。提交新问题前,请先搜索并查看已有的未解决问题。

## 贡献

欢迎贡献(如果您提交功能增强请求,预计会被邀请亲自参与贡献)。请阅读我们的 [贡献者指南](https://github.com/newrelic/rusty-hog/blob/HEAD/CONTRIBUTING.md)。

需要注意的是,当您提交拉取请求时,需要通过 CLA-Assistant 点击签署贡献者许可协议(CLA)。如果您希望执行我们的企业 CLA,或有任何疑问,请发送邮件至 [email protected]。

## 功能路线图
  
- 1.1:企业功能
    - [ ] 支持配置文件(而非命令行参数)
    - [ ] 支持环境变量而非 CLI 参数
    - [ ] 多线程
    - [ ] 更好的上下文检测与误报过滤(GitHound、机器学习)
    - [ ] 使用 Rusoto 替代 s3-rust
    - [x] 添加 JIRA 扫描器
    - [x] 添加文件系统和归档扫描器
    - [ ] 使用 Rust 特性减少编译依赖?

- 1.2:与更大脚本和 UI 的集成
    - [ ] 支持 GitHub API 进行更大的组织管理
        - [ ] 扫描用户列表下的所有仓库
        - [x] 扫描组织内的所有仓库
    - [ ] 生成 Web 报告或 Web 界面。支持从 UI 生成“保存状态”。
    - [ ] 代理/管理模型
    - [ ] 调度进程(受阻于保存状态支持)

## 名字的含义是什么?
TruffleHog 被认为是事实上的标准/原始秘密扫描器。我一直在基于 TruffleHog 构建一套适用于各种平台的秘密扫描工具,并需要一套命名方案,因此我从维基百科的[猪的品种列表](https://en.wikipedia.org/wiki/List_of_pig_breeds)顶部开始命名。因此每个工具名称都是一个猪的品种,从 'A' 开始逐一向上。
下载工具