-
Notifications
You must be signed in to change notification settings - Fork 110
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 #133 from PortSwigger/backup-file-template
Add backup file template BCheck
- Loading branch information
Showing
5 changed files
with
36 additions
and
1 deletion.
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
Binary file not shown.
Binary file not shown.
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,31 @@ | ||
metadata: | ||
language: v2-beta | ||
name: "Path-level" | ||
description: "Tests for exposed backup files" | ||
author: "Carlos Montoya" | ||
|
||
run for each: | ||
# you could add more values to this list to make the check repeat | ||
extension = | ||
".bak", | ||
".back", | ||
".backup", | ||
".old" | ||
|
||
given path then | ||
if not ({base.response.status_code} is "404") then | ||
send request called check: | ||
replacing path: {regex_replace ({base.response.url.path}, "(.)/?$", `$1{extension}`)} | ||
|
||
if {check.response.status_code} is {base.response.status_code} then | ||
send request called garbage: | ||
replacing path: {regex_replace ({base.response.url.path}, "(.)/?$", `$1.{random_str(10)}`)} | ||
if {garbage} differs from {check} then | ||
report issue and continue: | ||
severity: info | ||
confidence: firm | ||
detail: `Backup file found at {check.request.url}` | ||
remediation: "Ensure your backup files are not exposed." | ||
end if | ||
end if | ||
end if |