2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-02-27 18:57:47 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-03-24 00:11:21 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-09-14 06:09:46 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = ManualRanking
|
2006-09-14 06:09:46 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# This module does basically nothing
|
|
|
|
#
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Generic Payload Handler',
|
|
|
|
'Description' => %q{
|
|
|
|
This module is a stub that provides all of the
|
|
|
|
features of the Metasploit payload system to exploits
|
|
|
|
that have been launched outside of the framework.
|
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => ['hdm'],
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-09-14 06:09:46 +00:00
|
|
|
'References' => [ ],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
2011-01-04 23:37:11 +00:00
|
|
|
'Space' => 10000000,
|
2007-02-15 22:17:50 +00:00
|
|
|
'BadChars' => '',
|
|
|
|
'DisableNops' => true,
|
2006-09-14 06:09:46 +00:00
|
|
|
},
|
2010-08-16 16:34:55 +00:00
|
|
|
'Platform' => [ 'win', 'linux', 'solaris', 'unix', 'osx', 'bsd', 'php', 'java' ],
|
2009-01-22 05:35:19 +00:00
|
|
|
'Arch' => ARCH_ALL,
|
2006-09-14 06:09:46 +00:00
|
|
|
'Targets' => [ [ 'Wildcard Target', { } ] ],
|
|
|
|
'DefaultTarget' => 0
|
|
|
|
))
|
2007-02-27 18:57:47 +00:00
|
|
|
|
|
|
|
register_advanced_options(
|
|
|
|
[
|
2008-11-03 21:08:46 +00:00
|
|
|
OptBool.new("ExitOnSession", [ false, "Return from the exploit after a session has been created", true ])
|
2007-02-27 18:57:47 +00:00
|
|
|
], self.class)
|
2006-09-14 06:09:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
2010-06-15 17:25:14 +00:00
|
|
|
if not datastore['ExitOnSession'] and not job_id
|
|
|
|
raise RuntimeError, "Setting ExitOnSession to false requires running as a job (exploit -j)"
|
|
|
|
end
|
|
|
|
|
2006-09-14 06:09:46 +00:00
|
|
|
print_status "Starting the payload handler..."
|
|
|
|
while(true)
|
2007-02-27 18:57:47 +00:00
|
|
|
break if session_created? and datastore['ExitOnSession']
|
|
|
|
|
2010-06-22 19:11:05 +00:00
|
|
|
select(nil,nil,nil,1)
|
2006-09-14 06:09:46 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2008-11-03 21:08:46 +00:00
|
|
|
end
|
2010-03-24 00:11:21 +00:00
|
|
|
|