Skip to content

Instantly share code, notes, and snippets.

@dimasma0305
Last active December 25, 2022 13:21
Show Gist options
  • Save dimasma0305/678bb9a02c4b4d001b2e24ce99c62c6d to your computer and use it in GitHub Desktop.
Save dimasma0305/678bb9a02c4b4d001b2e24ce99c62c6d to your computer and use it in GitHub Desktop.
from pwn import *
import sys
BINARY = "binary"
context.binary = exe = ELF(BINARY, checksec=False)
context.terminal = "konsole -e".split()
context.log_level = "INFO"
context.bits = 64
context.arch = "amd64"
def init():
if args.RMT:
p = remote(sys.argv[1], sys.argv[2])
else:
p = process()
return Exploit(p), p
class Exploit:
def __init__(self, p: process):
self.p = p
def debug(self, script=None):
if not args.RMT:
if script:
attach(self.p, script)
else:
attach(self.p)
def send(self, content):
p = self.p
p.sendlineafter(b"foooo....", content)
x, p = init()
p.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment