Open NtAlexio2 opened 1 year ago
In this context if you hit the regex by chance or because you got in the general direction but did not yet have a fully developed payload you already get the flag right?
I would suggest not working with regexes as much as possible but for each lab to find a way to have the flag on the server. And then find clever ways for them to jump through some hoops to get that flag eventually.
e.g.
For LFI you could store the flag on the server to retrieve. For SQLI you can store a flag in the DB For CMD you can also store the flag on the server and read it with the RCE For XSS do session hijacking and the admin account have the flag. Etc
What do you think? :-)
Good idea,
For this specific lab (CMD), we should undo all changes but flag.txt
. User must find a way to find and read the content of flag.txt
. One possible scenario would be:
echo test > ../site/path/random.txt
in them. (in this lab it can be /static/
path)http://127.0.0.1:5000/static/random.txt
in browser.flag.txt
file by executing ls > static/random.txt
and checking result in browser.flag.txt
by executing cat flag.txt > static/random.txt
.How is that? we apply similar approach for other labs, as you mentioned (no regex).
This PR is an initial commit for ctf labs. From now we can add CTF-style training laboratories.
Roles to adding CTF-style labs:
CTF
folder in root directory of project, if not exists. for example:mkdir CTF\python
CTF\python\RCE-lab-level-1
Current changes for python
CMD
lab, which was an RCE case:flag.txt
file which contains the flag string.ctf.py
file which handles the ctf logic and returns the flag string if user successfully exploited the vulnerability.As I mentioned above, this is an initial idea. Please let me know if we can improve that anyhow ^^