Juice Shop: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| (12 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
| Zeile 3: | Zeile 3: | ||
= Installation = | = Installation = | ||
| − | * | + | * die Anwendung lässt sich über [[Docker]] installieren |
* '''apt install docker.io''' | * '''apt install docker.io''' | ||
* '''docker pull bkimminich/juice-shop''' | * '''docker pull bkimminich/juice-shop''' | ||
| Zeile 21: | Zeile 21: | ||
</pre> | </pre> | ||
*docker compose up -d | *docker compose up -d | ||
| + | |||
| + | ==node pm2== | ||
| + | <pre> | ||
| + | xinux@juiceshop:~$ git clone https://github.com/juice-shop/juice-shop.git --depth 1 | ||
| + | Cloning into 'juice-shop'... | ||
| + | remote: Enumerating objects: 1256, done. | ||
| + | remote: Counting objects: 100% (1256/1256), done. | ||
| + | remote: Compressing objects: 100% (1007/1007), done. | ||
| + | remote: Total 1256 (delta 333), reused 567 (delta 230), pack-reused 0 (from 0) | ||
| + | Receiving objects: 100% (1256/1256), 45.77 MiB | 37.49 MiB/s, done. | ||
| + | Resolving deltas: 100% (333/333), done. | ||
| + | |||
| + | xinux@juiceshop:~$ cd juice-shop/ | ||
| + | xinux@juiceshop:~/juice-shop$ npm install | ||
| + | |||
| + | xinux@juiceshop:~/juice-shop$ pm2 start npm --name "juiceshop" -- start | ||
| + | [PM2] Starting /usr/bin/npm in fork_mode (1 instance) | ||
| + | [PM2] Done. | ||
| + | ┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ | ||
| + | │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ | ||
| + | ├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ | ||
| + | │ 0 │ juiceshop │ default │ N/A │ fork │ 88256 │ 0s │ 0 │ online │ 0% │ 30.6mb │ xinux │ disabled │ | ||
| + | └────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ | ||
| + | xinux@juiceshop:~/juice-shop$ pm2 startup | ||
| + | [PM2] Init System found: systemd | ||
| + | [PM2] To setup the Startup Script, copy/paste the following command: | ||
| + | sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u xinux --hp /home/xinux | ||
| + | xinux@juiceshop:~/juice-shop$ pm2 save | ||
| + | [PM2] Saving current process list... | ||
| + | [PM2] Successfully saved in /home/xinux/.pm2/dump.pm2 | ||
| + | xinux@juiceshop:~/juice-shop$ pm2 list | ||
| + | ┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ | ||
| + | │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ | ||
| + | ├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ | ||
| + | │ 0 │ juiceshop │ default │ N/A │ fork │ 88256 │ 48s │ 0 │ online │ 0% │ 64.2mb │ xinux │ disabled │ | ||
| + | └────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ | ||
| + | xinux@juiceshop:~/juice-shop$ sudo ss -tlpn | ||
| + | State Recv-Q Send-Q Local Address:Port Peer Address:Port Process | ||
| + | LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=40865,fd=13)) | ||
| + | LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=710,fd=3)) | ||
| + | LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=710,fd=4)) | ||
| + | LISTEN 0 511 *:3000 *:* users:(("node",pid=88272,fd=19)) | ||
| + | |||
| + | </pre> | ||
| + | |||
= Juice Shop Challenges = | = Juice Shop Challenges = | ||
| − | == Score Board Challenge == | + | == Score Board / Admin Seite Challenge == |
; Finden Sie das versteckte Score Board | ; Finden Sie das versteckte Score Board | ||
| + | |||
| + | <!-- * Netzwerkanalyse Tool im Browser öffnen (<F12>) und auf ''Sources'' gehen --> | ||
| + | <!-- * Die '''main.js''' Datei herunterladen... --> | ||
| + | |||
| + | <!-- [[Bild:juice-shop-01.png]] --> | ||
| + | |||
| + | <!-- * ... und formatieren, falls alles in einer Zeile steht --> | ||
| + | <!-- * https://duckduckgo.com/?q=javascript+prettify --> | ||
| + | <!-- * danach im JavaScript Code nach ''path: '' suchen (Anwendungsspezifisch, für andere Webapplikationen muss man mehr Code-Analyse durchführen) --> | ||
| + | <!-- * '''grep "path: " main.js''' --> | ||
| + | |||
| + | <!-- ... --> | ||
| + | <!-- path: "administration", --> | ||
| + | <!-- ... --> | ||
| + | <!-- path: "score-board", --> | ||
| + | <!-- ... --> | ||
<!-- * URL: http://10.0.10.104:83/#/score-board --> | <!-- * URL: http://10.0.10.104:83/#/score-board --> | ||
| + | <!-- * URL: http://10.0.10.104:83/#/administration --> | ||
== Admin Challenge == | == Admin Challenge == | ||
| Zeile 82: | Zeile 144: | ||
; Geben Sie mithilfe von Burp ein 0 Sterne Feedback | ; Geben Sie mithilfe von Burp ein 0 Sterne Feedback | ||
| − | * Im Burp-Browser folgende URL öffnen: http://juice-shop.hack.lab/#/contact | + | <!-- * Im Burp-Browser folgende URL öffnen: http://juice-shop.hack.lab/#/contact --> |
| − | * Die nötigen Felder ausfüllen, um ein Feedback senden zu können (Sternezahl ist erstmal egal) | + | <!-- * Die nötigen Felder ausfüllen, um ein Feedback senden zu können (Sternezahl ist erstmal egal) --> |
| − | * Intercept in Burp anschalten und Requests forwarden bis folgendes kommt: | + | <!-- * Intercept in Burp anschalten und Requests forwarden bis folgendes kommt: --> |
| + | |||
| + | <!-- POST /api/Feedbacks/ HTTP/1.1 --> | ||
| + | <!-- Host: juice-shop.hack.lab --> | ||
| + | <!-- Content-Length: 92 --> | ||
| + | <!-- Accept: application/json, text/plain, */* --> | ||
| + | <!-- Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YSI6eyJpZCI6MSwidXNlcm5hbWUiOiJsMzM3IGg0eDByIiwiZW1haWwiOiJhZG1pbkBqdWljZS1zaC5vcCIsInBhc3N3b3JkIjoiMDE5MjAyM2E3YmJkNzMyNTA1MTZmMDY5ZGYxOGI1MDAiLCJyb2xlIjoiYWRtaW4iLCJkZWx1eGVUb2tlbiI6IiIsImxhc3RMb2dpbklwIjoidW5kZWZpbmVkIiwicHJvZmlsZUltYWdlIjoiYXNzZXRzL3B1YmxpYy9pbWFnZXMvdXBsb2Fkcy9kZWZhdWx0QWRtaW4ucG5nIiwidG90cFNlY3JldCI6IiIsImlzQWN0aXZlIjp0cnVlLCJjcmVhdGVkQXQiOiIyMDIzLTA4LTI4VDA2OjA2OjI5Ljc0OVoiLCJ1cGRhdGVkQXQiOiIyMDIzLTA4LTI4VDA4OjE4OjU5LjgyM1oiLCJkZWxldGVkQXQiOm51bGx9LCJpYXQiOjE2OTMyMTA3NDB9.RwXgFZG8-scQct21Te_jxtWqoK8KuJbEYbB8sqRyS6nqTmUyyFYseiQv6w0lMkcXxUHUrwaS0CNV6-6hRlNif_RVE_1Q6beCmbV1gtxIvVHOULYf-osxsFcUIUTx7f1uYEFEQkTgIT-tEVSfc1sJQgLRnLQ9g6x62G6uywsjyzI --> | ||
| + | <!-- User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 --> | ||
| + | <!-- Content-Type: application/json --> | ||
| + | <!-- Origin: http://juice-shop.hack.lab --> | ||
| + | <!-- Referer: http://juice-shop.hack.lab/ --> | ||
| + | <!-- Accept-Encoding: gzip, deflate --> | ||
| + | <!-- Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7 --> | ||
| + | <!-- Cookie: language=en; welcomebanner_status=dismiss; cookieconsent_status=dismiss; continueCode=zalQxx2XYZeNzDa1PmQn5owrjKEdKEfje06JB9ypOvL4bRVk7ql8gWM39R6m; token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YSI6eyJpZCI6MSwidXNlcm5hbWUiOiJsMzM3IGg0eDByIiwiZW1haWwiOiJhZG1pbkBqdWljZS1zaC5vcCIsInBhc3N3b3JkIjoiMDE5MjAyM2E3YmJkNzMyNTA1MTZmMDY5ZGYxOGI1MDAiLCJyb2xlIjoiYWRtaW4iLCJkZWx1eGVUb2tlbiI6IiIsImxhc3RMb2dpbklwIjoidW5kZWZpbmVkIiwicHJvZmlsZUltYWdlIjoiYXNzZXRzL3B1YmxpYy9pbWFnZXMvdXBsb2Fkcy9kZWZhdWx0QWRtaW4ucG5nIiwidG90cFNlY3JldCI6IiIsImlzQWN0aXZlIjp0cnVlLCJjcmVhdGVkQXQiOiIyMDIzLTA4LTI4VDA2OjA2OjI5Ljc0OVoiLCJ1cGRhdGVkQXQiOiIyMDIzLTA4LTI4VDA4OjE4OjU5LjgyM1oiLCJkZWxldGVkQXQiOm51bGx9LCJpYXQiOjE2OTMyMTA3NDB9.RwXgFZG8-scQct21Te_jxtWqoK8KuJbEYbB8sqRyS6nqTmUyyFYseiQv6w0lMkcXxUHUrwaS0CNV6-6hRlNif_RVE_1Q6beCmbV1gtxIvVHOULYf-osxsFcUIUTx7f1uYEFEQkTgIT-tEVSfc1sJQgLRnLQ9g6x62G6uywsjyzI --> | ||
| + | <!-- Connection: close --> | ||
| + | <!-- --> | ||
| + | <!-- '''{"UserId":1,"captchaId":0,"captcha":"68","comment":"0 Stars (***in@juice-sh.op)","rating":''0''}''' --> | ||
| + | |||
| + | <!-- * Diesen Request abändern, sodass ''0'' bei ''"rating"'' steht und forwarden --> | ||
| + | <!-- * Das Feedback kann man hier in der Diashow sehen: http://juice-shop.hack.lab/#/about --> | ||
| − | + | == Geheimes Dokument ansehen == | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | * | + | ; Finden die geheime ''acquisitions.md''-Datei |
| − | * | + | * Tipp: Ein Ordner wird nicht richtig mit Zugriffskontrollen geschützt. Suchen Sie diesen über die auf der Webseite verfügbaren Links |
| + | <!-- * Über die ''About Us''-Seite findet man einen Link zur ''legal.md''-Datei --> | ||
| + | <!-- * Diese liegt unter dem ''ftp''-Ordner, der öffentlich zugänglich ist --> | ||
| + | <!-- * Wenn man nur den Ordnerpfad aufruft, sieht man die Datei, welche die Challenge löst --> | ||
| + | |||
| + | == Fortschritt zurücksetzen == | ||
| + | <pre> | ||
| + | Cookies im Browser löschen | ||
| + | |||
| + | xinux@juiceshop:~/juice-shop$ pm2 restart juiceshop | ||
| + | Use --update-env to update environment variables | ||
| + | [PM2] Applying action restartProcessId on app [juiceshop](ids: [ 0 ]) | ||
| + | [PM2] [juiceshop](0) ✓ | ||
| + | ┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ | ||
| + | │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ | ||
| + | ├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ | ||
| + | │ 0 │ juiceshop │ default │ N/A │ fork │ 88426 │ 0s │ 2 │ online │ 0% │ 20.6mb │ xinux │ disabled │ | ||
| + | └────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ | ||
| + | </pre> | ||
=Links= | =Links= | ||
*https://epub.jku.at/obvulihs/download/pdf/7639791?originalFilename=true | *https://epub.jku.at/obvulihs/download/pdf/7639791?originalFilename=true | ||
*https://www.youtube.com/watch?v=AIUhCdOMrmc | *https://www.youtube.com/watch?v=AIUhCdOMrmc | ||
Aktuelle Version vom 6. Mai 2025, 13:39 Uhr
- Der Juice Shop (dt. Saftladen) von OWASP ist eine Webapplikation, die speziell dazu gebaut wurde, um das Hacking von Web Schwachstellen zu lernen
- Es enthält ein Scoreboard, um die gelösten Challenges zu tracken und weitere potentielle Schwachstellen aufzulisten
Installation
- die Anwendung lässt sich über Docker installieren
- apt install docker.io
- docker pull bkimminich/juice-shop
- docker run -d -p 0.0.0.0:80:3000 bkimminich/juice-shop
- Nun sollte die Webseite über http://localhost erreichbar sein
- oder
docker-compose.yml
services:
foo:
privileged: true
image: bkimminich/juice-shop
restart: always
ports:
- 83:3000
- docker compose up -d
node pm2
xinux@juiceshop:~$ git clone https://github.com/juice-shop/juice-shop.git --depth 1
Cloning into 'juice-shop'...
remote: Enumerating objects: 1256, done.
remote: Counting objects: 100% (1256/1256), done.
remote: Compressing objects: 100% (1007/1007), done.
remote: Total 1256 (delta 333), reused 567 (delta 230), pack-reused 0 (from 0)
Receiving objects: 100% (1256/1256), 45.77 MiB | 37.49 MiB/s, done.
Resolving deltas: 100% (333/333), done.
xinux@juiceshop:~$ cd juice-shop/
xinux@juiceshop:~/juice-shop$ npm install
xinux@juiceshop:~/juice-shop$ pm2 start npm --name "juiceshop" -- start
[PM2] Starting /usr/bin/npm in fork_mode (1 instance)
[PM2] Done.
┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ juiceshop │ default │ N/A │ fork │ 88256 │ 0s │ 0 │ online │ 0% │ 30.6mb │ xinux │ disabled │
└────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
xinux@juiceshop:~/juice-shop$ pm2 startup
[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u xinux --hp /home/xinux
xinux@juiceshop:~/juice-shop$ pm2 save
[PM2] Saving current process list...
[PM2] Successfully saved in /home/xinux/.pm2/dump.pm2
xinux@juiceshop:~/juice-shop$ pm2 list
┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ juiceshop │ default │ N/A │ fork │ 88256 │ 48s │ 0 │ online │ 0% │ 64.2mb │ xinux │ disabled │
└────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
xinux@juiceshop:~/juice-shop$ sudo ss -tlpn
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=40865,fd=13))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=710,fd=3))
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=710,fd=4))
LISTEN 0 511 *:3000 *:* users:(("node",pid=88272,fd=19))
Juice Shop Challenges
Score Board / Admin Seite Challenge
- Finden Sie das versteckte Score Board
Admin Challenge
- Loggen Sie sich als Administrator an
Cross Site Scripting
- Erzeugen Sie einen Link, der dem Opfer warnt, dass er gehackt wurde
Brute Force Coupon
- Nerven Sie den Chatbot solange bis er einen Coupon rausrückt
0 Sterne Feedback
- Geben Sie mithilfe von Burp ein 0 Sterne Feedback
Geheimes Dokument ansehen
- Finden die geheime acquisitions.md-Datei
- Tipp: Ein Ordner wird nicht richtig mit Zugriffskontrollen geschützt. Suchen Sie diesen über die auf der Webseite verfügbaren Links
Fortschritt zurücksetzen
Cookies im Browser löschen xinux@juiceshop:~/juice-shop$ pm2 restart juiceshop Use --update-env to update environment variables [PM2] Applying action restartProcessId on app [juiceshop](ids: [ 0 ]) [PM2] [juiceshop](0) ✓ ┌────┬──────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ ├────┼──────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ │ 0 │ juiceshop │ default │ N/A │ fork │ 88426 │ 0s │ 2 │ online │ 0% │ 20.6mb │ xinux │ disabled │ └────┴──────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘