Skip to content

Commit

Permalink
[REFACT] Add all files into new folders
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaveira3 committed Dec 27, 2018
1 parent 5459986 commit c80cd3e
Show file tree
Hide file tree
Showing 2,360 changed files with 521,223 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ These are vulnerable applications! 🔥

## OWASP Top 10 (2017) Apps

- A4 - XML External Entities (XXE) - [ViniJr Blog](a4-xxe-vinijr)
- A5 - Broken Access Control - [Vulnerable Ecommerce API](a5-ecommerce-api)
- A6 - Security Misconfiguration - [Vulnerable Wordpress Misconfig](a6-misconfig-wordpress)
- A8 - Insecure Deserialization - [Amarelo Designs](a8-amarelo-designs)
- A4 - XML External Entities (XXE) - [ViniJr Blog](owasp-top10-2017-apps/a4/vinijr-blog)
- A5 - Broken Access Control - [Vulnerable Ecommerce API](owasp-top10-2017-apps/a5/ecommerce-api)
- A6 - Security Misconfiguration - [Vulnerable Wordpress Misconfig](owasp-top10-2017-apps/a6/misconfig-wordpress)
- A8 - Insecure Deserialization - [Amarelo Designs](owasp-top10-2017-apps/a8/amarelo-designs)

33 changes: 33 additions & 0 deletions owasp-top10-2017-apps/a4/vinijr-blog/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.SILENT:
.DEFAULT_GOAL := help

COLOR_RESET = \033[0m
COLOR_COMMAND = \033[36m
COLOR_YELLOW = \033[33m
COLOR_GREEN = \033[32m
COLOR_RED = \033[31m

PROJECT := A4-XXE-ViniJr

## Installs a development environment
install: deploy

## Composes project using docker-compose
deploy:
docker-compose -f deployments/docker-compose.yml build
docker-compose -f deployments/docker-compose.yml down -v
docker-compose -f deployments/docker-compose.yml up -d --force-recreate

## Prints help message
help:
printf "\n${COLOR_YELLOW}${PROJECT}\n------\n${COLOR_RESET}"
awk '/^[a-zA-Z\-\_0-9\.%]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "${COLOR_COMMAND}$$ make %s${COLOR_RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST) | sort
printf "\n"
40 changes: 40 additions & 0 deletions owasp-top10-2017-apps/a4/vinijr-blog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ViniJR Blog
> This is a simple PHP web application that contains an example of an XML External Entity (XXE) vulnerability.
<img src="images/blog-fe.png" align="center"/>

## What is XXE?

Definition from [OWASP](https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing):

An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.

## Requirements

To build this lab you will need [Docker][Docker Install] and [Docker Compose][Docker Compose Install].

## Deploy and Run

After cloning this repository, you can type the following command to start the vulnerable application:

```sh
make install
```

Then simply visit [localhost:10080][App] !

## Attack Narrative

To understand how this vulnerability can be exploited, check this section!

## Mitigating the vulnerability

To understand how this vulnerability can be mitigated, check this other section!

[Docker Install]: https://docs.docker.com/install/
[Docker Compose Install]: https://docs.docker.com/compose/install/
[App]: http://127.0.0.1:10080

## Contributing

Yes, please. :zap:
12 changes: 12 additions & 0 deletions owasp-top10-2017-apps/a4/vinijr-blog/app/contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
$xmlfile = file_get_contents('php://input');
$dom = new DOMDocument();
$dom->loadXML($xmlfile, LIBXML_NOENT | LIBXML_DTDLOAD);
$contact = simplexml_import_dom($dom);
$name = $contact->name;
$email = $contact->email;
$subject = $contact->subject;
$message = $contact->message;

echo "Thanks for the message, $name !";
?>
Loading

0 comments on commit c80cd3e

Please sign in to comment.