forked from globocom/secDevLabs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACT] Add all files into new folders
- Loading branch information
1 parent
5459986
commit c80cd3e
Showing
2,360 changed files
with
521,223 additions
and
4 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 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,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" |
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,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: |
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,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 !"; | ||
?> |
Oops, something went wrong.