Last active
December 25, 2022 13:21
-
-
Save dimasma0305/678bb9a02c4b4d001b2e24ce99c62c6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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