Back to Blog

BlockSec如何追回被盗资金:三个典型案例的技术视角

February 20, 2023
4 min read

DeFi黑客攻击仍在发生。对于被盗的DeFi项目资金,通常很难追回。一些项目会与黑客协商,提供赏金并承诺不起诉。这有时会奏效,但会树立一个坏榜样,因为它鼓励人们通过黑客攻击来获取赏金,而不是进行负责任的讨论。

BlockSec采取了不同的方法,帮助多个项目追回被盗资金。除了追踪资金流向并与交易所等中心化实体合作的常规方法外,我们还想分享我们通过纯粹的技术手段成功追回被盗资金的三个案例,包括最近的Platypus Finance TransitSwap_ 和_ Saddle Finance_。

Platypus Finance:挽回240万美元

The Block 报道了我们如何为Platypusdefi追回资金。基本上,攻击者犯了一个错误,那就是无法将资金从攻击合约中移出。这是因为攻击者忘记编写将代币从攻击合约转移的代码逻辑。

然而,我们的团队发现有一种方法可以利用攻击合约中的现有代码,将USDC从攻击合约转移到项目合约。基本上,攻击者合约有一个函数,如果被调用,攻击合约就会批准一定数量的USDC给项目合约。这段代码原本用于攻击目的。但是,我们可以重用这段代码逻辑,将USDC批准给项目合约,然后升级项目合约(它是一个代理合约),从而将USDC从攻击合约中转移出来。

我们通过PoC评估了这个想法,并与Platypusdefi分享了信息。我们与他们密切合作,这种方法奏效了!在以下交易中追回了240万美元的USDC。

TransitSwap:挽回24.6万美元

TransitSwap on BSC 于 2022 年 10 月 1 日遭到攻击。一些攻击交易被一个机器人抢跑。

然而,我们发现这个机器人可能存在profanity工具漏洞。该漏洞是由于生成私钥时随机性不足造成的。我们开发了一个工具,可以恢复这种易受攻击地址的私钥。

我们成功恢复了机器人的私钥。然而,资金在机器人合约中,而不是在EoA中。我们设法反编译了合约,并找到了一个可以用来转移资金的函数。

我们已将资金转移到官方TransitFinance Funds Receiver地址

阅读更多关于 我们如何为TransitSwap(和BabySwap)追回被盗资金

Saddle Finance:挽回380万美元

对于Saddle Finance,我们采取了另一种救援方式。基本思路是监听以太坊的待定池,通过我们的交易预执行系统Mopsus检测攻击交易,并通过自动合成一条救援交易来阻止攻击,将易受攻击的资产转移到我们的安全账户,并利用FlashBot抢跑攻击交易。下图展示了架构。

以下时间线展示了[我们的系统如何在2022年4月底为Saddle Finance挽回380万美元](https://www.theblock.co/linked/144491/stablecoin-dex-saddle-finance-hacked-for-10-million)。特别是,我们的系统在不到一秒的时间内完成了检测攻击交易并自动合成救援交易的整个过程。我们将所有追回的资金退还给了Saddle Finance。点击链接查看原始攻击交易我们的救援交易

阅读更多:通过主动威胁预防保护Web3

总结

以上三个案例只是代表性的。事实上,我们还有更多成功追回资金的案例。

我们一直认为,DeFi的安全无法通过单一的方法来解决。没有万能药。BlockSec开发了(并且正在开发更多)一系列工具和服务来帮助保护整个生态系统。我们拥有Phalcon,一个区块链交易浏览器安全代码审计服务(涵盖Solidity、Rust、Go和Move),以及主动攻击缓解服务。我们为加密用户构建了几个工具来对抗网络钓鱼攻击,包括加密资金分析工具MetaSleuth和区块链浏览器扩展MetaSuites。我们持续向MetaMask和Etherscan报告网络钓鱼URL和地址。BlockSec已与包括CronosFortaTokenlonKeyStoneGoplus等在内的合作伙伴合作,以保护整个加密生态系统。

如有任何疑问,请随时与我们联系。

了解更多关于BlockSec的信息:网站 | 文档 | Twitter | 博客 | TG群组

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.