Schwachstellenseite unter Debian einrichten: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 72: | Zeile 72: | ||
<head><title>VulnSite</title></head> | <head><title>VulnSite</title></head> | ||
<body> | <body> | ||
| − | <h1> | + | <h1>Schwachstellen Demos</h1> |
| − | <h2> | + | <h2>Gebe den FQDN ein ich zeige dir die IP</h2> |
<form action="cmd.php" method="GET"> | <form action="cmd.php" method="GET"> | ||
<input name="cmd" placeholder="whoami"><input type="submit"> | <input name="cmd" placeholder="whoami"><input type="submit"> | ||
</form> | </form> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
</html> | </html> | ||
</pre> | </pre> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ||
| + | =Die Dateien= | ||
| + | ;cmd.php | ||
<pre> | <pre> | ||
<?php | <?php | ||
if (isset($_GET['cmd'])) { | if (isset($_GET['cmd'])) { | ||
| − | + | $input = $_GET['cmd']; | |
| − | + | echo "<pre>"; | |
| − | + | system("host " . $input); | |
| − | + | echo "</pre>"; | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | echo " | ||
| − | |||
| − | < | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | echo " | ||
} | } | ||
?> | ?> | ||
</pre> | </pre> | ||
| − | + | ||
| − | + | ~ | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Version vom 12. Mai 2025, 19:51 Uhr
Apache vorbereiten
- Apache und PHP installieren:
apt update apt install -y apache2 php libapache2-mod-php
- PHP aktivieren und Apache starten:
systemctl enable apache2 systemctl start apache2
- Verzeichnis für Testseite anlegen:
mkdir -p /var/www/html/ cd /var/www/html/
MariaDB vorbereiten
- MariaDB und PHP-MySQL-Modul installieren:
apt install -y mariadb-server php-mysql
- MariaDB starten und beim Boot aktivieren:
systemctl enable mariadb systemctl start mariadb
Datenbank „tuxmen“ vorbereiten
- Als root anmelden:
mysql -u root
- Datenbank anlegen:
CREATE DATABASE tuxmen; USE tuxmen;
Tabelle „mitarbeiter“ erstellen
- Tabelle erzeugen:
CREATE TABLE mitarbeiter ( id INT PRIMARY KEY AUTO_INCREMENT, username VARCHAR(50), password VARCHAR(50), fullname VARCHAR(100), email VARCHAR(100), notes TEXT );
Beispieldaten einfügen
- Testdaten hinzufügen:
INSERT INTO mitarbeiter (username, password, fullname, email, notes) VALUES
('admin', 'admin123', 'Karl Rootmann', 'admin@tuxmen.local', 'Zugang zu allen Systemen'),
('alice', 'alicepw', 'Alice Liddell', 'alice@tuxmen.local', 'Team Marketing, Urlaub bis 22. Mai'),
('bob', 'bobpw', 'Bob Baumeister', 'bob@tuxmen.local', 'Serverraum: Türcode 1234'),
('charlie', 'charliepw','Charlie Foxtrot', 'charlie@tuxmen.local','Entwicklungstools: VSCode, Docker'),
('dora', 'dorapw', 'Dora Explorer', 'dora@tuxmen.local', 'VPN-Probleme gemeldet'),
('eve', 'evepw', 'Evelyn Mallory', 'eve@tuxmen.local', 'Audit-Team, Zugang GVM'),
('frank', 'frankpw', 'Frank Underroot', 'frank@tuxmen.local', 'Sudo-Zugang beantragt'),
('grace', 'gracepw', 'Grace Hopper', 'grace@tuxmen.local', 'Legacy-Projekt „COBOL Revival“'),
('hans', 'hanspw', 'Hans Hacker', 'hans@tuxmen.local', 'Kali-Linux Testumgebung'),
('irene', 'irenepw', 'Irene Adler', 'irene@tuxmen.local', 'Zuständig für LDAP und Mailserver');
- Sitzung beenden:
EXIT
Umsetzung
- index.html erstellen:
nano index.html
- Inhalt einfügen:
<!DOCTYPE html>
<html>
<head><title>VulnSite</title></head>
<body>
<h1>Schwachstellen Demos</h1>
<h2>Gebe den FQDN ein ich zeige dir die IP</h2>
<form action="cmd.php" method="GET">
<input name="cmd" placeholder="whoami"><input type="submit">
</form>
</html>
Die Dateien
- cmd.php
<?php
if (isset($_GET['cmd'])) {
$input = $_GET['cmd'];
echo "<pre>";
system("host " . $input);
echo "";
} ?>
~