Land # 18084, Add x86 Linux Fetch Payloads

Merge branch 'land-18084' into upstream-master
This commit is contained in:
bwatters 2023-06-15 09:04:22 -05:00
commit 03d59ba4e7
No known key found for this signature in database
GPG Key ID: ECC0F0A52E65F268
5 changed files with 100 additions and 1 deletions

View File

@ -0,0 +1,25 @@
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
module MetasploitModule
include Msf::Payload::Adapter::Fetch::HTTP
include Msf::Payload::Adapter::Fetch::LinuxOptions
def initialize(info = {})
super(
update_info(
info,
'Name' => 'HTTP Fetch',
'Description' => 'Fetch and execute a x86 payload from an HTTP server.',
'Author' => ['Brendan Watters', 'Spencer McIntyre'],
'Platform' => 'linux',
'Arch' => ARCH_CMD,
'License' => MSF_LICENSE,
'AdaptedArch' => ARCH_X86,
'AdaptedPlatform' => 'linux'
)
)
end
end

View File

@ -12,7 +12,7 @@ module MetasploitModule
update_info(
info,
'Name' => 'HTTPS Fetch',
'Description' => 'Fetch and execute an x64 payload from an HTTPS server.',
'Description' => 'Fetch and execute an MIPS64 payload from an HTTPS server.',
'Author' => ['Brendan Watters', 'Spencer McIntyre'],
'Platform' => 'linux',
'Arch' => ARCH_CMD,

View File

@ -0,0 +1,25 @@
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
module MetasploitModule
include Msf::Payload::Adapter::Fetch::Https
include Msf::Payload::Adapter::Fetch::LinuxOptions
def initialize(info = {})
super(
update_info(
info,
'Name' => 'HTTPS Fetch',
'Description' => 'Fetch and execute an x86 payload from an HTTPS server.',
'Author' => ['Brendan Watters', 'Spencer McIntyre'],
'Platform' => 'linux',
'Arch' => ARCH_CMD,
'License' => MSF_LICENSE,
'AdaptedArch' => ARCH_X86,
'AdaptedPlatform' => 'linux'
)
)
end
end

View File

@ -0,0 +1,25 @@
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
module MetasploitModule
include Msf::Payload::Adapter::Fetch::TFTP
include Msf::Payload::Adapter::Fetch::LinuxOptions
def initialize(info = {})
super(
update_info(
info,
'Name' => 'TFTP Fetch',
'Description' => 'Fetch and execute a x86 payload from a TFTP server.',
'Author' => ['Brendan Watters', 'Spencer McIntyre'],
'Platform' => 'linux',
'Arch' => ARCH_CMD,
'License' => MSF_LICENSE,
'AdaptedArch' => ARCH_X86,
'AdaptedPlatform' => 'linux'
)
)
end
end

View File

@ -556,6 +556,30 @@ RSpec.describe 'modules/payloads', :content do
reference_name: 'cmd/linux/tftp/x64'
end
context 'cmd/linux/http/x86' do
it_should_behave_like 'payload is not cached',
ancestor_reference_names: [
'adapters/cmd/linux/http/x86'
],
reference_name: 'cmd/linux/http/x86'
end
context 'cmd/linux/https/x86' do
it_should_behave_like 'payload is not cached',
ancestor_reference_names: [
'adapters/cmd/linux/https/x86'
],
reference_name: 'cmd/linux/https/x86'
end
context 'cmd/linux/tftp/x86' do
it_should_behave_like 'payload is not cached',
ancestor_reference_names: [
'adapters/cmd/linux/tftp/x86'
],
reference_name: 'cmd/linux/tftp/x86'
end
context 'cmd/mainframe/generic_jcl' do
it_should_behave_like 'payload cached size is consistent',
ancestor_reference_names: [