在地址栏中提供php函数参数

在地址栏中提供php函数参数,php,Php,我如何通过在地址栏中传递参数来调用它 守则: <?php /** * Generate the list of pages, linking to each * * @param integer $boardpage Current board page * @param integer $pages Number of pages * @param string $board Board directory * @return string Generated page li

我如何通过在地址栏中传递参数来调用它

守则:

<?php
/**
 * Generate the list of pages, linking to each
 *
 * @param integer $boardpage Current board page
 * @param integer $pages Number of pages
 * @param string $board Board directory
 * @return string Generated page list
 */

/* <3 coda for this wonderful snippet
print $contents to $filename by using a temporary file and renaming it */
function print_page($filename, $contents, $board) {
    global $tc_db;

    $tempfile = tempnam(KU_BOARDSDIR . $board . '/res', 'tmp'); /* Create the temporary file */
    $fp = fopen($tempfile, 'w');
    fwrite($fp, $contents);
    fclose($fp);
    /* If we aren't able to use the rename function, try the alternate method */
    if (!@rename($tempfile, $filename)) {
        copy($tempfile, $filename);
        unlink($tempfile);
    }

    chmod($filename, 0664); /* it was created 0600 */
}

?>

确保使用

print_page($_REQUEST['filename'], $_REQUEST['contents'], $_REQUEST['board'])

事实上,我并不是为了自己的任何目的而打电话给它。有人在我的网站上使用RCE上传了一个外壳并对其进行了破坏。这是我使用grep可以找到的唯一易受攻击的方法。所有exec和系统方法都经过清洗且安全。其他想法?哦,你的问题不是你的问题?有趣。很高兴我能帮上忙。事实上,我的问题完全是我的问题。如何将它们发送到地址栏。照现在的样子。根据你对J-Dizzle回答的评论,有没有上传功能?有,我必须找到。你是否在白名单上运行上传的文件?没有,我们做的正好相反。对于标记的文件,我们根据禁用的md5哈希检查上载。您是否在自己的网站上尝试过示例攻击,以查看这是否是他们利用的地方?示例-
http://example.com/inc/func/pages.php?action=print_page&$filename%27lel.php&$contents=&$board=b
。甚至对它进行编码?