攻击性安全工具:Troll-A

admin 2024年1月2日09:39:22评论35 views字数 3607阅读12分1秒阅读模式


明细还没搞完毕,今天是元旦,祝大家元旦快乐!发个工具代表今年社区发展方向!  目前社区针对成员技术提升的细节大类是:外内网—Pyhton;这两大类。具体的可以添加我VX等待完毕后通知大家!


攻击性安全工具:Troll-A


Troll-A

crissyfield 的 Troll-A 是一个命令行工具,用于从 WARC (Web ARChive) 文件中提取密码、API 密钥和令牌等机密。Troll-A 是一种易于使用全面快速的解决方案,用于在网络档案中查找秘密。


特征

  • 协议:支持通过 HTTP/HTTPS 直接从网络服务器、Amazon S3 对象存储服务或本地文件系统检索 Web 档案。

  • 压缩:支持使用 GZip、BZip2 或 ZStd 压缩的 Web 存档。对于 ZStd,它还支持在压缩数据流前面添加自定义字典(由 *.megawarc.warc.zst 文件使用)。

  • 全面:使用 Gitleaks 项目中久经考验的规则集来检测多达 166 种不同类型的机密、令牌、密钥或其他敏感信息。

  • 性能:在 AWS c7g.12xlarge 上,并可同时工作,并可选择使用优化的正则表达式(通过 go-re2)在不到 30 秒的时间内处理典型的 Common Crawl Web 存档(~34.000 页)。

安装

下载

Troll-A 在发布页面上以二进制形式提供,适用于 macOS 和 Linux。

建筑

为了获得更好的性能,建议从源代码构建 Troll-A,因为这允许使用 go-re2 提供的优化正则表达式引擎。为此,必须先安装 RE2 依赖项。

macOS操作系统

# Install dependencies
brew install re2
# Install with RE2 activated
go install -tags re2_cgo github.com/crissyfield/troll-a@v1.0.0

Debian / Ubuntu的


# Install dependencies
sudo apt install -u build-essential libre2-dev
# Install with RE2 activated
go install -tags re2_cgo github.com/crissyfield/troll-a@v1.0.0

用法


Usage:  troll-a [flags] url    This tool allows to extract (potential) secrets such as passwords, API keys, and tokensfrom WARC (Web ARChive) files. Extracted information is output as structured text orgJSON, which simplifies further processing of the data.
"url" can be either a regular HTTP or HTTPS reference ("https://domain/path"), an AmazonS3 reference ("s3://bucket/path"), or a file path (either "file:///path" or simply"path"). If the data is compressed with either GZip, BZip2, or ZStd it is automaticallydecompressed. ZStd with a prepended custom dictionary (as used by "*.megawarc.warc.zstd")is also handled transparently.
This tool uses rules from the Gitleaks project (https://gitleaks.io) to detect secrets.
Flags:  -e, --enclosed               only report secrets that are enclosed within their context  -h, --help                   help for troll-a  -j, --jobs uint              detect secrets with this many concurrent jobs (default 8)  -s, --json                   output detected secrets as JSON  -p, --preset rules-preset    rules preset to use. This could be one of the following:                               all:         All known rules will be applied, which can                                            result in a significant amount of noise for                                            large data sets.                               most:        Most of the rules are applied, skipping the                                            biggest culprits for false positives.                               secret:      Only rules are applied that are most likely                                            to result in an actual leak of a secret.                               No other values are allowed. (default secret)  -q, --quiet                  suppress success message(s)  -r, --retry retry-strategy   retry strategy to use. This could be one of the following:                               never:       This strategy will fail after the first fetch                                            failure and will not attempt to retry.                               constant:    This strategy will attempt to retry up to 5                                            times, with a 5s delay after each attempt.                               exponential: This strategy will attempt to retry for 15                                            minutes, with an exponentially increasing                                            delay after each attempt.                               always:      This strategy will attempt to retry forever,                                            with no delay at all after each attempt.                               No other values are allowed. (default never)  -t, --timeout duration       fetching timeout (does not apply to files) (default 30m0s)  -v, --version                version for troll-a

例子


Common Crawl 维护着一个免费、开放的网络爬虫数据存储库,任何人都可以使用。Common Crawl 语料库包含自 2008 年以来定期收集的 PB 级数据。


例如,要从 2023 年 11 月/12 月爬网(称为 CC-MAIN-2023-50)的所有 33.5 亿个页面中提取机密,您可以执行以下操作:

# Download the list of all 90.000 WARC paths
curl -sSL -O https://data.commoncrawl.org/crawl-data/CC-MAIN-2023-50/warc.paths.gz
# Iterate through all paths using 64 scanning jobs, output matches as JSON
gzcat warc.paths.gz |
xargs -I{} -- troll-a -e -s -j64 https://data.commoncrawl.org/{} > secrets.json


这将需要很长时间!根据您的硬件和 Internet 连接,这可能需要一周到几个月的时间。您可能只想对 warc.paths.gz 的前几行运行此示例。


互联网档案馆  

https://wiki.archiveteam.org/index.php

档案团队是一个致力于数字保存和网络存档的团队,成立于 2009 年。网络档案被存储为WARC文件(更具体地说,以MegaWARC格式),并通过互联网档案馆提供。

例如,要从 2023 年 4 月存档团队从 pastebin.com 抓取的 113.372 个页面中提取机密(这是 Internet Archive 上的相应出版物),您可以这样做:

# Call troll-a directly with the MegaWARC URLtroll-a -e https://archive.org/download/archiveteam_pastebin_20230421003309_a3b951b4/pastebin_20230421003309_a3b951b4.1603050931.megawarc.warc.zst

...这导致...

攻击性安全工具:Troll-A


从这里克隆存储库:https://github.com/crissyfield/troll-a


2024—ESN社区—成员招募

原文始发于微信公众号(Esn技术社区):攻击性安全工具:Troll-A

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年1月2日09:39:22
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   攻击性安全工具:Troll-Ahttp://cn-sec.com/archives/2354678.html

发表评论

匿名网友 填写信息