Loading...
Loading...
Write, test, and iterate on CTF exploit scripts. Use when you need to develop a working exploit with a test-debug-fix loop against a live target.
npx skill4agent add ramzxy/ctf write-exploitsolve.pyflag.txt#!/usr/bin/env python3
from pwn import *
context.binary = elf = ELF('./binary')
# context.log_level = 'debug'
def conn():
if args.REMOTE:
return remote('HOST', PORT)
return process('./binary')
io = conn()
# === EXPLOIT HERE ===
io.interactive()#!/usr/bin/env python3
import requests
import sys
TARGET = sys.argv[1] if len(sys.argv) > 1 else 'http://localhost:8080'
s = requests.Session()
# === EXPLOIT HERE ===
print(f"FLAG: {flag}")#!/usr/bin/env python3
from Crypto.Util.number import *
from pwn import *
# === GIVEN VALUES ===
# === SOLVE ===
flag = long_to_bytes(m)
print(f"FLAG: {flag.decode()}")#!/usr/bin/env python3
from pwn import *
io = remote('HOST', PORT)
# Read until prompt
io.recvuntil(b'> ')
# Send payload
io.sendline(payload)
# Get response
response = io.recvline()
print(f"Response: {response}")
# Interactive mode for shell
io.interactive()context.log_level = 'debug'print(f"[*] payload: {payload.hex()}")io.recv(timeout=2)io.can_recv()gdb.attach(io)print(r.status_code, r.text[:500])p64()p64(val, endian='big')sendline()\nsend()sleep(0.5)retb"string""string"1. Write exploit → run → "Connection refused"
Fix: Check host/port, is service up?
2. Write exploit → run → "EOF in recv"
Fix: Server closed connection — payload crashed it. Check offsets.
3. Write exploit → run → wrong output
Fix: Add debug prints, check each step's output matches expectation.
4. Write exploit → run → "flag{...}"
Done! Save to flag.txt