Land #9126, Add android advanced options

MS-2855/keylogger-mettle-extension
Brent Cook 2017-12-11 04:11:44 -06:00
commit 63b5bb3dea
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
6 changed files with 31 additions and 4 deletions

View File

@ -17,7 +17,7 @@ PATH
metasploit-concern
metasploit-credential
metasploit-model
metasploit-payloads (= 1.3.18)
metasploit-payloads (= 1.3.19)
metasploit_data_models
metasploit_payloads-mettle (= 0.2.8)
msgpack
@ -178,7 +178,7 @@ GEM
activemodel (~> 4.2.6)
activesupport (~> 4.2.6)
railties (~> 4.2.6)
metasploit-payloads (1.3.18)
metasploit-payloads (1.3.19)
metasploit_data_models (2.0.15)
activerecord (~> 4.2.6)
activesupport (~> 4.2.6)

View File

@ -56,7 +56,12 @@ module Msf::Payload::Android
}
config = Rex::Payloads::Meterpreter::Config.new(config_opts).to_b
config[0] = "\x01" if opts[:stageless]
flags = 0
flags |= 1 if opts[:stageless]
flags |= 2 if ds['AndroidMeterpreterDebug']
flags |= 4 if ds['AndroidWakelock']
flags |= 8 if ds['AndroidHideAppIcon']
config[0] = flags.chr
config
end

View File

@ -0,0 +1,18 @@
# -*- coding: binary -*-
require 'msf/core'
module Msf::Payload::Android::PayloadOptions
def initialize(info = {})
super(info)
register_advanced_options(
[
Msf::OptBool.new('AndroidMeterpreterDebug', [ false, "Run the payload in debug mode, with logging enabled" ]),
Msf::OptBool.new('AndroidWakelock', [ false, "Acquire a wakelock before starting the payload" ]),
Msf::OptBool.new('AndroidHideAppIcon', [ false, "Hide the application icon automatically after launch" ]),
]
)
end
end

View File

@ -2,6 +2,7 @@
require 'msf/core'
require 'msf/core/payload/transport_config'
require 'msf/core/payload/android/payload_options'
require 'msf/core/payload/uuid/options'
module Msf
@ -16,6 +17,7 @@ module Payload::Android::ReverseHttp
include Msf::Payload::TransportConfig
include Msf::Payload::Android
include Msf::Payload::Android::PayloadOptions
include Msf::Payload::UUID::Options
#

View File

@ -2,6 +2,7 @@
require 'msf/core'
require 'msf/core/payload/transport_config'
require 'msf/core/payload/android/payload_options'
module Msf
@ -15,6 +16,7 @@ module Payload::Android::ReverseTcp
include Msf::Payload::TransportConfig
include Msf::Payload::Android
include Msf::Payload::Android::PayloadOptions
#
# Generate the transport-specific configuration

View File

@ -70,7 +70,7 @@ Gem::Specification.new do |spec|
# are needed when there's no database
spec.add_runtime_dependency 'metasploit-model'
# Needed for Meterpreter
spec.add_runtime_dependency 'metasploit-payloads', '1.3.18'
spec.add_runtime_dependency 'metasploit-payloads', '1.3.19'
# Needed for the next-generation POSIX Meterpreter
spec.add_runtime_dependency 'metasploit_payloads-mettle', '0.2.8'
# Needed by msfgui and other rpc components