Path: blob/master/lib/msf/base/sessions/meterpreter_multi.rb
19721 views
# -*- coding: binary -*-123module Msf4module Sessions56###7#8# This class creates a platform-independent meterpreter session type9#10###11class Meterpreter_Multi < Msf::Sessions::Meterpreter12def initialize(rstream, opts={})13super14self.base_platform = 'multi'15self.base_arch = ARCH_ANY16end1718def self.create_session(rstream, opts={})19# TODO: fill in more cases here20case opts[:payload_uuid].platform21when 'python'22return Msf::Sessions::Meterpreter_Python_Python.new(rstream, opts)23when 'java'24return Msf::Sessions::Meterpreter_Java_Java.new(rstream, opts)25when 'android'26return Msf::Sessions::Meterpreter_Java_Android.new(rstream, opts)27when 'php'28return Msf::Sessions::Meterpreter_Php_Php.new(rstream, opts)29when 'windows'30if opts[:payload_uuid].arch == ARCH_X8631return Msf::Sessions::Meterpreter_x86_Win.new(rstream, opts)32end33return Msf::Sessions::Meterpreter_x64_Win.new(rstream, opts)34end3536# TODO: what should we do when we get here?37# For now lets return a generic for basic functionality with http(s) communication38Msf::Sessions::Meterpreter.new(rstream, opts)39end40end4142end43end44454647