403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/mitzvahm/planner/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mitzvahm/planner/mod/delegate_login.php
<?php include('_mod_security.php'); ?>
<?php
	if (isset($_SESSION['user_id'])) :
		if (isset($_SESSION['delegate'])) :
			if ($_SESSION['delegate'] == 1) :
				$action = "OK";
				if (empty($_POST['user_id'])) :
					$sql_email = "SELECT * FROM users WHERE id = ".$_SESSION['user_id']." AND active = 1";
					$result_email = mysqli_query($GLOBALS['con'], $sql_email) or die('Database Error!');
					if (mysqli_num_rows($result_email) > 0) :
						$row_email = mysqli_fetch_object($result_email);
						$_POST['user_id'] = $row_email->email;
					endif;
				endif;
			else :
				exit();
			endif;
		else :
			exit();
		endif;
	else :
		exit();
	endif;
	//var_dump($_POST);
	//var_dump($_GET);
	$success = 0;
	if ($_POST['ajax_event_submitted'] == '1') :
		$ar_err = array();
		if (empty($_POST['pwd'])) :
			$ar_err['pwd'] = 'Password required!';
			$err_flag = true;
		else :
			$sql_pwd = "SELECT * FROM users WHERE id = ".$_SESSION['user_id']." AND active = 1";
			$result_pwd = mysqli_query($GLOBALS['con'], $sql_pwd) or die('Database Error!');
			if (mysqli_num_rows($result_pwd) > 0) :
				$row_pwd = mysqli_fetch_object($result_pwd);
				if ($row_pwd->password2 != mysqli_real_escape_string($GLOBALS['con'], trim($_POST['pwd']))) :
					$ar_err['pwd'] = 'Password invalid!';
					$err_flag = true;
				endif;
			else :
				$ar_err['pwd'] = 'Password not found!';
				$err_flag = true;
			endif;
		endif;
		if (empty($_POST['user_id'])) :
			$ar_err['user_id'] = 'Your user ID required!';
			$err_flag = true;
		endif;
		if (strtolower($_POST['user_id']) != strtolower($row_pwd->email)) :
			$ar_err['user_id'] = 'Your user ID invalid!';
			$err_flag = true;
		endif;
		if (empty($_POST['delegate_user_id'])) :
			$ar_err['delegate_user_id'] = 'Delegate user ID required!';
			$err_flag = true;
		endif;
		if (!$err_flag) :
			$sql_delegate = "SELECT * FROM users WHERE email = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['delegate_user_id']))."' AND active = 1";
			$result_delegate = mysqli_query($GLOBALS['con'], $sql_delegate) or die('Database Error!');
			if (mysqli_num_rows($result_delegate) > 0) :
				$row_delegate = mysqli_fetch_object($result_delegate);
				write_log('I', $_SESSION['user_id'], 'User '.$_SESSION['user_first_name'].' '.$_SESSION['user_last_name'].' logged on as delegate for '.$row_delegate->first_name.' '.$row_delegate->last_name);
				$_SESSION['delegate_user_id'] = $_SESSION['user_id'];
				$_SESSION['delegate_user_first_name'] = $_SESSION['user_first_name'];
				$_SESSION['delegate_user_last_name'] = $_SESSION['user_last_name'];
				$_SESSION['delegate_logged_in'] = true;
				$_SESSION['user_id'] = $row_delegate->id;
				$_SESSION['logged_in'] = true;
				$_SESSION['username'] = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['delegate_user_id']));
				$_SESSION['user_first_name'] = $row_delegate->first_name;
				$_SESSION['user_last_name'] = $row_delegate->last_name;
				$_SESSION['active_event'] = $row_delegate->active_event;
				$_SESSION['rand_key'] = generate_random_string(32);
				$_SESSION['delegate'] = $row_delegate->delegate;
				unset($_SESSION['followup']);
			else :
				$ar_err['delegate_user_id'] = 'Delegate user ID invalid!';
				$err_flag = true;
			endif;
		endif;
		if (!$err_flag) :
			$form_message = "You are now logged in as ".$_SESSION['user_first_name']." ".$_SESSION['user_last_name'].".  Click continue to proceed.";
			unset($_POST['pwd']);
			$success = 1;
		else :
			$form_message = "Errors found!";
			unset($_POST['pwd']);
		endif;
	else :
		//$_POST['email'] = $_SESSION['email'];
	endif;
	
?>

<script>
	var active_tab = '';
	
	encode_pwd = function()
	{
		if (document.getElementById('pwd').value)
		{
			$.ajax({
				url: "ajax.php?call=login_tokens&email=" + document.getElementById('user_id').value,
				cache: false,
				dataType: "json",
				async: false,
				success: function(json) {
						if (json.salt > ' ')
						{
							document.getElementById('pwd').value = CryptoJS.SHA512(json.salt + document.getElementById('pwd').value);
						}
				}
				 ,error: function (request, status, error) { /* alert(status + ", " + error); */ }
			})
		}
		return true;
	}
	
	$(document).ready(function()	
	{
		//switch_tab('<?php echo $active_tab; ?>');
		$("#tab_content_general").show();
	}
	)
</script>

<h1>Delegate Login</h1>

<?php 
	if ($success != 1) :
?>
		<form style="" name="frm_login" id="frm_login" method="post" action="" onsubmit="encode_pwd();">
			<input name="ajax_event_submitted" type="hidden" value="1" />
			<input name="active_tab" id="active_tab" type="hidden" value="general" />
			<div class="cleardiv">
				&nbsp;
			</div>
			<div class="tab_content" id="tab_content_general">
				<div class="form_header">
					Login As Delegate 
				</div>
				<table class="input_block">
					<tr>
						<td>
							Your User ID (Email)
						</td>
						<td>
							<input name="user_id" id="user_id" type="text" maxlength="40" value="<?php echo $_POST['user_id']; ?>"  />
							<?php show_form_error($ar_err['user_id']); ?>
						</td>
					</tr>
					<tr>
						<td>
							Your Password
						</td>
						<td>
							<input name="pwd" id="pwd" type="password" maxlength="50" value="<?php echo $_POST['pwd']; ?>"  />
							<?php show_form_error($ar_err['pwd']); ?>
						</td>
					</tr>
					<tr>
						<td>
							Delegate User ID (Email)
						</td>
						<td>
							<input name="delegate_user_id" id="delegate_user_id" type="text" maxlength="40" value="<?php echo $_POST['delegate_user_id']; ?>"  />
							<?php show_form_error($ar_err['delegate_user_id']); ?>
						</td>
					</tr>
				</table>
			</div>
			<!-- -------------------------------------------------------------------------------------------------------------- -->
			<div class="form_strip">
				<span class="form_message">
					<?php echo $form_message; ?>
				</span>
				<input type="submit" name="submit" value="Login" />
				&nbsp;&nbsp;
				<input type="button" value="Cancel" onclick="window.location.href = 'index.php?IX=events'" />
			</div>
		</form>
<?php
	else :
?>
		<div class="form_strip" style="border:none;">
			<?php echo form_message($form_message); ?>
			<form>
				<input type="button" value="Continue" onclick="window.location.href = 'index.php?IX=ez_guide'" />
			</form>
		</div>
<?php
	endif;
?>


Youez - 2016 - github.com/yon3zu
LinuXploit