SharkTeam:OKX DEX攻击事件分析及链上资产追踪

Odaily星球日报Publicado em 2023-12-18Última atualização em 2023-12-18

Resumo

2023年12月12日,OKX DEX Proxy管理员私钥疑似泄露,攻击者已获利约270万美元。

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

SharkTeam 对此事件第一时间进行了技术分析,并总结了安全防范手段,希望后续项目可以引以为戒,共筑区块链行业的安全防线。

一、攻击事件分析

OKX: Dex Aggregator 合约:0x 70 cbb 871 e 8 f 30 fc 8 ce 23609 e 9 e 0 ea 87 b 6 b 222 f 58 

UpgradeableProxy 合约:0x55b35bf627944396f9950dd6bddadb5218110c76

Proxy Admin Owner: 0xc82Ea2afE1Fd1D61C4A12f5CeB3D7000f564F5C6

Proxy Admin 合约:0x3c18F8554362c3F07Dc5476C3bBeB9Fdd6F6a500

攻击发起者地址:0xFacf375Af906f55453537ca31fFA99053A010239

资金流向地址 1 :0x1f14e38666cdd8e8975f9acc09e24e9a28fbc42d

资金流向地址 2 :0x0519eFACB73A1f10b8198871E58D68864e78B8A5

恶意 ProxyMain 合约 1 :0x5c4794d9f34fb74903cfafb3cff6e4054b90c167

恶意 ProxyMain 合约 2 :0xF36C407F3C467e9364Ac1b2486aA199751BA177D

恶意 Proxy 合约创建者:0x5A58D1a81c73Dc5f1d56bA41e413Ee5288c65d7F

其中一笔漏洞利用交易:0x570cf199a84ab93b33e968849c346eb2b761db24b737d44536d1bcb010bca69d

攻击流程:

1.2023 年 12 月 12 日 22: 20: 35 ,EOA(0x 5 A 58 D 1 a 8)创建了 ProxyMain 合约(0x 5 c 4794 d 9);

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

2.2023 年 12 月 12 日 22: 23: 47 ,Proxy Admin Owner(0xc82Ea2af)通过 Proxy Admin(0x3c18F855)将 DEXProxy 合约升级为新的执行合约(0x5c4794d9);

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

3.2023 年 12 月 12 日 23: 52: 47 ,EOA(0x5A58D1a8)创建了 ProxyMain 合约(0xF36C407F)

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

4.2023 年 12 月 12 日 23: 53: 59 ,Proxy Admin Owner(0xc82Ea2af)通过 Proxy Admin(0x3c18F855)将 DEXProxy 合约升级为新的执行合约(0xF36C407F);

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

5.这两次升级合约的目的相同,新合约的功能是调用 TokenApprove 合约的 claimTokens 函数来完成转账。

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

二、攻击原理分析

1.在执行合约 ProxyMain 时,首先限制该合约的调用者必须是攻击者地址(0xFacf375A),然后执行 Dex Aggregator 合约的 claimTokens 函数;

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

2.在 Dex Aggregator 合约的 claimTokens 函数中,由于该合约尚未在 Etherscan 上开源,我们通过反编译获得了其源代码。从代码片段中可以看出,claimTokens 函数会验证代理是否可信。一旦验证通过,它将调用 OKX DEX: TokenApprove 函数;

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

3.在 OKX DEX: TokenApprove 函数中,正常检测调用者是否是可信 Proxy。与先前的可信 Proxy 验证相同,只要是可信 Proxy 并且用户已经授权 TokenApprove,攻击者就能够窃取被授权用户的资金。

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

三、链上资产追踪

攻击和资产转移主要聚焦在如下 3 个地址:

攻击地址:0xFacf375Af906f55453537ca31fFA99053A010239 (OKX Exploiter);

收款地址:0x1F14E38666cDd8e8975f9acC09e24E9a28fbC42d (OKX Exploiter 2);

收款地址:0x0519eFACB73A1f10b8198871E58D68864e78B8A5 (OKX Exploiter 3)。

在这次攻击中,攻击地址只负责不断调用 TokenApprove 合约的 claimTokens 函数来发起转账,通过两个收款地址完成收款。

1.攻击地址 :0xFacf375Af906f55453537ca31fFA99053A010239 (OKX Exploiter)在发起攻击前的历史交易:

Inflow

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

Outflow:

分别向0x4187b2daf33764803714D22F3Ce44e8c9170A0f3 转账 20419 USDT 和 1173 USDT,通过中间地址0x4A0cF014849702C0c3c46C2df90F0CAd1E504328Railgun:Relay 以及多个中间地址转至0x7A20527ba5a749b3b054a821950Bfcc2C01b959f,该地址有高频次数值千以上的转入,然后以每笔 300000 USDT 的形式转账至0x6b8DEfc76faA33EC11006CEa5176B1cec2078DfE,随后转入带有 OKX 标签的多个地址,e.g.

0x3D55CCb2a943d88D39dd2E62DAf767C69fD0179F(OKX 23)

0x68841a1806fF291314946EebD0cdA8b348E73d6D(OKX 26)

0xBDa23B750dD04F792ad365B5F2a6F1d8593796f2(OKX 21)

0x276cdBa3a39aBF9cEdBa0F1948312c0681E6D5Fd(OKX 22)

....

此外该地址还有通过 Railgun:Relay 转移部分 USDT、通过 Uniswap 换币的行为。

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

2.收款地址 1 :0x1F14E38666cDd8e8975f9acC09e24E9a28fbC42d (OKX Exploiter 2):

Inflow:

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

Outflow:

通过 4 个地址:

0xBbEa72B68138B9a1c3fec2f563E323d025510A4c

0x141F12aB25Fcd1c470a2ede34ad4ec49718B5209

0xFD681A9aA555391Ef772C53144db8404AEC76030

0x17865c33e40814d691663bC292b2F77000f94c34

分散资金,然后使用标签为 Railgun:Relay & Railgun: Treasury 的地址转移,最终通过标签为 Stargate 的地址转移 410204.0 USDT 至 BNB Smart Chain 上。

3.收款地址 2 :0x0519eFACB73A1f10b8198871E58D68864e78B8A5 (OKX Exploiter 3)

通过中间地址0x48E3712C473364814Ac8d87a2A70a9004a42E9a3

转移 62 万 USDT 至

0xE8A66A5862Ba07381956449e58999DB541e4DE93

和0x8094b97A1663b7b73d6c76811355a734BA6F4A1A,

然后这两个地址又分别转移到两个新地址:

0xB31a2196050A3B861C65f23E180E56eD51cf75D7

和0x0C1f0233091D6ed371dC84A0ad1602209bCa429c,

最后通过标签为 Stargate 的地址转移 617964.77 到 Avalanche C-Chain 上。

SharkTeam:OKX DEX攻击事件分析及链上资产追踪

黑客在 OKX、Gate.ioMEXC 多个交易所上可能开设有账号并进行过交易,可以进行针对性 KYC 取证,并且 Kumo x World 的项目合约部署地址也与黑客地址有直接的转账交易。

四、安全建议

此次攻击事件的根本原因是 Proxy Admin Owner(0x c 82 Ea 2 af) 的私钥泄露,导致升级了攻击者部署的恶意 Proxy。由于升级了新的恶意执行合约,该合约被列为可信任的 Proxy。TokenApprove 检测到恶意执行合约是可信的,因此攻击者可以窃取用户过多授权给 TokenApprove 的资金。所以,请务必保管好重要账户地址的私钥。

About Us

SharkTeam 的愿景是保护Web3世界的安全。团队由来自世界各地的经验丰富的安全专业人士和高级研究人员组成,精通区块链和智能合约底层理论。提供包括链上大数据分析、链上风险预警、智能合约审计、加密资产追讨等服务,并打造了链上大数据分析和风险预警平台 ChainAegis,平台支持无限层级的深度图分析,能有效对抗Web3世界的高级持续性威胁(Advanced Persistent Threat,APT)。已与Web3生态各领域的关键参与者,如 Polkadot、Moonbeam、polygon、Sui、OKX、imTokenChainIDE 等建立长期合作关系。

官网:https://www.sharkteam.org

Twitter:https://twitter.com/sharkteamorg

Discord:https://discord.gg/jGH9xXCjDZ

Telegram:https://t.me/sharkteamorg

Leituras Relacionadas

Wall Street Giants Vie for GPU Futures, Crypto Market Already in Early Skirmish

Wall Street giants CME and ICE are racing to launch GPU futures, marking a pivotal shift as computing power transforms from a critical IT resource into a tradable financial asset. In mid-May, both exchanges announced plans for futures contracts tied to GPU compute pricing indices, aiming to establish a benchmark and provide hedging tools for the volatile, trillion-dollar AI compute market. ICE partnered with data provider Ornn for a broad index covering enterprise and consumer GPUs, while CME teamed with Silicon Data to focus on an H100 leasing index with cash settlement. This push for financialization addresses a key industry pain point: the lack of risk management tools in a market dominated by a few cloud providers, where prices are opaque and highly unstable. Proponents argue futures will help large cloud operators and AI labs lock in costs and manage investment risk. However, challenges remain, including the intangible nature of compute, high market concentration, and the potential for leveraged speculation to exacerbate price swings and resource inequality. Notably, the crypto market has moved faster. Platforms like Architect Financial have already launched perpetual contracts tied to compute indices, leveraging DeFi's agility to create a parallel, global market. As Wall Street awaits regulatory approval, the race to define and control the pricing of "21st-century oil" is accelerating both in traditional and decentralized finance.

marsbitHá 1h

Wall Street Giants Vie for GPU Futures, Crypto Market Already in Early Skirmish

marsbitHá 1h

Bitcoin Becomes a National Strategic Asset? U.S. Congressman Proposes Annual Purchase of 200,000 BTC, Locked for 20 Years Without Sale

U.S. Representative Nick Begich (R-Alaska) introduced the "American Reserve Modernization Act" (ARMA) on May 21, aiming to codify a strategic Bitcoin reserve into law. Building on a prior executive order, the bill seeks to establish a permanent national Bitcoin reserve managed by the Treasury Department. The proposed legislation would authorize the Treasury to acquire up to 200,000 Bitcoin annually for five years, targeting a total reserve of 1 million Bitcoin, roughly 5% of the total supply. All acquired Bitcoin would be locked and held for at least 20 years. Representative Begich likened Bitcoin's role in crypto to gold's in precious metals, calling it the dominant store of value in its asset class. The U.S. government currently holds approximately 328,000 Bitcoin, largely from law enforcement seizures, but lacks a coherent management strategy for these assets. Co-sponsors emphasized the urgency of addressing this gap. This move coincides with a wave of crypto-friendly legislation in Washington, including recent bipartisan committee approval of a major digital asset market structure bill. Concurrently, the Treasury has intensified crackdowns on illicit crypto finance, seizing hundreds of millions in assets, further highlighting the need for a comprehensive digital asset strategy. The White House has indicated that operational details for the strategic Bitcoin reserve are forthcoming, with key legal hurdles reportedly cleared.

marsbitHá 1h

Bitcoin Becomes a National Strategic Asset? U.S. Congressman Proposes Annual Purchase of 200,000 BTC, Locked for 20 Years Without Sale

marsbitHá 1h

Blockchain Capital Partner: The Structure of On-Chain Two-Tier Capital Is Still in the Early Stages of Value Discovery

Spencer Bogart, a general partner at Blockchain Capital, argues that the on-chain economy possesses unique features like programmability, composability, and global distribution, fostering an open and fast-paced innovation ecosystem. However, these very features create challenges for large, fiduciarily-responsible institutional capital, which requires robust risk assessment frameworks often difficult in a permissionless and adversarial environment. The proposed solution is the emergence of a two-tiered capital structure. The first, permissionless layer remains the crucible for innovation, where protocols are built, tested, and hardened with real capital. The second, "institutional" layer consists of chains (L1s, L2s, etc.) that, while based on similar code, incorporate risk-management features like the ability to pause or freeze transactions in extreme scenarios, making them suitable for large-scale institutional deployment. The synergy between these layers is key. Protocols proven resilient in the open, permissionless environment can then scale to the institutional layer, accessing deeper capital pools. This creates a lifecycle: build and launch permissionlessly, test and prove robustness publicly, then expand to an institutional-grade chain for scaled adoption. This architecture allows the open, experimental side to continue driving innovation with crypto-native capital, while the institutional layer provides the liquidity, stability, and trust required for mainstream adoption. The major challenge identified is the "cold start" problem: aligning where institutional capital prefers to go with where the most proven applications and network effects currently reside. How this dynamic resolves—whether through protocol migration, new protocol builds, or institutional adaptation—will be crucial to watch. Overall, this evolving structure aims to combine the strengths of open innovation and institutional depth within a shared on-chain ecosystem.

链捕手Há 2h

Blockchain Capital Partner: The Structure of On-Chain Two-Tier Capital Is Still in the Early Stages of Value Discovery

链捕手Há 2h

Trading

Spot
Futuros
活动图片