';
echo 'Falls du verschlüsseln willst findest du den OpenPGP-Key hier mit dieser Signatur.';
}
else
{
//echo 'Danke für deine Rückmeldung - Nachricht gesendet!
';
//write message to file
//writeFile($_POST['nachricht']);
//write an e-mail
//sendMail($_POST['nachricht']);
processMessage($_POST['nachricht']);
}
function processMessage($nachricht)
{
$spam=false;
$spamliste=array('robot','geld','einkommen','dollar','tausend','24crypto.de');
$grund='';
$kleinNachricht=strtolower($nachricht);
foreach ($spamliste as $spamwort)
{
if (strpos($kleinNachricht, $spamwort) !== false)
{
$spam=true;
$grund=$spamwort;
break;
}
}
if(!$spam)
{
sendMessage($nachricht);
}
else
{
echo 'SPAM!';
sendWarningMessage($nachricht,$grund);
}
}
function sendWarningMessage($nachricht,$grund)
{
sendMail('Spam: '.$grund,$nachricht);
echo 'Deine Mail scheint Spam zu sein, weil sie das Wort "'.$grund.'" enthät. Falls dies kein Spam ist, formuliere deinen Text bitte anders (schreibe das Wort z.B. rückwärts).
';
}
function sendMessage($nachricht)
{
sendMail('Kontaktformular',$nachricht);
echo 'Danke für deine Rückmeldung - Nachricht gesendet!
';
}
function writeFile($nachricht)
{
$file = 'nachrichten.txt';
$current = file_get_contents($file);
$current .= $nachricht;
$current .= '#'."\n";
// Write the contents back to the file
file_put_contents($file, $current);
}
function sendMail($betreff,$nachricht)
{
//-->https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html
//not in this case because FROM
//cannot be set by remote
//-->https://www.saotn.org/exploit-phps-mail-get-remote-code-execution/#Remote_Code_Execution
//no parameters set
$empfaenger = 'admin@trafficpixel.tk';
//$betreff = 'Kontaktformular';
$nachricht = wordwrap($nachricht, 70);
$header = 'From: noreply@trafficpixel.tk' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($empfaenger, $betreff, $nachricht, $header);
}
?>
Sourcecode is here