Create new challenge Docker image
This commit is contained in:
12
countries_list/docker/add_flag.php
Normal file
12
countries_list/docker/add_flag.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
// First, connect to database
|
||||
try {
|
||||
$db = new PDO('sqlite:/var/www/html/database.db');
|
||||
} catch (PDOException $e) {
|
||||
echo 'Connection to database failed: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO secret (flag) VALUES (?)");
|
||||
$stmt->execute(array(getenv("FLAG")));
|
7
countries_list/docker/start.sh
Normal file
7
countries_list/docker/start.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo Add flag to database
|
||||
php /add_flag.php
|
||||
|
||||
echo Run main server
|
||||
docker-php-entrypoint apache2-foreground
|
Reference in New Issue
Block a user