Skip to content
Snippets Groups Projects
Commit 7aaaadf3 authored by Marvin Weiler's avatar Marvin Weiler
Browse files

Merge branch 'jonathan_f-main-patch-96490' into 'main'

[Essays challenge] Add 2nd approach using curl

See merge request !1
parents 9d7c7cf3 210667af
No related branches found
No related tags found
1 merge request!1[Essays challenge] Add 2nd approach using curl
Pipeline #142635 passed
...@@ -71,7 +71,7 @@ It's not that hard ...@@ -71,7 +71,7 @@ It's not that hard
On file has someting diffent One file has someting diffent
... ...
...@@ -138,3 +138,11 @@ The final command is: ...@@ -138,3 +138,11 @@ The final command is:
# sudo apt install python3-pip # sudo apt install python3-pip
# ... # ...
``` ```
Another possible approach is to read the environment variable from the place it was written to in `config.py`.
The config file starts a Flask app, which is a Python web framework. So `/66041164-0c4e-4f23-8ef1-7b6856c5e32d` is probably a path in a web app that is running on this system. To access this web app, we now just need to request it by its URL. For the hostname, we can just use localhost or 127.0.0.1 (both point directly to the system the request is sent from).
To send a request, we can now use curl (inside the SSH session): `curl http://localhost/66041164-0c4e-4f23-8ef1-7b6856c5e32d`
The response of the running Flask server contains the flag:
```html
<p>fl4g{b3_c4r3ful_w1th_suid_bit}</p>
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment