Use generate_payload_uuid instead of manual obj creation

bug/bundler_fix
OJ 2015-05-20 16:25:52 +10:00
parent 289873c25f
commit d0a5b803e8
21 changed files with 22 additions and 127 deletions

View File

@ -19,13 +19,7 @@ module Payload::Linux::SendUUID
# This code assumes that the communications socket handle is in edi.
#
def asm_send_uuid(uuid=nil)
unless uuid
uuid = Msf::Payload::UUID.new(
platform: 'linux',
arch: ARCH_X86
)
end
uuid ||= generate_payload_uuid
uuid_raw = uuid.to_raw
asm =%Q^

View File

@ -21,11 +21,7 @@ module Payload::Php::SendUUID
sock_var = opts[:sock_var] || '$s'
sock_type = opts[:sock_type] || '$s_type'
uuid = opts[:uuid] || Msf::Payload::UUID.new(
platform: 'php',
arch: ARCH_PHP
)
uuid = opts[:uuid] || generate_payload_uuid
uuid_raw = uuid.to_raw.chars.map { |c| '\x%.2x' % c.ord }.join('')
php = %Q^$u="#{uuid_raw}";

View File

@ -20,11 +20,7 @@ module Payload::Python::SendUUID
def py_send_uuid(opts={})
sock_var = opts[:sock_var] || 's'
uuid = opts[:uuid] || Msf::Payload::UUID.new(
platform: 'python',
arch: ARCH_PYTHON
)
uuid = opts[:uuid] || generate_payload_uuid
uuid_raw = uuid.to_raw.chars.map { |c| '\x%.2x' % c.ord }.join('')
"#{sock_var}.send(\"#{uuid_raw}\")\n"

View File

@ -20,13 +20,7 @@ module Payload::Windows::SendUUID
# the communications socket handle is in edi.
#
def asm_send_uuid(uuid=nil)
unless uuid
uuid = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
uuid ||= generate_payload_uuid
uuid_raw = uuid.to_raw
asm =%Q^

View File

@ -20,13 +20,7 @@ module Payload::Windows::SendUUID_x64
# the communications socket handle is in rdi.
#
def asm_send_uuid(uuid=nil)
unless uuid
uuid = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86_64
)
end
uuid ||= generate_payload_uuid
uuid_raw = uuid.to_raw
asm =%Q^

View File

@ -37,11 +37,7 @@ module Metasploit4
met.gsub!("127.0.0.1", datastore['LHOST']) if datastore['LHOST']
met.gsub!("4444", datastore['LPORT'].to_s) if datastore['LPORT']
uuid = Msf::Payload::UUID.new(
platform: 'php',
arch: ARCH_PHP
)
uuid = generate_payload_uuid
bytes = uuid.to_raw.chars.map { |c| '\x%.2x' % c.ord }.join('')
met = met.sub("\"PAYLOAD_UUID\", \"\"", "\"PAYLOAD_UUID\", \"#{bytes}\"")

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -45,12 +45,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit3
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block, which for staged connections is really simple.
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X64
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block, which for staged connections is really simple.
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X64
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X64
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -45,12 +45,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X64
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -44,12 +44,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X64
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block
config_opts = {

View File

@ -149,18 +149,11 @@ module Metasploit3
end
def generate_meterpreter
blob = MetasploitPayloads.read('meterpreter', 'msflinker_linux_x86.bin')
blob
MetasploitPayloads.read('meterpreter', 'msflinker_linux_x86.bin')
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new({
:platform => 'linux',
:arch => ARCH_X86
})
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block, which for staged connections is really simple.
config_opts = {

View File

@ -31,11 +31,7 @@ module Metasploit4
f.read(f.stat.size)
}
uuid = opts[:uuid] || Msf::Payload::UUID.new(
platform: 'php',
arch: ARCH_PHP
)
uuid = opts[:uuid] || generate_payload_uuid
bytes = uuid.to_raw.chars.map { |c| '\x%.2x' % c.ord }.join('')
met = met.sub("\"PAYLOAD_UUID\", \"\"", "\"PAYLOAD_UUID\", \"#{bytes}\"")

View File

@ -37,11 +37,7 @@ module Metasploit3
met = met.sub("DEBUGGING = False", "DEBUGGING = True")
end
uuid = opts[:uuid] || Msf::Payload::UUID.new(
platform: 'python',
arch: ARCH_PYTHON
)
uuid = opts[:uuid] || generate_payload_uuid
bytes = uuid.to_raw.chars.map { |c| '\x%.2x' % c.ord }.join('')
met = met.sub("PAYLOAD_UUID = \"\"", "PAYLOAD_UUID = \"#{bytes}\"")

View File

@ -37,12 +37,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X86
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block, which for staged connections is really simple.
config_opts = {

View File

@ -37,12 +37,7 @@ module Metasploit4
end
def generate_config(opts={})
unless opts[:uuid]
opts[:uuid] = Msf::Payload::UUID.new(
platform: 'windows',
arch: ARCH_X64
)
end
opts[:uuid] ||= generate_payload_uuid
# create the configuration block, which for staged connections is really simple.
config_opts = {