OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reader
/
znew1aws-ses
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/04/2025 08:32:49 AM
rwxr-xr-x
📄
.browserslistrc
208 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📄
.gitignore
42 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📄
.htaccess
803 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📄
.htaccess.swp
12 KB
03/03/2025 08:18:55 AM
rw-r--r--
📄
.travis.yml
199 bytes
03/03/2025 08:18:55 AM
rw-r--r--
📄
addList.php
4.7 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
allTemplates.php
5 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bbsns_subscribe.php
5.14 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bcreateList.php
9.61 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
blacklist.php
14.09 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bounceViewList.php
5.86 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bounce_handler.php
9.87 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bprocess_emails.php
6.73 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
checkNotificationTopics.php
5.11 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
check_identity
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
checknotif.php
1.01 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
ckeditor.php
2.14 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
click_handler.php
1.75 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
combined.php
11.23 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
complaintsViewList.php
5.72 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
complaints_handler.php
2.89 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
composer.json
200 bytes
03/03/2025 08:18:56 AM
rw-r--r--
📄
composer.lock
39.12 KB
03/03/2025 08:18:56 AM
rw-r--r--
📄
createList.php
10.05 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
credentials
-
03/03/2025 08:25:28 AM
rwxr-xr-x
📄
csv.php
10.1 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
db.php
1000 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
delete_list.php
509 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
deliveryViewList.php
5.71 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
delivery_handler.php
3.25 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
download_Complaints.php
974 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
download_bounces.php
1007 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
download_delivered.php
971 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
download_unique_open.php
1.6 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
edit_list.php
8.39 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
feedback.php
1.66 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
footer.php
4.71 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
housekeeping.php
9.97 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
index.php
8.12 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
insert_list.php
2.64 KB
05/19/2025 10:07:15 AM
rw-r--r--
📁
log
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
navbar.php
1.64 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
newCompaign.php
5.94 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
open_handler.php
1.75 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
process_emails.php
10.21 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
real-recipients.csv
39.48 KB
03/03/2025 08:18:56 AM
rw-r--r--
📄
sample.csv
55 bytes
03/03/2025 08:18:56 AM
rw-r--r--
📄
send_email.php
987 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
send_email_campaignGraph.php
2.24 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
sendgrid.php
3.62 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
showListMembers.php
4.54 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
showcase.php
7.93 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
sidebar.php
3.11 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
sns_subscribe.php
5.25 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
submit_form.php
2.48 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
test-mail.csv
337 bytes
03/03/2025 08:18:56 AM
rw-r--r--
📄
test.php
969 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
test_process_emails.php
1.91 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
upload_image.php
606 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📁
uploads
-
03/03/2025 08:25:38 AM
rwxr-xr-x
📁
vendor
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
verify.html
486 bytes
03/03/2025 08:18:56 AM
rw-r--r--
📄
verify.php
3.12 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
verify_email.php
5.12 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
viewCampaign.php
13.05 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
viewList.php
8.47 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
zsidebar.php
3.27 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
zviewCampaign.php
8.94 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
zzprocess_emails.php
10.07 KB
05/19/2025 10:07:15 AM
rw-r--r--
Editing: bounce_handler.php
Close
<?php // Include Composer autoload // require_once __DIR__ . '/vendor/autoload.php'; // use Aws\Sns\Message; // use Aws\Sns\MessageValidator; // use Aws\Sns\Exception\SnsException; // use PHPMailer\PHPMailer\PHPMailer; // use PHPMailer\PHPMailer\Exception; // // Your AWS credentials and settings // $awsAccessKey = 'AKIARWSGL3TOGXCYQJVY'; // $awsSecretKey = 'BIj9DvNM3uX+cckSX4So50fqln6DEhie6dMJpe3AjzqK'; // $awsRegion = 'ap-south-1'; // // Handle the incoming SNS notification // try { // $message = Message::fromRawPostData(); // $validator = new MessageValidator(); // // Validate the SNS message // if ($validator->isValid($message)) { // // Log the entire message for debugging // error_log('SNS Message: ' . json_encode($message, JSON_PRETTY_PRINT)); // $type = $message['notificationType']; // if ($type == 'Bounce') { // $bounces = $message['bounce']['bouncedRecipients']; // $bouncedDate = $message['mail']['timestamp']; // Adjust this line as needed after logging the message // foreach ($bounces as $bounce) { // $email = $bounce['emailAddress']; // $reason = $message['bounce']['bounceType']; // // Insert bounce data into the database // insertBounceData($email, $reason, $bouncedDate); // sendBounceNotification($email, $reason, $bouncedDate); // } // } elseif ($type == 'Complaint') { // $complaints = $message['complaint']['complainedRecipients']; // $bouncedDate = $message['mail']['timestamp']; // Adjust this line as needed after logging the message // foreach ($complaints as $complaint) { // $email = $complaint['emailAddress']; // $reason = 'Complaint'; // // Insert complaint data into the database // insertBounceData($email, $reason, $bouncedDate); // sendBounceNotification($email, $reason, $bouncedDate); // } // } // } else { // throw new Exception('Invalid SNS message'); // } // } catch (SnsException $e) { // error_log('SNS Exception: ' . $e->getMessage()); // } catch (Exception $e) { // error_log('Exception: ' . $e->getMessage()); // } // // Function to insert bounce data into the database // function insertBounceData($email, $reason, $bouncedDate) { // include 'db.php'; // // Insert bounce data into the bounce table // $stmt = $conn->prepare("INSERT INTO bounce (email, reason, bounce_date) VALUES (?, ?, ?)"); // $stmt->bind_param('sss', $email, $reason, $bouncedDate); // $stmt->execute(); // $stmt->close(); // $conn->close(); // } // // Function to send bounce notification // function sendBounceNotification($email, $reason, $bouncedDate) { // global $awsAccessKey; // global $awsSecretKey; // $mail = new PHPMailer(true); // try { // $mail->CharSet = 'UTF-8'; // $mail->isSMTP(); // $mail->Host = 'email-smtp.ap-south-1.amazonaws.com'; // $mail->Username = $awsAccessKey; // $mail->Password = $awsSecretKey; // $mail->Port = 587; // $mail->SMTPDebug = 0; // $mail->SMTPAuth = true; // $mail->SMTPSecure = 'tls'; // $mail->setFrom('no-reply@knobly.com', 'Knobly Support'); // $mail->addAddress('support@knobly.com'); // $mail->isHTML(true); // $mail->Subject = 'Bounce Notification'; // $mail->Body = "Email Address: $email<br>Reason: $reason<br>Date: $bouncedDate"; // $mail->send(); // } catch (Exception $e) { // error_log('Bounce notification sending failed: ' . $e->getMessage()); // } // } ?> <?php // include('../config.php'); // //--------------------------------------------------------------// // function dbConnect() { //Connect to database // //--------------------------------------------------------------// // // Access global variables // global $mysqli; // global $dbHost; // global $dbUser; // global $dbPass; // global $dbName; // global $dbPort; // // Attempt to connect to database server // if(isset($dbPort)) $mysqli = new mysqli($dbHost, $dbUser, $dbPass, $dbName, $dbPort); // else $mysqli = new mysqli($dbHost, $dbUser, $dbPass, $dbName); // // If connection failed... // if ($mysqli->connect_error) { // fail(); // } // global $charset; mysqli_set_charset($mysqli, isset($charset) ? $charset : "utf8"); // return $mysqli; // } // //--------------------------------------------------------------// // function fail() { //Database connection fails // //--------------------------------------------------------------// // print 'Database error'; // exit; // } // // connect to database // dbConnect(); // include 'db.php'; $servername = "139.59.38.164"; $username = "root"; $password = "newstart"; $dbname = "knoblyemail"; $conn = new mysqli($servername, $username, $password, $dbname); ?> <?php if (!isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = file_get_contents('php://input'); $data = json_decode($HTTP_RAW_POST_DATA); $time = time(); $bounce_simulator_email = 'bounce@simulator.amazonses.com'; if ($json['Type'] === 'SubscriptionConfirmation') { // Extract the SubscribeURL from the request $subscribeURL = $json['SubscribeURL']; // Confirm the subscription by making a GET request to the SubscribeURL $response = file_get_contents($subscribeURL); // Optionally log the response for debugging file_put_contents('php://stderr', print_r($response, TRUE)); } //Confirm SNS subscription if ($data->Type == 'SubscriptionConfirmation') { //Get $data->SubscribeURL and check if URL originates from amazonaws.com $sns_subscribe_url = $data->SubscribeURL; $subscribe_url_host = parse_url($sns_subscribe_url, PHP_URL_HOST); $subscribe_url_host2 = explode('.', $subscribe_url_host); $subscribe_url_tld = $subscribe_url_host2[count($subscribe_url_host2) - 2] . '.' . $subscribe_url_host2[count($subscribe_url_host2) - 1]; if ($subscribe_url_tld != 'amazonaws.com') exit; //Run SubscribeURL to confirm SNS subscription file_get_contents_curl($sns_subscribe_url); } else { //detect bounces $obj = json_decode($data->Message); if (!isset($obj->{'bounce'})) exit; $notificationType = $obj->{'notificationType'}; $bounceType = $obj->{'bounce'}->{'bounceType'}; $problem_email = $obj->{'bounce'}->{'bouncedRecipients'}; $problem_email = mysqli_real_escape_string($mysqli, get_email($problem_email[0]->{'emailAddress'})); $from_email = mysqli_real_escape_string($mysqli, get_email($obj->{'mail'}->{'source'})); //check if email is valid, if not, exit if (!filter_var($problem_email, FILTER_VALIDATE_EMAIL)) exit; if ($notificationType == 'Bounce') { //Update Bounce status if ($problem_email == $bounce_simulator_email) { if (filter_var($from_email, FILTER_VALIDATE_EMAIL)) { mysqli_query($mysqli, 'UPDATE apps SET bounce_setup=1 WHERE from_email = "' . $from_email . '"'); mysqli_query($mysqli, 'UPDATE campaigns SET bounce_setup=1 WHERE from_email = "' . $from_email . '"'); } } //Update database of if ($bounceType == 'Transient') $q = 'UPDATE subscribers SET bounce_soft = bounce_soft+1 WHERE email = "' . $problem_email . '"'; else if ($bounceType == 'Permanent') $q = 'UPDATE subscribers SET bounced = 1, timestamp = ' . $time . ' WHERE email = "' . $problem_email . '"'; $r = mysqli_query($mysqli, $q); if ($r) { //check if recipient has soft bounced 3 times if ($bounceType == 'Transient') { $q2 = 'SELECT bounce_soft FROM subscribers WHERE email = "' . $problem_email . '" LIMIT 1'; $r2 = mysqli_query($mysqli, $q2); if ($r2 && mysqli_num_rows($r2) > 0) { while ($row = mysqli_fetch_array($r2)) { $bounce_soft = $row['bounce_soft']; } //if soft bounced 3 times or more, set as hard bounce if ($bounce_soft >= 3) { $q = 'UPDATE subscribers SET bounced = 1, timestamp = ' . $time . ' WHERE email = "' . $problem_email . '"'; $r = mysqli_query($mysqli, $q); if ($r) { } } } } } } } //--------------------------------------------------------------// function file_get_contents_curl($url) //--------------------------------------------------------------// { //Get server path $server_path_array = explode('includes/campaigns/bounces.php', $_SERVER['SCRIPT_FILENAME']); $server_path = $server_path_array[0]; $ca_cert_bundle = $server_path . 'certs/cacert.pem'; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_CAINFO, $ca_cert_bundle); $data = curl_exec($ch); curl_close($ch); return $data; } //--------------------------------------------------------------// function get_email($string) //--------------------------------------------------------------// { foreach (preg_split('/\s/', $string) as $token) { $email = filter_var(filter_var($token, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL); if ($email !== false) $emails[] = $email; } return $emails[0]; } ?>