forked from WebGoat/WebGoat
-
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.
- Loading branch information
Showing
11 changed files
with
52 additions
and
63 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
25 changes: 12 additions & 13 deletions
25
...ssons/path-traversal/src/main/resources/lessonPlans/en/PathTraversal_intro.adoc
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 |
---|---|---|
@@ -1,24 +1,23 @@ | ||
=== Path traversal | ||
|
||
A path(directory) traversal is a vulnerability where an attacker is able to access or store files and directories outside | ||
the location where the application is running. This may lead to reading files from other directories and in case of a file | ||
upload overwriting critical system files. | ||
A path(directory) traversal is a vulnerability where an attacker can access or store files and directories outside | ||
the application's location. It may lead to reading files from other directories and overwriting critical system files in case of a file | ||
upload. | ||
|
||
=== How does it work? | ||
|
||
For example let's assume we have an application which hosts some files and they can be requested in the following | ||
format: `http://example.com/file=report.pdf` now as an attacker you are interested in other files of course so | ||
you try `http://example.com/file=../../../../../etc/passwd`. In this case you try walk up to the root of the filesystem | ||
and then go into `/etc/passwd` to gain access to this file. The `../` is called dot-dot-slash which is another name | ||
For example, let's assume we have an application that hosts some files, in the following | ||
format: `http://example.com/file=report.pdf` now as an attacker, you are interested in other files, of course, so | ||
you try `http://example.com/file=../../../../../etc/passwd.` In this case, you try walking up to the root of the filesystem | ||
and then go into `/etc/passwd` to gain access to this file. The `../` is called dot-dot-slash, another name | ||
for this attack. | ||
|
||
Of course this is a very simple example and in most cases this will not work as frameworks implemented controls for | ||
this, so we need to get a little more creative and start encoding `../` before the request is sent to the server. | ||
For example if we URL encode `../` you will get `%2e%2e%2f` and the web server receiving this request will decode | ||
Of course, this is a straightforward example, and in most cases, this will not work as frameworks implemented controls. So we need to get a little more creative and start encoding `../` before the request is sent to the server. | ||
For example, if we URL encode `../`, you will get `%2e%2e%2f`, and the webserver receiving this request will decode | ||
it again to `../`. | ||
|
||
Also note that avoiding applications filtering those encodings double encoding might work as well. Double encoding | ||
might be necessary in the case where you have a system A which calls system B. System A will only decode once and | ||
will call B with the still encoded URL. | ||
Also, note that avoiding applications filtering those encodings double encoding might work as well. Double encoding | ||
might be necessary when you have a system A which calls system B. System A will only decode once and | ||
call B with the still encoded URL. | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
...s/path-traversal/src/main/resources/lessonPlans/en/PathTraversal_retrieval.adoc
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
=== Retrieving other files with a path traversal | ||
|
||
Path traversals are not limited to file uploads also when retrieving files it can be the case that a path traversal | ||
is possible to retrieve other files from the system. In this assignment try to find a file called `path-traversal-secret.jpg` | ||
Path traversals are not limited to file uploads; when retrieving files, it can be the case that a path traversal | ||
is possible to retrieve other files from the system. In this assignment, try to find a file called `path-traversal-secret.jpg` | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
...sons/path-traversal/src/main/resources/lessonPlans/en/PathTraversal_upload.adoc
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
4 changes: 2 additions & 2 deletions
4
.../path-traversal/src/main/resources/lessonPlans/en/PathTraversal_upload_fix.adoc
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
4 changes: 2 additions & 2 deletions
4
...ath-traversal/src/main/resources/lessonPlans/en/PathTraversal_upload_fixed.adoc
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
4 changes: 2 additions & 2 deletions
4
...l/src/main/resources/lessonPlans/en/PathTraversal_upload_remove_user_input.adoc
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
2 changes: 1 addition & 1 deletion
2
...versal/src/main/resources/lessonPlans/en/PathTraversal_zip_slip_assignment.adoc
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