*************************************************************************
BONUS SECTION: Drive By Port Scanning and Exploitation of Internal Networks
SPI Labs has discovered a technique to use JavaScript to portscan an internal network, fingerprint all the web-enabled devices found, and send attacks or commands to those devices. All the code uses parts of the JavaScript standard that are almost ten years old. Accordingly, the code can execute in nearly any Web browser on nearly any platform when a user opens a Webpage that contains the JavaScript. Since this is not exploiting any browser bug or vulnerability, there is no patch or defense for the end user other than turning off JavaScript support in the browser. The code can be part of a Cross-site scripting (XSS) attack payload, thereby increasing the damage XSS can do.
Simply viewing a page with an embedded scanner will download the JavaScript along with the HTML to a user's browser, automatically executing the code. The scanner can be included in a site an attacker controls, or injected into popular sites using XSS vulnerabilities. The scanner finds targets by implementing a "ping" feature using the JavaScript Image object and an IFrame tag. Uses a blend of these two objects allows the scanner to quickly detect hosts and confirm they are serving HTTP content. Once the scanner has detected a host with a web interface, the scanner tries to fingerprint the Web server to determine its type and version number. This is done using the Image object to retrieve graphics from well known locations on the device. For example, most Microsoft IIS Web server's have an image /pagerror.gif that is 36 by 48 pixels in size, Linksys WRK54G wireless routers have an image /UI_Linksys.gif that is 165 by 57 pixels, and Plone wiki applications have an image /plone_powered.gif that is 80 by 15 pixels. Once the scanner knows what applications exist on the intranet, it can send attacks to exploit known vulnerabilities in the applications. By dynamically building HTML forms and automatically submitting them, the scanner can send attacks using either GET or POST against the application. At the very least, the information collected from scanning and fingerprinting can be sent to the attacker to assist in planning another attack.
SPI Labs has created a proof of concept web page that implements the detection and fingerprinting functionality of a full scanner. This site is available to the public and is listed at the end of this article. The scanner does not automatically start scanning or attacking any internal applications.
Most of these traditional XSS attacks target the Website where the XSS vulnerability exists and the damage of the attack is limited by the features of that Website. For example, session hijacking is only damaging if the site that has the XSS vulnerability actually issues session state and does something meaningful with it. The danger is that scanning and attacking internal applications or systems targets the end user. This means any XSS vulnerability on any site can be used to attack the end user, regardless of the features of the vulnerable site. There is no longer any such thing as a harmless XSS vulnerability.
More information: Complete Whitepaper: http://www.spidynamics.com/assets/documents/JSportscan.pdf Proof of Concept: http://www.spidynamics.com/spilabs/js-port-scan/ Upcoming BlackHat Presentation, Jeremiah Grossman, WhiteHat Security: http://www.blackhat.com/html/bh-usa-06/bh-usa-06-speakers.html#Grossman Upcoming BlackHat Presentation, Billy Hoffman, SPI Dynamics: http://www.blackhat.com/html/bh-usa-06/bh-usa-06-speakers.html#Hoffman2
______________________________________________________________________
(c) 2006. All rights reserved. The information contained in this newsletter, including any external links, is provided "AS IS," with no express or implied warranty, for informational purposes only. In some cases, copyright for material in this newsletter may be held by a party other than Qualys (as indicated herein) and permission to use such material must be requested from the copyright owner.
==end==
Subscriptions: @RISK is distributed free of charge to people responsible for managing and securing information systems and networks. You may forward this newsletter to others with such responsibility inside or outside your organization.