⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.37
Server IP:
15.235.14.176
Server:
Linux server2.ihostph.com 4.18.0-553.30.1.el8_10.x86_64 #1 SMP Tue Nov 26 02:30:26 EST 2024 x86_64
Server Software:
Apache
PHP Version:
8.1.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
gracious
/
verification.graciousphils.com
/
View File Name :
forwardtosql.PHP7
#!/usr/local/bin/php -q <?php date_default_timezone_set('Asia/Manila'); header('Content-Type: text/html; charset=utf-8'); chdir(dirname(__FILE__)); $fd = fopen("php://stdin", "r"); $email = ""; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); if(strlen($email)<1) { die(); } // handle email $lines = explode("\n", $email); // empty vars $from = ""; $to=""; $subject = ""; $headers = ""; $message = ""; $splittingheaders = true; for ($i=0; $i < count($lines); $i++) { if ($splittingheaders) { // this is a header $headers .= $lines[$i]."\n"; // look out for special headers if (preg_match("/^Subject: (.*)/", $lines[$i], $matches)) { $subject = $matches[1]; } if (preg_match("/^From: (.*)/", $lines[$i], $matches)) { $from = $matches[1]; } if (preg_match("/^To: (.*)/", $lines[$i], $matches)) { $to = $matches[1]; } } else { // not a header, but message $message .= $lines[$i]."\n"; } if (trim($lines[$i])=="") { // empty line, header section has ended $splittingheaders = false; } } $index = 'X-Spam-Flag: NO'; $rDate = date('Y-m-d'); $message = utf8_encode($message); if (($pos = strpos($email, $index)) !== FALSE) { $whatIWant = substr($email, $pos + strlen($index)); $whatIWant = str_replace(array("\r", "\n"), '', $whatIWant); } $data = [ 'message' => $message, 'status' => 'Pending', 'rdate' => $rDate, ]; // The $message variable now holds the entire message text, // which you can use for further processing. $pdo = new PDO("mysql:host=localhost; dbname=gracious_ledgerless","gracious_administrator","Cronica2020",array('charset'=>'utf8')); $searchvalue = $message; $searchvalue = substr($searchvalue, 0, strpos($searchvalue, "TIME")); $search = "SELECT * FROM tbltextpool WHERE message LIKE CONCAT(:search,'%') AND receivedDate = :rDate;"; $stmt = $pdo->prepare($search); $stmt->bindParam(':search', $searchvalue); $stmt->bindParam(':rDate', $rDate); $stmt->execute(); if($stmt->rowCount() == 0){ $query = "INSERT INTO tbltextpool (message, status, receivedDate) VALUES (:message, :status, :rdate);"; $st = $pdo->prepare($query)->execute($data); } ?>