Created
May 1, 2018 02:47
-
-
Save wideglide/59318a9c9c59ac52f63e521c0a558f57 to your computer and use it in GitHub Desktop.
solve.py template
This file contains hidden or 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
#!/usr/bin/env python | |
from pwn import * | |
import argparse | |
from struct import pack | |
# challenge specific | |
FILE = './syscaller' | |
SVR = 'chal1.swampctf.com' | |
PORT = 1800 | |
# set up environ | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-r', dest='remote', action='store_true',default=False,help='run remotely') | |
parser.add_argument('-d', dest='debug', action='store_true',default=False,help='debug in GDB') | |
args = parser.parse_args() | |
level= ['debug','info','error'][1] | |
context(arch='amd64',os='linux',log_level=level) | |
context.terminal = ["terminator", "-e"] | |
# context.terminal = ['tmux', 'splitw', '-h'] | |
if args.remote: | |
r = remote(SVR, PORT) | |
else: | |
r = process(FILE) | |
if args.debug and not args.remote: | |
gdb.attach(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment