summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-09-03 17:16:38 +0200
committerjerome <jerome@xlinfo.fr>2025-09-03 17:16:38 +0200
commit523245a857990540dc65148c19aec5aa7f120f9c (patch)
tree3a82b346024780dcfeaf5893d14ec1c565b53f12 /www
parentcb1af4fa69b015b8ede43310151b51cc2720f88f (diff)
downloadhttp-523245a857990540dc65148c19aec5aa7f120f9c.tar.gz
http-523245a857990540dc65148c19aec5aa7f120f9c.zip
Dockerfile
Diffstat (limited to 'www')
-rw-r--r--www/index.html52
-rw-r--r--www/login.php40
-rw-r--r--www/page.php31
3 files changed, 123 insertions, 0 deletions
diff --git a/www/index.html b/www/index.html
new file mode 100644
index 0000000..a2d890e
--- /dev/null
+++ b/www/index.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html lang="fr">
+ <head>
+ <meta charset="utf-8">
+ <title>Exemple</title>
+ <style>
+ form {
+ border: solid black 1px;
+ padding: 1em;
+ margin:1em;
+ }
+ #titre {
+ color:blue;
+ }
+ .formulaire {
+ color: #808080;
+ }
+ </style>
+ </head>
+ <body>
+ <h1 id="titre">Système d'exploitation</h1>
+ <div>
+ <strong>Questionnaire</strong>
+ <form id="monform" action="page.php">
+ <p class="formulaire">
+ Votre nom :<input type="text" name="username">
+ </p>
+ <p class="formulaire">
+ Votre OS : <select name="os" maxlength=7>
+ <option label="------"></option>
+ <option>Mac Os</option>
+ <option>Windows</option>
+ </select>
+ </p>
+ <p>
+ <input type="submit" value="Valider">
+ </p>
+ </form>
+ <p><em>
+ <button onclick="changeMethod()">Method POST</button>
+ </em></p>
+ <p id="demo">La méthode est GET.<br>&nbsp;</p>
+ </div>
+ <p><a href="login.php">Login</a>
+<script>
+function changeMethod() {
+ document.getElementById("monform").method = "post";
+ document.getElementById("demo").innerHTML = "La méthode est maintenant POST.<br>Rafraîchissez votre page pour revenir à GET.";
+}
+</script>
+ </body>
+</html>
diff --git a/www/login.php b/www/login.php
new file mode 100644
index 0000000..85fe569
--- /dev/null
+++ b/www/login.php
@@ -0,0 +1,40 @@
+<?php
+if ($_POST['username'] == "stagiaire" && $_POST['password'] == getenv('PASSWD')){
+ $msg="Bien joué, Boloss ! ";
+ if(getenv('FLAG')){
+ $msg .= "Ton flag est ".getenv('FLAG');
+ }
+}
+else {
+ $msg="Erreur, Boloss !";
+}
+?>
+<!DOCTYPE html>
+<html lang="fr">
+
+<head>
+<meta charset="utf-8" />
+<title>Login</title>
+<meta name="generator" content="Geany 1.38" />
+</head>
+
+<body>
+ <h1>Login</h1>
+ <form method="post">
+ <table>
+ <tr>
+ <td>Username :</td><td> <input type="text" name="username"></td>
+ </tr>
+ <tr>
+ <td>Password :</td><td> <input type="password" name="password"></td>
+ </tr>
+ </table>
+ <input type="submit">
+ </form>
+ <br>
+ <p>Ton login est "stagiaire" et ton mot de passe est dans nmap.lst (livré avec le paquet nmap) !
+ <br>Au boulot !</p>
+ <div><strong><?php if (isset($_POST['username'])){ echo $msg; } ?></strong></div>
+</body>
+
+</html>
diff --git a/www/page.php b/www/page.php
new file mode 100644
index 0000000..9d7a384
--- /dev/null
+++ b/www/page.php
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="fr">
+ <head>
+ <meta charset="utf-8" />
+ <title>Le meilleur OS</title>
+ </head>
+ <body>
+ <div>
+<?php
+//if (isset($_REQUEST['password']) && $_REQUEST['password'] == "secret"){
+ if (isset($_REQUEST['username']))
+ {
+ echo "<p>Merci ".$_REQUEST['username']." !</p>";
+ }
+ if (isset($_REQUEST['os']))
+ {
+ echo "<p>Votre OS favori est ".$_REQUEST['os']." !</p>";
+ }
+ if(isset($_COOKIE['date']))
+ {
+ echo "<p>Nous sommes le ".date("Y-m-d H:i:s",$_COOKIE['date'])."</p>";
+ }
+/*}
+else {
+ echo "Mauvais mot de passe";
+}*/
+?>
+ </div>
+<p><a href="javascript:history.back()">Retour</a></p>
+</body>
+</html>