diff --git a/unsafe_gallery/README.md b/unsafe_gallery/README.md index f5cb60c..dc7fb8b 100644 --- a/unsafe_gallery/README.md +++ b/unsafe_gallery/README.md @@ -4,5 +4,5 @@ You need to set the `FLAG` environment variable for this challenge to work! ## Run the image ```bash -docker run --rm --name unsafe_login --env FLAG='FLAG{UNSAFEGALLERY}' -p 3565:80 -it pierre42100/gns3-appliance-unsafe-gallery +docker run --rm --name unsafe_login --env FLAG='FLAG{UNSAFEGALLERY}' -p 3568:80 -it pierre42100/gns3-appliance-unsafe-gallery ``` \ No newline at end of file diff --git a/unsafe_gallery/src/index.php b/unsafe_gallery/src/index.php index 3eb3e71..3d8dc9f 100644 --- a/unsafe_gallery/src/index.php +++ b/unsafe_gallery/src/index.php @@ -10,13 +10,12 @@ if (!isset($_SESSION["id"])) define('UPLOAD_DIR', __DIR__ . "/uploads/" . $_SESSION["id"]); if (isset($_FILES["file"])) { - $dest_file_name = (string)time() ."-". str_replace("/", "", $_FILES["file"]["name"]); + $dest_file_name = (string) time() . "-" . str_replace("/", "", $_FILES["file"]["name"]); // Create target directory - if(!is_dir(UPLOAD_DIR) && !mkdir(UPLOAD_DIR, 0770, true)) { + if (!is_dir(UPLOAD_DIR) && !mkdir(UPLOAD_DIR, 0770, true)) { $error = "Failed to create storage directory!"; - } - else if ($_FILES["file"]["size"] > 10000) { + } else if ($_FILES["file"]["size"] > 10000) { $error = "File is too large!"; } else if (move_uploaded_file($_FILES["file"]["tmp_name"], UPLOAD_DIR . "/" . $dest_file_name)) { $success = "The file was successfully uploaded!"; @@ -76,15 +75,21 @@ if (isset($_FILES["file"])) { -

Your files

-