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
57477 views
1
# -*- coding: binary -*-
2
module Msf::Util::EXE::Linux::X64
3
include Msf::Util::EXE::Linux::Common
4
5
def self.included(base)
6
base.extend(ClassMethods)
7
end
8
9
module ClassMethods
10
11
# Create a 64-bit Linux ELF containing the payload provided in +code+
12
# to_linux_x64_elf
13
#
14
# @param framework [Msf::Framework]
15
# @param code [String]
16
# @param opts [Hash]
17
# @option [String] :template
18
# @return [String] Returns an elf
19
def to_linux_x64_elf(framework, code, opts = {})
20
Msf::Util::EXE::Common.to_exe_elf(framework, opts, "template_x64_linux.bin", code)
21
end
22
23
# Create a 64-bit Linux ELF_DYN containing the payload provided in +code+
24
# to_linux_x64_elf_dll
25
#
26
# @param framework [Msf::Framework]
27
# @param code [String]
28
# @param opts [Hash]
29
# @option [String] :template
30
# @return [String] Returns an elf
31
def to_linux_x64_elf_dll(framework, code, opts = {})
32
Msf::Util::EXE::Common.to_exe_elf(framework, opts, "template_x64_linux_dll.bin", code)
33
end
34
35
# Create a 64-bit Linux ELF containing the payload provided in +code+
36
# to_linux_x64_elf
37
#
38
# @param framework [Msf::Framework]
39
# @param code [String]
40
# @param opts [Hash]
41
# @option [String] :template
42
# @return [String] Returns an elf
43
def to_linux_x64_elf(framework, code, opts = {})
44
to_exe_elf(framework, opts, "template_x64_linux.bin", code)
45
end
46
end
47
48
class << self
49
include ClassMethods
50
end
51
end
52
53