215 lines
7.7 KiB
PHP
215 lines
7.7 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>E-Mail Analyse</title>
|
|
<style>
|
|
/* CSS aus der Mehrwertsteuerrechner-Datei */
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background-color: #fff; /* Weißer Hintergrund */
|
|
color: #333;
|
|
line-height: 1.6;
|
|
margin: 0;
|
|
padding: 20px;
|
|
}
|
|
.container {
|
|
max-width: 900px; /* Angepasst für E-Mail-Analyse */
|
|
margin: 30px auto;
|
|
background: #fff;
|
|
padding: 30px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
border: 1px solid #a81212; /* Akzentfarbe für den Rand */
|
|
}
|
|
h1, h2, h3 {
|
|
text-align: center;
|
|
color: #a81212; /* Akzentfarbe für Überschrift */
|
|
margin-bottom: 30px;
|
|
border-bottom: 1px solid #eee; /* Beibehalten für Struktur */
|
|
padding-bottom: 10px;
|
|
}
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: bold;
|
|
}
|
|
input[type="file"] { /* Angepasst für Dateiupload */
|
|
width: calc(100% - 22px);
|
|
padding: 10px;
|
|
border: 1px solid #a81212;
|
|
border-radius: 4px;
|
|
box-sizing: border-box;
|
|
font-size: 16px;
|
|
display: block; /* Sicherstellen, dass es wie ein Block-Element behandelt wird */
|
|
margin-bottom: 15px; /* Abstand nach unten */
|
|
}
|
|
button[type="submit"] { /* Angepasst von input[type="submit"] */
|
|
background-color: #a81212;
|
|
color: white;
|
|
padding: 12px 20px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
width: 100%;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
button[type="submit"]:hover {
|
|
background-color: #8f0e0e;
|
|
}
|
|
.result-section { /* Container für die Ergebnisse */
|
|
background-color: #ffe5e5;
|
|
border: 1px solid #a81212;
|
|
color: #a81212;
|
|
padding: 15px;
|
|
border-radius: 5px;
|
|
margin-top: 20px;
|
|
font-size: 1.1em;
|
|
text-align: left; /* Textausrichtung angepasst */
|
|
}
|
|
.error {
|
|
background-color: #f8d7da;
|
|
border: 1px solid #f5c6cb;
|
|
color: #721c24;
|
|
padding: 15px;
|
|
border-radius: 5px;
|
|
margin-top: 20px;
|
|
font-size: 1.1em;
|
|
text-align: center;
|
|
}
|
|
.header-section p, .phishing-section p {
|
|
background-color: #f9f9f9; /* Leichterer Hintergrund für Header-Einträge */
|
|
border-left: 5px solid #a81212; /* Akzentfarbe für Header-Balken */
|
|
padding: 10px;
|
|
margin-bottom: 10px;
|
|
word-wrap: break-word;
|
|
color: #333; /* Standardtextfarbe */
|
|
}
|
|
.warning {
|
|
background-color: #fff3cd; /* Gelb für Warnungen */
|
|
color: #856404;
|
|
border-color: #ffeeba;
|
|
font-weight: bold;
|
|
}
|
|
.phishing-tendency {
|
|
padding: 15px;
|
|
margin-bottom: 20px;
|
|
border-radius: 8px;
|
|
font-size: 1.4em;
|
|
font-weight: bold;
|
|
text-align: center;
|
|
color: white;
|
|
text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
|
|
}
|
|
.phishing-tendency.red {
|
|
background-color: #dc3545; /* Rot für Phishing */
|
|
border: 1px solid #c82333;
|
|
}
|
|
.phishing-tendency.green {
|
|
background-color: #28a745; /* Grün für keine Phishing-Tendenz */
|
|
border: 1px solid #218838;
|
|
}
|
|
.full-email-preview {
|
|
background-color: #f0f0f0;
|
|
border: 1px solid #ccc;
|
|
padding: 15px;
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
white-space: pre-wrap;
|
|
word-break: break-all;
|
|
color: #333;
|
|
}
|
|
footer {
|
|
text-align: center;
|
|
margin-top: 40px;
|
|
font-size: 0.9em;
|
|
color: #777;
|
|
}
|
|
footer a {
|
|
color: #a81212;
|
|
text-decoration: none;
|
|
}
|
|
footer a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>E-Mail Analyse-Tool</h1>
|
|
<form action="process_email.php" method="post" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<label for="email_file">Wählen Sie eine E-Mail-Datei zum Hochladen aus (.eml oder .txt):</label>
|
|
<input type="file" id="email_file" name="email_file" accept=".eml,.txt" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit">E-Mail analysieren</button>
|
|
</div>
|
|
</form>
|
|
|
|
<?php
|
|
$errors = []; // Initialisiere $errors am Anfang, um es immer verfügbar zu haben
|
|
|
|
if (isset($_GET['result'])) {
|
|
$result = json_decode(base64_decode($_GET['result']), true);
|
|
|
|
if ($result) {
|
|
echo '<div class="result-section">';
|
|
|
|
// Phishing Tendenz Anzeige ganz oben
|
|
$tendencyClass = $result['is_phishing_tendency'] ? 'red' : 'green';
|
|
$tendencyText = $result['is_phishing_tendency'] ? 'Phishing-Tendenz: HOCH' : 'Phishing-Tendenz: GERING';
|
|
echo '<div class="phishing-tendency ' . $tendencyClass . '">' . $tendencyText . '</div>';
|
|
|
|
echo '<h2>Analyse-Ergebnisse:</h2>';
|
|
|
|
echo '<h3>Phishing-Prüfung (Details):</h3>';
|
|
echo '<div class="phishing-section">';
|
|
if (!empty($result['phishing_check'])) {
|
|
foreach ($result['phishing_check'] as $warning) {
|
|
echo '<p class="warning">' . htmlspecialchars($warning) . '</p>';
|
|
}
|
|
} else {
|
|
echo '<p>Keine offensichtlichen Phishing-Merkmale erkannt (Basierend auf einfacher Prüfung).</p>';
|
|
}
|
|
echo '</div>';
|
|
|
|
|
|
echo '<h3>Header-Daten:</h3>';
|
|
if (!empty($result['headers'])) {
|
|
echo '<div class="header-section">';
|
|
foreach ($result['headers'] as $name => $value) {
|
|
echo '<p><strong>' . htmlspecialchars($name) . ':</strong> ' . nl2br(htmlspecialchars($value)) . '</p>';
|
|
}
|
|
echo '</div>';
|
|
} else {
|
|
echo '<p>Keine Header-Daten gefunden oder Fehler beim Parsen.</p>';
|
|
}
|
|
|
|
|
|
echo '<h3>Vollständige E-Mail (Vorschau):</h3>';
|
|
if (isset($result['full_email_preview'])) {
|
|
echo '<pre class="full-email-preview">' . htmlspecialchars($result['full_email_preview']) . '</pre>';
|
|
} else {
|
|
echo '<p>Vorschau nicht verfügbar.</p>';
|
|
}
|
|
echo '</div>'; // Ende result-section
|
|
|
|
} else {
|
|
echo '<div class="error"><p>Fehler beim Laden der Analyse-Ergebnisse.</p></div>';
|
|
}
|
|
} elseif (isset($_GET['error'])) {
|
|
echo '<div class="error"><p>' . htmlspecialchars($_GET['error']) . '</p></div>';
|
|
}
|
|
?>
|
|
</div>
|
|
<footer>
|
|
© <?php echo date("Y"); ?> <a href="https://wachtel-it.de" target="_blank">Philipp Wachtel</a>
|
|
</footer>
|
|
</body>
|
|
</html>
|