THEM?!
Please wait
Loading the requested page
Loading
Reading the latest public record.
Please wait
Loading the requested page
Reading the latest public record.
Given is a network service which simulates a tiny blockchain VM. The service prints a mined block summary and asks you to submit:
You can interact via netcat or a socket client. An ELF binary was provided for local analysis.
Observed prompt sequence:
Submit your new block's data.
Nonce (as hex):
Enter your RISC-V assembly contract (end with a blank line):
is_block_valid contains a short-circuit: if the block's nonce equals 0xdeadbeef the function returns valid immediately, bypassing PoW and other checks.ecall_handler checks a register for the syscall id. If the syscall id equals 1337, it prints a message and reads flag.txt then prints it. The rodata contains the string ECALL 1337: Nice! Here's your flag!.addi and ecall). The server requires the contract input to be terminated by a blank line; otherwise it waits for more input.Attack idea: submit the magic nonce to bypass validation, then submit a tiny RISC-V contract that sets the ECALL number to 1337 and calls ecall.
Manual steps using nc (interactive):
nc riskychain.challs.infobahnc.tf 1337
deadbeef
addi x10, x0, 1337
ecall
Why this works:
addi x10, x0, 1337 sets register x10 to 1337. The ECALL handler reads the syscall number from x10.ecall triggers the handler. With the block validated via 0xdeadbeef, the handler prints the flag when it sees syscall 1337.# illustrate what to send
s.sendall(b"deadbeef\n")
s.sendall(b"addi x10, x0, 1337\n")
s.sendall(b"ecall\n\n")
infobahn{Th3_futur3_15_m3t4l1c_4nd_RISC-V}
0xdeadbeef nonce in is_block_valid. That is the designed path to the flag for this challenge.