Created
May 15, 2019 07:59
-
-
Save Creased/f1046bbc073d3fff3190f62cd07cf07c to your computer and use it in GitHub Desktop.
Pwntools example
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
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