Narzędzia użytkownika

Narzędzia witryny


narzedzia:dnat_auth

Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Nowa wersja
Poprzednia wersja
narzedzia:dnat_auth [2025/05/07 14:13] – created administratornarzedzia:dnat_auth [2025/05/16 18:47] (aktualna) administrator
Linia 1: Linia 1:
 +==== PY: Skrypt NAT port knocking z uwierzytelnieniem ====
 +
 === template login.html === === template login.html ===
  
-<code html>+<code html login.html> 
 +<!DOCTYPE html> 
 +<html lang="en"> 
 +<head> 
 +    <meta charset="UTF-8"> 
 +    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
 +    <title>Login</title> 
 +    <style> 
 +        body { 
 +            font-family: Arial, sans-serif; 
 +            background-color: #f5f5f5; 
 +            margin: 0; 
 +            padding: 0; 
 +            display: flex; 
 +            justify-content: center; 
 +            align-items: center; 
 +            height: 100vh; 
 +        } 
 +        .container { 
 +            background-color: #fff; 
 +            padding: 20px; 
 +            border-radius: 8px; 
 +            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
 +            text-align: center; 
 +        } 
 +        h2 { 
 +            margin-bottom: 20px; 
 +        } 
 +        .logo { 
 +            max-width: 100px; 
 +            margin-bottom: 20px; 
 +        } 
 +        form { 
 +            display: flex; 
 +            flex-direction: column; 
 +            align-items: center; 
 +        } 
 +        label { 
 +            margin-bottom: 5px; 
 +        } 
 +        input[type="text"], 
 +        input[type="password"] { 
 +            width: 100%; 
 +            padding: 10px; 
 +            margin-bottom: 10px; 
 +            border: 1px solid #ccc; 
 +            border-radius: 5px; 
 +            box-sizing: border-box; 
 +        } 
 +        input[type="submit"] { 
 +            width: 100%; 
 +            padding: 10px; 
 +            background-color: #007bff; 
 +            color: #fff; 
 +            border: none; 
 +            border-radius: 5px; 
 +            cursor: pointer; 
 +            transition: background-color 0.3s ease; 
 +        } 
 +        input[type="submit"]:hover { 
 +            background-color: #0056b3; 
 +        } 
 +        .error { 
 +            color: red; 
 +            margin-top: 10px; 
 +        } 
 +    </style> 
 +</head> 
 +<body> 
 +    <div class="container"> 
 +        <h2>Login</h2> 
 +        {% if error %} 
 +        <p class="error">{{ error }}</p> 
 +        {% endif %} 
 +        <form action="/" method="post"> 
 +            <label for="username">Username:</label> 
 +            <input type="text" id="username" name="username"> 
 +            <label for="password">Password:</label> 
 +            <input type="password" id="password" name="password"> 
 +            <input type="submit" value="Login"> 
 +        </form> 
 +    </div> 
 +</body> 
 +</html>
  
-<code/>+</code>
  
 === Kod samego programu === === Kod samego programu ===
  
-<code python>+<code python auth.py>
 from flask import Flask, request, render_template from flask import Flask, request, render_template
 import paramiko import paramiko
Linia 71: Linia 156:
     app.run(debug=False)     app.run(debug=False)
  
-<code/>+</code>
narzedzia/dnat_auth.1746620024.txt.gz · ostatnio zmienione: 2025/05/07 14:13 przez administrator