Using Java from Javascript

From: David F. Madrid (conde0@telefonica.net)
Date: 04/03/03

  • Next message: Francesco Vigo: "NetBIOS could be used as network flood amplier"
    Date: Thu, 03 Apr 2003 00:02:06 +0200
    To: bugtraq@securityfocus.com
    From: "David F. Madrid" <conde0@telefonica.net>
    
    

    Opera and Netscape browsers allow you to include java methods calls in your
    javascript .
      As Javascript has support for objects you can use objects returned by
    these calls in your scripts .

    I have been looking for information about the possibly security
    implications ( and vulnerabilities
    published ) that this could have , but have found nothing . Doing some test
    by myself this is what
    I have found .

    Opera 6.01

    If you use Opera 6.01 you can make calls to Java exec function , which
    executes the command
    line passed to it . This means you can execute any program . Here is a
    small demonstration

    http://usuarios.lycos.es/idoru/petaopera.html

    The second link executes windows calculator . The first link executes
    verifier.exe , a W2000/XP
    program , causing a buffer overflow in it ( W2000 server is full of command
    line buffer overflows ),
    this means that just visiting a webpage ( a malicious site or a post in a
    forum ) code can be
    executed in your machine with user priviliges .

    Besides , playing with sockets from javascript you can obtain the local Ip
    address with

    var host=java.net.InetAddress.getLocalHost();

    and use it to connect to an arbitrary local tcp port on your IP . If you
    are connected to a LAN ,
    you can connect with every socket in your LAN interface.This means that
    with viewing some
    post in a forum , a script can connect to a port on your PC and send and
    recieve data ( as
    classes like InputDataStram can be used as well ). A new type of cross site
    scripting focused
    in exploiting vulnerable services .

    An example can be found here , connection to port 139 can be tracked with
    netstat ( before
    closing the browser )

    http://usuarios.lycos.es/idoru/sockets.html

    Opera 7.02 and Netscape 7.02

    Both browsers don´t allow to make java calls to determinate methods . Well
    , are allowed
      by they return a null . You can`t execute exec or delete , just methods
    like java.io.File.exists()
    or java.io.File.list() but you can still execute sockets .

    Fourtunately , I wasn´t able of retriving another IP different from
    localhost when the script is
    executed in the server , but it works fine if you email the webpage ,
    establishing the connection
    with port 139 . I don´t know if there is an alternative method of
    retrieving a visitor's IP address from
    java or javascript but if there is this can be exploitable via cross site
    scripting .

    Email sockets.html to you or open it locally and you will see a connection
    with netstat .

    Regards ,

    David F.Madrid ,
    Madrid , Spain


  • Next message: Francesco Vigo: "NetBIOS could be used as network flood amplier"

    Relevant Pages

    • Using Java from Javascript
      ... Opera and Netscape browsers allow you to include java methods calls in ... As Javascript has support for objects you can use ... The second link executes windows calculator. ...
      (NT-Bugtraq)
    • Re: Java Scripts in Internet Explorer
      ... JavaScript and Java, despite the similar names, are completely different things. ... Since the URL includes a domain name, perhaps the security settings of the browser is objecting to or blocking the new page being located on a different domain (a script on "http://www.yyy.com"; opening a new window for a page on "http://www.xxx.com";). ... Since the javascript:launchWindowcode appears to be opening a browser pop-up via a JavaScript function downloaded from the web site, I think a pop-up blocker is preventing your browser from opening a browser window associated with the site you are viewing. ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Java and Javascript
      ... Opera and Netscape browsers allow you to include java methods calls in your ... As Javascript has support for objects you can use objects returned by ... The second link executes windows calculator. ... Both browsers don´t allow to make java calls to determinate methods. ...
      (Bugtraq)
    • Re: Java Scripts in Internet Explorer
      ... Also, as Nass advised, JavaScript problems would involve Windows Script, not ... JavaScript works fine on other sites. ... I am looking for a solution that is based on the MICROSOFT Java Virtual ... I cannot see the source code of the Java Script on the second website. ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Re: Auto-refresh Netscape 4.79 browser on Linux in C application
      ... You want to look up timed events in Javascript. ... browser has the ability to initiate a data transfer, so you need to have a ... script on the web page periodically poll the server for more data. ... you *don't* need Java installed on either the browser or the ...
      (comp.os.linux.development.apps)