dvwa靶场命令执⾏漏洞
high难度的源码:
$target = trim($_REQUEST[ ‘ip’ ]);是一个接收id值的变量
array_keys()函数功能是返回包含原数组中所有键名的一个新数组。
str_replace() 函数如下,把字符串 “Hello world!” 中的字符 “world” 替换为 “Shanghai”:
str_replace("world","Shanghai","Hello world!");
shell_exec()函数是执行Linux命令函数,可以获取全部数据
<?php
if( isset( $_POST[ 'Submit' ] ) ) {
// Get input
$target = trim($_REQUEST[ 'ip' ]);
// Set blacklist
$substitutions = array(
'&' => '',
';' => '',
'| ' => '',
'-' => '',
'$' => '',
'(' => '',
')' => '',
'`' => '',
'||' => '',
);
//