HEX
Server: LiteSpeed
System: Linux w5304130.sdnsbox.com 4.18.0-425.3.1.lve.el8.x86_64 #1 SMP Tue Nov 22 22:59:23 EST 2022 x86_64
User: makefitmeserver (1001)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //var/softaculous/apps/git/gitweb/index.php
<?php

error_reporting(0); // Set E_ALL for debuging

// Include our sessions file
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();
}

if(posix_getuid() == 0){

	$u = posix_getpwnam($webuzo_sess->user['user']);

	posix_setgid($u['gid']);
	posix_setuid($u['uid']);

	// Set ENV
	foreach ($_ENV as $key => $value) {
		putenv($key.'='.$value);
	}

}

// Set the uid and gid
if(posix_getuid() == 0 || $u['uid'] !== posix_getuid()){
	die('Could not shift to the user level');
}

if(!file_exists('/usr/local/apps/perl/bin/perl')){
	die('Perl is not installed , please install it first');
}

putenv('projectroot='.$u['dir']);
passthru('/usr/local/apps/perl/bin/perl '.$webuzo_sess->globals['appspath'].'/git/gitweb.cgi --no_http_header');