First brought to my attention by this blog post from DDJ, the folks at SPI Labs (part of SPI Dynamics have posted a PDF security briefing entitled Detecting, Analyzing, and Exploiting Intranet Applications using JavaScript.

This technique can scan networks protected behind firewalls such as corporate networks. All the code to do this is written in JavaScript and uses parts of the 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.

Yecch. And, it could be used as a payload in an XSS vulnerability for extra fun. You can try out their proof of concept if you like.