Skip to content

Instantly share code, notes, and snippets.

@Creased
Created May 15, 2019 07:59
Show Gist options
  • Save Creased/f1046bbc073d3fff3190f62cd07cf07c to your computer and use it in GitHub Desktop.
Save Creased/f1046bbc073d3fff3190f62cd07cf07c to your computer and use it in GitHub Desktop.
Pwntools example
from pwn import *
# Doc: docs.pwntools.com/en/stable/
context.log_level = 'debug' # debug/info/error/warning.
context.arch = 'i386' # i386/x64/arm, etc.
## OPEN SOCKET.
sock = remote('challenges.ecsc-teamfrance.fr', 2000)
## OR, OPEN LOCAL PROCESS.
# sock = process('./pwn')
sock.recvuntil('Now, enter your text: ')
sock.sendline('Hello!')
sock.recvuntil('Here is your ciphertext: ')
data = sock.recvline()
print('Result: %s' % data)
sock.interactive() # open an interactive connection (useful when we got a shell :)).
sock.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment