Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/util/exe/linux/x64.rb
36043 views
1
module Msf::Util::EXE::Linux::X64
2
include Msf::Util::EXE::Linux::Common
3
4
def self.included(base)
5
base.extend(ClassMethods)
6
end
7
8
module ClassMethods
9
10
# Create a 64-bit Linux ELF containing the payload provided in +code+
11
# to_linux_x64_elf
12
#
13
# @param framework [Msf::Framework]
14
# @param code [String]
15
# @param opts [Hash]
16
# @option [String] :template
17
# @return [String] Returns an elf
18
def to_linux_x64_elf(framework, code, opts = {})
19
Msf::Util::EXE::Common.to_exe_elf(framework, opts, "template_x64_linux.bin", code)
20
end
21
22
# Create a 64-bit Linux ELF_DYN containing the payload provided in +code+
23
# to_linux_x64_elf_dll
24
#
25
# @param framework [Msf::Framework]
26
# @param code [String]
27
# @param opts [Hash]
28
# @option [String] :template
29
# @return [String] Returns an elf
30
def to_linux_x64_elf_dll(framework, code, opts = {})
31
Msf::Util::EXE::Common.to_exe_elf(framework, opts, "template_x64_linux_dll.bin", code)
32
end
33
34
# Create a 64-bit Linux ELF containing the payload provided in +code+
35
# to_linux_x64_elf
36
#
37
# @param framework [Msf::Framework]
38
# @param code [String]
39
# @param opts [Hash]
40
# @option [String] :template
41
# @return [String] Returns an elf
42
def to_linux_x64_elf(framework, code, opts = {})
43
to_exe_elf(framework, opts, "template_x64_linux.bin", code)
44
end
45
end
46
47
class << self
48
include ClassMethods
49
end
50
end
51
52