CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/base/sessions/meterpreter_multi.rb
Views: 11784
1
# -*- coding: binary -*-
2
3
4
module Msf
5
module Sessions
6
7
###
8
#
9
# This class creates a platform-independent meterpreter session type
10
#
11
###
12
class Meterpreter_Multi < Msf::Sessions::Meterpreter
13
def initialize(rstream, opts={})
14
super
15
self.base_platform = 'multi'
16
self.base_arch = ARCH_ANY
17
end
18
19
def self.create_session(rstream, opts={})
20
# TODO: fill in more cases here
21
case opts[:payload_uuid].platform
22
when 'python'
23
return Msf::Sessions::Meterpreter_Python_Python.new(rstream, opts)
24
when 'java'
25
return Msf::Sessions::Meterpreter_Java_Java.new(rstream, opts)
26
when 'android'
27
return Msf::Sessions::Meterpreter_Java_Android.new(rstream, opts)
28
when 'php'
29
return Msf::Sessions::Meterpreter_Php_Php.new(rstream, opts)
30
when 'windows'
31
if opts[:payload_uuid].arch == ARCH_X86
32
return Msf::Sessions::Meterpreter_x86_Win.new(rstream, opts)
33
end
34
return Msf::Sessions::Meterpreter_x64_Win.new(rstream, opts)
35
end
36
37
# TODO: what should we do when we get here?
38
# For now lets return a generic for basic functionality with http(s) communication
39
Msf::Sessions::Meterpreter.new(rstream, opts)
40
end
41
end
42
43
end
44
end
45
46
47