做了一下PHP的题目,其他解法网上已经有了http://exp-blog.com/2019/01/02/pid-2597/
但是PHP eval这个题目没有详细的writeup,所以自己做了一下
PHP - Eval
http://challenge01.root-me.org/web-serveur/ch57/
进入题目查看给出的代码如下:
<html>
<head>
</head>
<body>
<h4> PHP Calc </h4>
<form action='index.php' method='post'>
<input type='text' id='input' name='input' />
<input type='submit' />
<?php
if (isset($_POST['input'])) {
if(!preg_match('/[a-zA-Z`]/', $_POST['input'])){
print '<fieldset><legend>Result</legend>';
eval('print '.$_POST['input'].";");
print '</fieldset>';
}
else
echo "<p>Dangerous code detected</p>&#