Back to Blog

我们对脏话检测工具漏洞的简要分析

Code Auditing
September 21, 2022

Wintermute 项目因私钥泄露损失超过 1.6 亿美元。其根本原因是 Wintermute 项目的私钥因 Profanity 工具的一个漏洞而被泄露,Profanity 工具曾被 Wintermute 用于生成私钥和以太坊账户。

在本博客中,我们将描述 Profanity 漏洞的根本原因以及如何利用该漏洞。

以太坊地址

以太坊地址是通过公钥的 Keccak-256 哈希值生成的,并以十六进制数字表示。公钥通过椭圆曲线乘法从私钥生成,这个过程是不可逆的。我们可以从私钥获得公钥,但无法在不进行暴力破解的情况下,仅通过公钥获得私钥。请注意,私钥的长度为 256 位。给定一个公钥,您最多需要进行 2^256 次计算才能找到相应的私钥。

简而言之,私钥/公钥与以太坊地址之间的关系如下图所示。

漏洞的根本原因

Profanity 的目的是找到一个特殊的以太坊地址,例如地址的前五个数字是零。为此,Profanity 采用以下方法。

详细实现可能略有不同。

请注意,private_key 的长度为 256 位(2^256 种不同的值)。然而,在生成私钥的过程中存在一个漏洞。具体来说,种子(步骤 1)仅为 32 位,而从步骤 1 中的种子到步骤 2 中的 private_key 的过程是确定性的。

这里的安全影响是什么?

如何利用

假设我们有一个拥有大量宝贵资产的以太坊地址。如果我们能获得它的私钥,我们就可以拥有该账户并转移所有资产。然而,如前所述,我们必须暴力破解整个 2^256 的空间才能找到私钥,这几乎是不可能的

但如果以太坊地址是通过 Profanity 工具生成的呢?我们可以以低得多的难度暴力破解来定位私钥。我们只需要指定种子从 0 到 2^32-1,然后重复相同的过程,直到找到可以生成相同公钥(和以太坊地址)的私钥。因为我们最多只需要 2^32 * loop_threashold 的计算量。这在几个小时或几天/几周内是可以完成的,如果我们拥有强大的 GPU 集群。

然而,这仍然是一个优化算法。您可以在 Slowmist 的文章中找到更多详细信息

要点

让 DeFi 项目安全并非易事。除了代码审计,我们认为社区应该采取积极主动的方法来监控项目状态,并在攻击发生之前就将其阻止

关于 BlockSec

BlockSec 是一家开创性的区块链安全公司,由一群全球知名的安全专家于 2021 年创立。公司致力于提高新兴 Web3 世界的安全性和可用性,以促进其大规模采用。为此,BlockSec 提供智能合约和 EVM 链安全审计服务,用于安全开发和主动阻止威胁的Phalcon 平台,用于资金追踪和调查的MetaSleuth 平台,以及供 Web3 构建者在加密世界高效冲浪的MetaSuites 扩展

迄今为止,公司已为 MetaMask、Uniswap Foundation、Compound、Forta 和 PancakeSwap 等 300 多家知名客户提供服务,并在两轮融资中从 Matrix Partners、Vitalbridge Capital 和 Fenbushi Capital 等知名投资者那里获得了数千万美元的投资。

官方网站:https://blocksec.com/

官方 Twitter 账号:https://twitter.com/BlockSecTeam

Sign up for the latest updates
Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation
Security Insights

Drift Protocol Incident: Multisig Governance Compromise via Durable Nonce Exploitation

On April 1, 2026 (UTC), Drift Protocol on Solana suffered a $285.3M loss after an attacker exploited Solana's durable nonce mechanism to delay the execution of phished multisig approvals, ultimately transferring administrative control of the protocol's 2-of-5 Squads governance with zero timelock. With full admin privileges, the attacker created a malicious collateral market (CVT), inflated its oracle price, relaxed withdrawal protections, and drained USDC, JLP, SOL, cbBTC, and other assets through 31 rapid withdrawals in approximately 12 minutes. This incident highlights how durable nonce-based delayed execution can decouple signer intent from on-chain execution, bypassing the temporal assumptions that multisig security implicitly relies on.

Weekly Web3 Security Incident Roundup | Mar 23 – Mar 29, 2026
Security Insights

Weekly Web3 Security Incident Roundup | Mar 23 – Mar 29, 2026

This BlockSec weekly security report covers eight DeFi attack incidents detected between March 23 and March 29, 2026, across Ethereum and BNB Chain, with total estimated losses of approximately $1.53M. Incidents include a $679K flawed burn mechanism exploit on the BCE token, a $512K spot-price manipulation attack on Cyrus Finance's PancakeSwap V3 liquidity withdrawal, a $133.5K flash-loan-driven referral reward manipulation on a TUR staking contract, and multiple integer overflow, reentrancy, and accounting error vulnerabilities in DeFi protocols. The report provides detailed vulnerability analysis and attack transaction breakdowns for each incident.

Newsletter -  March 2026
Security Insights

Newsletter - March 2026

In March 2026, the DeFi ecosystem experienced three major security incidents. Resolv Protocol lost ~$80M due to compromised privileged infrastructure keys, BitcoinReserveOffering suffered ~$2.7M from a double-minting logic flaw, and Venus Protocol incurred ~$2.15M following a donation attack combined with market manipulation.

Best Security Auditor for Web3

Validate design, code, and business logic before launch. Aligned with the highest industry security standards.

BlockSec Audit