原文标题:《 权利的游戏——DAO Maker 被黑分析 》
Original source: Slow Fog Technology
On August 12, 2021, according to the slow Fog area, encryption incubator DAO Maker was suspected of being hacked, resulting in a large number of contracts being transferred out of USDC. The slow fog safety team immediately intervened in the analysis and shared the analysis results as follows.
In this attack, the attacker deployed and open-source an attack contract (0x1C) for rapid batch theft from the DAO Maker Victim contract (0x41).
Attacker address 1:
0xd8428836ed2a36bd67cd5b157b50813b30208f50
Attacker address 2:
0xef9427bf15783fb8e6885f9b5f5da1fba66ef931
Attack contract:
0x1c93290202424902a5e708b95f4ba23a3f2f3cee
DAO Maker victim contract:
0x41B856701BB8c24CEcE2Af10651BfAfEbb57cf49
DAO Maker Victim Contract Deployer:0x054e71D5f096a0761dba7dBe5cEC5E2Bf898971c
DAO Maker contract admin:0x0eba461d9829c4e464a68d4857350476cfb6f559
This attack is different from other attacks: the DAO Maker victim contract (0x41) is not open source, but the attack contract (0x1C) is open source.

From the above image of open source attack contracts and on-chain records we can see:
1. The hacker calls the h function of the attack contract (0x1c), and the H function will call the f function in a loop. The F function obtains the USDC deposit amount of the common user in the contract (0x41) through the function 0x4B4F892a of the DAO Maker victim contract.
2. Function h then calls the Deposite (0x50B158e4) function of DAO Maker victim contract (0x41), and refers to the user address, USDC address, and the amount of withdrawals required.
3. Then the DAO Maker victim contract (0x41) transfers the USDC from the contract to the attack contract (0x1C).
From the above behavior analysis, we can find that the attack contract (0x1c) calls the When the client fromuser function is damaged, the victim contract (0x41) transfers funds managed by the contract directly to the attack contract (0x1c). We decompress the victim contract (0x41) directly and look at the Client fromuser function for a simple analysis:

The decompiled code shows that this function has permission checks and only DAO Contracts can be called to transfer the user's money. But attack contract. (0x1c) is clearly not a DAO contract, so its DAO contract must have been replaced by the attacker.
Through on-chain analysis, we can clearly see that:
1. The victim contract deployable (0x05) is deploying the victim contract (0x41)& NBSP; 0x0eba461d9829c4e464a68d4857350476cfb6f559 Address for the administrator role:
Tx Hash:
0xa1b4fceb671bb70ce154a69c2f4bd6928c11d98cbcfbbff6e5cdab9961bf0e6d

2. Then the affected contract deploiter (0x05) waives the administrative rights of the affected contract (0x41) by calling the revokeRole function:
Tx Hash:
0x773613398f08ddce2cc9dcb6501adf4f5f159b4de4e9e2774a559bb1c588c1b8

3. The administrator is in UTC & NBSP; August 12 01:27:39 set the DAO contract to attack contract (0x1c) :
Tx Hash:
0x2fba930502d27f9c9a2f2b9337a0149534dda7527029645752b2a6507ca6b0d6

Therefore, the attacker was able to use the attack contract (0x1C) to steal the user's funds from the victim contract (0x41). The stolen funds are currently being converted into ETH and transferred to the attacker's address 2 (0xef).
The attack may have originated from the leak of administrator private key of DAO Maker victim contract. After stealing the private key, the attacker replaced the DAO contract of the victim contract with the attack contract, and the attacker transferred the user funds in the contract through the replacement contract. Since the contract deployers give up the contract administration rights after setting up the contract administrator, the project parties may not be able to effectively take back the contract control at this time.
The original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia