Back to Blog

阻止 TransitSwap 攻击:行业首例“反击”挽回 30 万美元

November 21, 2022
4 min read

自 BlockSec 于 2021 年首次亮相以来,我们一直认为仅靠代码审计无法解决 Web3 安全问题。因此,我们一直在投入探索 Web3 安全的新范式。为此,我们创建了 Phalcon,这是世界上第一个加密货币黑客阻止系统。

在 Phalcon 推出之前,该系统已在内部运行 2 年,成功阻止了 20 多起黑客攻击,并挽救了价值超过 2000 万美元的资产,其中包括为 Saddle Finance 挽回 380 万美元,为 Platypus 挽回 240 万美元,为 ParaSpace 挽回 500 万美元,等等。

在本系列文章中,我们将展示我们 Phalcon 系统的代表性成功案例。今天,让我们来看看行业首例“反击黑客”事件,挽回了 30 万美元。

我们如何为 TransitSwap(和 BabySwap)追回被盗资金

攻击与防御之间不断演变的较量,反映了现实世界的多元和多彩。我们的经验表明,主动威胁预防并非单一的独特技能;相反,它是一种系统性的方法,结合了各种安全技术和努力。

这个故事突出了网络安全的错综复杂,让我们回顾一下我们在 BSC 上与 BabySwap 和 TransitSwap 攻击相关的经验。有关详细分析,请参阅 我们之前的报告

Transit Swap 发布更新
Transit Swap 发布更新

2022 年 10 月 1 日 UTC 时间 14:47,我们的内部系统识别了一笔 攻击交易。在调查过程中,我们发现该交易是由一个机器人账户发起的,该账户抢先执行了 原始攻击。该账户的特征是前面有八个零,这表明它是由易受攻击的 Profanity 工具生成的。

机会偏爱有准备的人,我们已经根据 我们之前的努力 开发了一个救援工具,用于恢复易受攻击的 Profanity 地址的私钥。

UTC 时间 16:10,我们的工具仅用 20 分钟就迅速恢复了机器人的私钥。根据我们 标准的救援程序,我们将资金迅速转移到一个安全账户。此举确保了其他可能恢复私钥的人无法访问该账户并危及资金。

然而,我们面临一个障碍:资金位于机器人部署的 合约 中,而不是其 EOA 账户。通过反编译合约,我们识别了一个可用于检索资金的 withdraw 函数(如下图所示)。

我们将代币地址作为第一个参数,零作为第二个参数,执行了 一笔交易,成功地将资金从合约提取到机器人,然后 将其转移到我们的安全账户

几个小时后,我们的系统检测到 TransitSwap 上的另一项攻击。在几笔攻击交易中,有一笔再次被机器人抢先执行。然而,由于机器人部署的合约与之前的不同,用于转出资金的函数也不同。

我们决定将资金归还给被攻击的项目(而不是机器人),原因如下:

  • 首先,机器人通过抢先执行攻击交易获得了资金,我们认为这本身就是一种攻击;
  • 其次,这些资金属于攻击的受害者,即受影响 DeFi 协议的用户。这些用户已经因为 DeFi 协议中的漏洞而遭受了损失,理应从攻击者那里获得资金。

这种系统性的方法在我们应对现实世界安全威胁方面带来了显著的好处,强调了在不断变化的网络安全领域持续学习和适应的重要性。

如何访问服务

  • Phalcon 是一个 SaaS 平台。您可以 登录我们的网站 来探索功能、查看定价并直接订阅。
  • 您还可以 预约演示 以了解更多关于 Phalcon 的信息并获得专家安全建议。

让 Phalcon 为您的协议构建一条防线。它不需要协议方做很多工作,也不会带来额外的风险。它就像一个提供额外安全层的盾牌。立即 预约演示

查看更多 Phalcon 成功案例

关于 Phalcon

Phalcon 是 BlockSec 推出的一款攻击监控和自动化阻止平台。该平台能够准确识别攻击并自动阻止它们。Phalcon 旨在为 Web3 项目提供全面的上线后安全保护,包括持续监控、攻击阻止和紧急响应,从而保护协议提供商、LP 和 DAO 组织参与者的链上资产。

迄今为止,Phalcon 已成功阻止了 20 多起黑客攻击,挽救了价值超过 2000 万美元的资产。即使在早期客户阶段,Phalcon 也获得了顶级 DeFi 协议 Compound 的认可和资助,并为其建立了攻击阻止平台。

网站:https://blocksec.com/phalcon

Twitter:@Phalcon_xyz

电报:https://t.me/BlockSecTeam

Sign up for the latest updates
~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly
Security Insights

~$15.9M Lost: Trusted Volumes & More | BlockSec Weekly

This BlockSec bi-weekly security report covers 11 notable attack incidents identified between April 27 and May 10, 2026, across Sui, Ethereum, BNB Chain, Base, Blast, and Berachain, with total estimated losses of approximately $15.9M. Three incidents are analyzed in detail: the highlighted $1.14M Aftermath Finance exploit on Sui, where a signed/unsigned semantic mismatch in the builder-fee validation allowed an attacker to inject a negative fee that was converted into positive collateral during settlement; the $5.87M Trusted Volumes RFQ authorization mismatch on Ethereum; and the $5.7M Wasabi Protocol infrastructure-to-contract-control compromise across multiple EVM chains.

Newsletter - April 2026
Security Insights

Newsletter - April 2026

In April 2026, the DeFi ecosystem experienced three major security incidents. KelpDAO lost ~$290M due to an insecure 1-of-1 DVN bridge configuration exploited via RPC infrastructure compromise, Drift Protocol suffered ~$285M from a multisig governance takeover leveraging Solana's durable nonce mechanism, and Rhea Finance incurred ~$18.4M following a business logic flaw in its margin-trading module that allowed circular swap path manipulatio

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly
Security Insights

~$7.04M Lost: GiddyDefi, Volo Vault & More | BlockSec Weekly

This BlockSec weekly security report covers eight attack incidents detected between April 20 and April 26, 2026, across Ethereum, Avalanche, Sui, Base, HyperLiquid, and MegaETH, with total estimated losses of approximately $7.04M. The highlighted incident is the $1.3M GiddyDefi exploit, where the attacker did not break any cryptography or use a flash loan but simply replayed an existing on-chain EIP-712 signature with the unsigned `aggregator` and `fromToken` fields swapped out for a malicious contract, demonstrating how partial signature coverage turns any historical signature into a generic permit. Other incidents include a $3.5M Volo Vault operator key compromise on Sui, a $1.5M Purrlend privileged-role takeover, a $413K SingularityFinance oracle misconfiguration, a $142.7K Scallop cross-pool index injection, a $72.35K Kipseli Router decimal mismatch, a $50.7K REVLoans (Juicebox) accounting pollution, and a $64K Custom Rebalancer arbitrary-call exploit.