HEX
Server: LiteSpeed
System: Linux srv1.dhviews.com 5.14.0-570.23.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 24 11:27:16 EDT 2025 x86_64
User: bdedition (1723)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //proc/self/root/proc/thread-self/root/usr/local/apps/awstats/wwwroot/cgi-bin/fcgi.php
<?php
$descriptorspec = array(
	0 => array('pipe', 'r'),  // stdin is a pipe that the child will read from
	1 => array('pipe', 'w'),  // stdout is a pipe that the child will write to
	2 => array('pipe', 'w')   // stderr is a file to write to
);

$_SERVER['X_SCRIPT_FILENAME'] = '/usr/local/apps/awstats/wwwroot/cgi-bin/'.basename($_SERVER['X_SCRIPT_FILENAME']);
$_SERVER['X_SCRIPT_NAME'] = $_SERVER['X_SCRIPT_FILENAME'];

$newenv = $_SERVER;
$newenv['SCRIPT_FILENAME'] = $_SERVER['X_SCRIPT_FILENAME'];
$newenv['SCRIPT_NAME'] = $_SERVER['X_SCRIPT_NAME'];

$webuzo_path = '/usr/local/webuzo';

include_once('/usr/local/webuzo/sdk/sessions.php');

$webuzo_sess = new Webuzo_Sessions();

$logged_in = $webuzo_sess->isLogin();

// Send to login URL
if(empty($logged_in)){
	$webuzo_sess->show_login();
	die();
}

if($logged_in['user'] != 'root'){
	if(!array_key_exists($_GET['config'], $logged_in['domains'])){
		die('You are not authorized to see this page.');
	}
}

if (is_executable($_SERVER['X_SCRIPT_FILENAME'])) {
	$process = proc_open($_SERVER['X_SCRIPT_FILENAME'], $descriptorspec, $pipes, NULL, $newenv);

	if (is_resource($process)) {
		fclose($pipes[0]);
		$head = fgets($pipes[1]);

		while (strcmp($head, "\n")) {
			header($head);
			$head = fgets($pipes[1]);
		}

		fpassthru($pipes[1]);
		fclose($pipes[1]);
		fclose($pipes[2]);

		$return_value = proc_close($process);
	} else {
		header('Status: 500 Internal Server Error');
		echo('Internal Server Error');
	}
} else {
	header('Status: 404 Page Not Found');
	echo('Page Not Found');
}