Mass Deface
Email Grabber
0)
{
shell_exec(" /usr/local/letsencrypt/./certbot-auto certificates > /var/log/letsencrypt/sslrenew.log");
$domain_certbot = shell_exec("grep -ni 'Domains' /var/log/letsencrypt/sslrenew.log");
$line_cerbot = explode("\n",$domain_certbot);
$line=array();
$domain_list=array();
foreach($line_cerbot as $key=>$value)
{
if(trim($value)!="")
{
$line_num = explode(":", $value);
$line[] = trim($line_num[0]) + 3;
$domain_list_temp=explode(":",$value);
$domain_list_temp1=explode(",",$domain_list_temp[2]);
$domain_list[]=trim($domain_list_temp1[0]);
}
}
foreach($domain_list as $key=>$value)
{
if(trim($value)!="")
{
$domain_lists_temp=explode(" ",$value);
$domain_lists[]=trim($domain_lists_temp[0]);
}
}
if((in_array(trim($domain) ,$domain_lists)))
{
shell_exec("echo 'completed' > /var/log/letsencrypt/$domain.log");
$res = "success";
}
else
{
global $zdbh;
echo $domain."\n";
echo "UPDATE x_ssl SET ssl_status='-1' WHERE ssl_doamin=$domain AND ssl_delete IS NULL \n";
$numrows = $zdbh->prepare("UPDATE x_ssl SET ssl_status='-1' WHERE ssl_doamin=:domain AND ssl_status=0 AND ssl_delete IS NULL");
$numrows->bindParam(':domain', $domain);
$ret = $numrows->execute();
echo $ret."\n";
shell_exec("echo 'failed' > /var/log/letsencrypt/$domain.log");
$res = "failed";
}
$email_id = "tech@ovipanel.com";
$headers = "From: $email_id" . "\r\n" ;
$headers .= "MIME-Version: 1.0\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$subject = "OVIPanel - SSL status for $domain";
if($res == "success")
{
$body = "Dear Client,
SSL successfully installed for your domain $domain . Kindly Check it, If its not working contact our OVIPanel support team.
Thank You.";
}
else
{
$body = "Dear Client,
We are not able to install SSL for your domain $domain . For more details check log on /var/log/letsencrypt/letsencrypt.log Kindly contact our OVIPanel support team.
Thank You.";
}
if (mail($to_email_id,$subject,$body,$headers))
{
echo "mail sent with email body $body to $to_email_id \n" ;
}
else
echo "mail not sent with email body $body to $to_email_id \n" ;
}
}
?>