1) return false; return true; } // Is the effective and real userID the same ? if(posix_getuid() != posix_geteuid()){ echo "EUID differs from UID. Hacking Attempt !"; exit; } //For enduser if(posix_getuid() != 0){ $TMP_USER = posix_getpwuid(posix_geteuid()); $TMP_HOME = $TMP_USER['dir']; // Create the directory if it does not exist if(!is_dir($TMP_HOME.'/.softaculous/sess/')){ @mkdir($TMP_HOME.'/.softaculous/sess/', 0711, true); } // Load the Panel if(function_exists('random_bytes')){ $sess = md5(bin2hex(random_bytes(32))); }else{ $sess = str_shuffle(md5(uniqid(microtime()))); } $file = $TMP_HOME.'/.softaculous/sess/'.$sess; // Touch the file touch($file); chmod($file, 0600); $fp = fopen($file, "a"); if(empty($fp)){ die('Could not write SESSION DATA.'); } $array = array(); $array['SERVER'] = $_SERVER; $array['POST'] = $_POST; $array['GET'] = $_GET; $array['REQUEST'] = $_REQUEST; $array['COOKIE'] = $_COOKIE; $array['SESSION'] = $_SESSION; $array['FILES'] = $_FILES; fwrite($fp, json_encode($array)); fclose($fp); chmod($file, 0600); session_write_close(); if(file_exists('/usr/local/cwpsrv/var/services/users')){ //echo '/usr/local/cwp/php/bin/php /usr/local/cwp/softaculous/load.php '.$sess; //echo shell_exec('/usr/local/cwp/php/bin/php /usr/local/cwpsrv/var/services/users/softaculous/load.php '.$sess); echo shell_exec('/usr/local/softaculous/bin/soft sess '.$sess); }else{ //echo '/usr/local/cwp/php/bin/php /usr/local/cwp/softaculous/load.php '.$sess; echo shell_exec('/usr/local/cwp/php/bin/php /usr/local/cwp/softaculous/load.php '.$sess); } @unlink($file); // load.php will also try to delete it! // Just to ensure that there should not be any files as a security measures. $d = date('i'); if($d % 2 == 0){ if ($dh = opendir($TMP_HOME.'/.softaculous/sess/')) { while (($dfile = readdir($dh)) !== false) { if($dfile == '.' || $dfile == '..') continue; clearstatcache(); $stime = filemtime($TMP_HOME.'/.softaculous/sess/'.$dfile); // Delete the file if its there for more than 10 seconds if($stime < (time() - 10)){ @soft_unlink_user_file($TMP_HOME.'/.softaculous/sess/'.$dfile); } } closedir($dh); } } }else{ define('SOFTACULOUS', 1); include('/usr/local/softaculous/enduser/universal.php'); include($globals['path'].'/index.php'); }