-
-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from VanTekken/master
Dockerized Included Vulnerable Web Application
- Loading branch information
Showing
17 changed files
with
266 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: "3.8" | ||
services: | ||
apache: | ||
container_name: apache | ||
build: ./docker/apache | ||
links: | ||
- php | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./src:/usr/local/apache2/htdocs | ||
php: | ||
container_name: php | ||
build: ./docker/php | ||
ports: | ||
- "9000:9000" | ||
volumes: | ||
- ./src:/usr/local/apache2/htdocs | ||
working_dir: /usr/local/apache2/htdocs | ||
mongo: | ||
container_name: mongo | ||
environment: | ||
MONGO_INITDB_ROOT_USERNAME: root | ||
MONGO_INITDB_ROOT_PASSWORD: prisma | ||
build: ./docker/mongo | ||
ports: | ||
- "27017:27017" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM httpd:2.4.51 | ||
|
||
COPY apache.conf /usr/local/apache2/conf/apache.conf | ||
|
||
RUN echo "Include /usr/local/apache2/conf/apache.conf" \ | ||
>> /usr/local/apache2/conf/httpd.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so | ||
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so | ||
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so | ||
|
||
<VirtualHost *:80> | ||
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/usr/local/apache2/htdocs/$1 | ||
|
||
DocumentRoot /usr/local/apache2/htdocs | ||
|
||
<Directory /usr/local/apache2/htdocs> | ||
Options -Indexes +FollowSymLinks | ||
DirectoryIndex index.php | ||
AllowOverride All | ||
Require all granted | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM mongo:latest | ||
|
||
ADD ./mongo.nosql /tmp/mongo.nosql | ||
ADD ./import.sh /tmp/import.sh | ||
RUN chmod +x /tmp/import.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
cat /tmp/mongo.nosql | mongosh "mongodb://root:prisma@mongo:27017" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM php:8.1-fpm | ||
|
||
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" | ||
RUN echo "extension=mongodb.so" >> "$PHP_INI_DIR/php.ini" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev \ | ||
&& apt-get install -y git zip unzip \ | ||
&& pecl install mongodb \ | ||
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ | ||
&& rm composer-setup.php \ | ||
&& composer require mongodb/mongodb |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<html> | ||
|
||
<head> | ||
<title>Payment information</title> | ||
</head> | ||
|
||
<body> | ||
<?php | ||
try { | ||
$conn = new MongoDB\Driver\Manager('mongodb://root:prisma@mongo:27017'); | ||
|
||
$options = [ | ||
'projection' => [], | ||
]; | ||
$filter = ['id' => $_GET['acctid']]; | ||
$query = new MongoDB\Driver\Query($filter, $options); | ||
|
||
$cursor = $conn->executeQuery('customers.paymentinfo', $query); | ||
$counter = 0; | ||
|
||
foreach ($cursor as $obj) { | ||
$counter++; | ||
echo 'Name: ' . $obj->name . '<br/>'; | ||
echo 'Customer ID: ' . $obj->id . '<br/>'; | ||
echo 'Card Number: ' . $obj->cc . '<br/>'; | ||
echo 'CVV2 Code: ' . $obj->cvv2 . '<br/>'; | ||
echo '<br/>'; | ||
} | ||
|
||
echo $counter . ' document(s) found. <br/>'; | ||
|
||
} catch (MongoConnectionException $e) { | ||
die('Error connecting to MongoDB server : ' . $e->getMessage()); | ||
} catch (MongoException $e) { | ||
die('Error: ' . $e->getMessage()); | ||
} | ||
?> | ||
|
||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<html> | ||
<head> | ||
<title>Customer Info</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Customer Information</h1> | ||
<h3>Enter your customer ID to show your account information:</h3> | ||
|
||
<form method="get" action="acct.php"> | ||
Customer ID: | ||
<input type="text" name="acctid" value="" /> | ||
<br /> | ||
<input type="submit" /> | ||
</form> | ||
</body> | ||
</html> |
Oops, something went wrong.