Skip to content

Commit

Permalink
Added test files for the backup module
Browse files Browse the repository at this point in the history
  • Loading branch information
RMI78 authored and bretfourbe committed Aug 4, 2023
1 parent 44c0ada commit 7297dc9
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/integration/docker-compose.setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ services:
networks:
- test-network

# Apache server for the backup module
backup:
<<: [ *default_php_setup, *healthcheck_web ]
volumes:
- ./test_mod_backup/html/:/var/www/html/

# Apache container for the crlf module
crlf:
Expand Down Expand Up @@ -460,6 +465,8 @@ services:
condition: service_healthy
wordpress:
condition: service_healthy
backup:
condition: service_healthy

volumes:
drupal9_db_data:
Expand Down
1 change: 1 addition & 0 deletions tests/integration/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# List of modules to be tested
TESTS="test_crawler_auth \
test_crawler_redirect \
test_mod_backup \
test_mod_brute_login_form \
test_mod_buster \
test_mod_cookieflags \
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/test_mod_backup/assertions/backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"vulnerabilities": {
"Backup file": [
{
"method": "GET",
"path": "/backup.zip",
"info": "Backup file http://backup/backup.zip found for http://backup/",
"http_request": "GET /backup.zip HTTP/1.1\nhost: backup\nconnection: keep-alive\nuser-agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0\naccept-language: en-US\naccept-encoding: gzip, deflate, br\naccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"wstg": [
"WSTG-CONF-04"
]
}
]
}
}
1 change: 1 addition & 0 deletions tests/integration/test_mod_backup/assertions/check.sh
Binary file added tests/integration/test_mod_backup/html/backup.zip
Binary file not shown.
23 changes: 23 additions & 0 deletions tests/integration/test_mod_backup/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Backup</title>

</head>

<body>



<p>Here you can find a backup file supposed to be in the same directory</p>



</body>

</html>
24 changes: 24 additions & 0 deletions tests/integration/wapiti/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -974,5 +974,29 @@
"erase_global_supplementary": false
}
]
},
"test_mod_backup": {
"modules": "backup",
"supplementary_argument": "",
"report_filter_tree": {
"vulnerabilities": {
"Backup file": [
{
"method": "",
"path": "",
"info": "",
"http_request": "",
"wstg": []
}
]
}
},
"targets": [
{
"name": "http://backup",
"supplementary_argument": "",
"erase_global_supplementary": false
}
]
}
}

0 comments on commit 7297dc9

Please sign in to comment.