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

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

我们如何为 Transit Swap 和 Baby Swap 追回被盗资金

10 月 1 日,BSC 上的 BabySwap 和 TransitSwap 遭到攻击。一些攻击性交易被一个机器人抢跑。有趣的是,这个机器人容易受到 profanity 工具漏洞的攻击,我们成功地找回了它的私钥。我们还设法逆向工程了机器人合约,并将资金从机器人合约提取到我们的安全账户。我们已将资金转至 TransitSwap,目前正在对接 BabySwap。

BabySwap 攻击的检测

2022 年 10 月 1 日 14:47(UTC),我们的内部系统报告了一次攻击性交易。我们进一步分析表明,这是由于智能路由器合约中的受控工厂所致。然而,由于项目当时仍然存在漏洞,我们并未披露细节。我们通过 Twitter 私信和 TG 联系了 BabySwap,但没有收到回复。

在调查过程中,我们发现该交易是由一个机器人账户发出的,该机器人账户抢跑了原始攻击性交易。此外,该账户的八个前导零的模式,看起来是由易受 profanity 工具漏洞攻击的 profanity 工具生成的。

机器人私钥的找回

2022 年 10 月 1 日 16:10(UTC),我们的工具在约 20 分钟内成功找回了该机器人的私钥。对于找回的私钥,我们将资金转至一个安全账户(这是我们救援的典型流程)。否则,其他找回私钥的人可能会接管该账户,账户中的资金将面临风险。

从机器人中转移资金

挑战在于资金位于机器人部署的合约中,而不是机器人 EOA 账户本身。如何转移资金是一个挑战。

我们反编译了合约,并发现合约中有一个提取函数(如下图所示)。

该函数可用于从合约中提取资金。第一个参数是代币地址,第二个参数应为零。

我们发送了一笔交易,成功将合约中的资金提取到机器人,然后将资金转至我们的安全账户

另一场攻击来了!

几个小时后,我们的系统报告了对TransSwap的又一次攻击。有几笔来自不同地址的攻击性交易,其中一笔交易再次被该机器人抢跑!但是,由于机器人部署的合约是不同的,提取资金的函数也不同。

归还资金

经过内部讨论,我们决定将资金归还给受攻击的项目(而不是机器人),原因如下:

  • 首先,资金是通过机器人攻击易受攻击的合约获得的。虽然机器人抢跑了攻击性交易(而不是直接发起攻击),但我们仍然认为抢跑攻击性交易也是一种攻击。
  • 其次,资金属于攻击的受害者,即受影响的 DeFi 协议的用户。用户因 DeFi 协议的漏洞而遭受了巨大损失。他们应该从攻击者那里收到资金。

我们已将资金转至TransitFinance 官方资金接收地址,并正在联系 BabySwap

救援更新

我们仍在救援易受攻击地址的流程中。挑战在于,在找回私钥之前,你无法确定一个地址是否易受攻击。即使我们有优化的算法,由于计算能力的限制,我们仍然需要更多时间来完成整个救援。我们将稍后发布一份详细报告,阐述整个过程并回答以下问题:

  • 有多少地址易受攻击?
  • 漏洞的影响是什么,即有多少资产因漏洞而面临风险?
  • 这种漏洞攻击的整个情况是怎样的?

请继续关注并保持安全。

关于 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
Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

Weekly Web3 Security Incident Roundup | Feb 9 – Feb 15, 2026

During the week of February 9 to February 15, 2026, three blockchain security incidents were reported with total losses of ~$657K. All incidents occurred on the BNB Smart Chain and involved flawed business logic in DeFi token contracts. The primary causes included an unchecked balance withdrawal from an intermediary contract that allowed donation-based inflation of a liquidity addition targeted by a sandwich attack, a post-swap deflationary clawback that returned sold tokens to the caller while draining pool reserves to create a repeatable price-manipulation primitive, and a token transfer override that burned tokens directly from a Uniswap V2 pair's balance and force-synced reserves within the same transaction to artificially inflate the token price.

Top 10 "Awesome" Security Incidents in 2025

Top 10 "Awesome" Security Incidents in 2025

To help the community learn from what happened, BlockSec selected ten incidents that stood out most this year. These cases were chosen not only for the scale of loss, but also for the distinct techniques involved, the unexpected twists in execution, and the new or underexplored attack surfaces they revealed.

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

#10 Panoptic Incident: XOR Linearity Breaks the Position Fingerprint Scheme

On August 29, 2025, Panoptic disclosed a Cantina bounty finding and confirmed that, with support from Cantina and Seal911, it executed a rescue operation on August 25 to secure roughly $400K in funds. The issue stemmed from a flaw in Panoptic’s position fingerprint calculation algorithm, which could have enabled incorrect position identification and downstream fund risk.