eurysco

eurysco is a free and open source project based on PHP language, in order to enhance and simplify the remote administration of Microsoft operating systems with an intuitive, fast and responsive web interface

view my linkedin profileview my linkedin profile :)

Privacy Policy
     

Total sweet donations $23
Help me to support eurysco (^_^) !

Source connect





0001 <?php
0002 
0003 include(str_replace('\\server', '', $_SERVER['DOCUMENT_ROOT']) . '\\include\\init_server.php');
0004 
0005 set_time_limit(60);
0006 
0007 $agentkeyresp = '<agentkeyresp>null</agentkeyresp>' . "\n";
0008 if (isset($_POST['agentkey']) && isset($_POST['computername'])) {
0009 	$corepath = $euryscoinstallpath . '\\core';
0010 	$nodespath = $euryscoinstallpath . '\\nodes';
0011 
0012 	if (!file_exists($nodespath . '\\' . strtolower($_POST['computername']) . '\\')) { mkdir($nodespath . '\\' . strtolower($_POST['computername']) . '\\', 0777); @copy($euryscoinstallpath . '\\conf\\config_settings.xml', $nodespath . '\\' . strtolower($_POST['computername']) . '\\config_settings.xml'); }
0013 
0014 	if (strlen($_POST['agentkey']) > 32) {
0015 		$mcrykeycmd = pack('H*', hash('sha256', md5(strtolower($_POST['computername']))));
0016 		$_POST['agentkey'] = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $mcrykeycmd, substr(base64_decode($_POST['agentkey']), $iv_size), MCRYPT_MODE_CBC, substr(base64_decode($_POST['agentkey']), 0, $iv_size)));
0017 		$fp = fopen($nodespath . '\\' . strtolower($_POST['computername']) . '\\agent.key', 'w');
0018 		fwrite($fp, trim($_POST['agentkey']));
0019 		fclose($fp);
0020 		$agentkeyresp = '<agentkeyresp>' . hash('sha512', $_POST['agentkey']) . '</agentkeyresp>' . "\n";
0021 	}
0022 	if (strlen($_POST['agentkey']) == 32 && file_exists($nodespath . '\\' . strtolower($_POST['computername']) . '\\agent.key')) { 
0023 		$agentkeyresp = '<agentkeyresp>' . md5($_POST['agentkey'] . fgets(fopen($nodespath . '\\' . strtolower($_POST['computername']) . '\\agent.key', 'r'))) . '</agentkeyresp>' . "\n";
0024 	}
0025 }
0026 
0027 echo $agentkeyresp;
0028 echo '</euryscoServer>';
0029 
0030 foreach (get_defined_vars() as $key=>$val) {
0031 	if ($key != '_GET' && $key != '_POST' && $key != '_COOKIE' && $key != '_FILES' && $key != '_SERVER' && $key != '_SESSION' && $key != '_ENV') {
0032 		$$key = null;
0033 		unset($$key);
0034 	}
0035 }
0036 
0037 if (extension_loaded('zlib')) { ob_end_flush(); }
0038 
0039 ?>