程序员疫苗:代码注入

我的那个疫苗网站正在建议中(不好意思拖了很久),不过,我可以先写一些关于程序员疫苗性质的文章,也算是热热身。希望大家喜欢,先向大家介绍第一注疫苗——代码注入。
Shell注入
我们先来看一段perl的代码:
[perl]use CGI qw(:standard);
$name = param(‘name’);
$nslookup = "/path/to/nslookup";
print header;
if (open($fh, "$nslookup $name|")) {
while (<$fh>) {
print escapeHTML($_);
print "<br>\n";
}
close($fh);
}[/perl]
如果用户输入的参数是:
coolshell.cn%20%3B%20/bin/ls%20-l
那么,这段perl的程序就成了:
(
40
人打了分,平均分:
4.15
)