运行环境ubuntu10.04,php+mysql+apache,
问题简述:shell调用nikto并生成一个txt文件,php调用shell,ubuntu调用php,
                 txt文件没有生成,为什么?我在 php 页面中调用shell脚本:
php:
<? 
echo "test";
system("/home/test/下载/nikto-2.1.3/hello.sh ");
?>
shell 脚本
#!/bin/bash
#hello world
#a function
function hello()
{
echo "url:www.fjnu.edu.cn"
perl nikto.pl -h "www.fjnu.edu.cn" -o test.txt
}
echo "begin"
hello
echo "end"浏览器访问php页面,页面显示 
begin url:www.fjnu.edu.cn end 但没有生成 test.txt页面,哪里出问题了?
谢谢~

解决方案 »

  1.   

    呃没用过nikto  -o test.txt
    你确定这句是生成文件的?
      

  2.   

    -output报告输出指定地点好像是输到这个文件你要扫描网站服务器信息?curl --haed www.fjnu.edu.cn -o page.txt这个命令也可以
      

  3.   

    上面命令有误#!/bin/bash
    #hello world
    #a function
    function hello()
    {
    curl --head www.fjnu.edu.cn -o text.txt
    }
    hello这样即可,当然你要装了curl
      

  4.   


    谢谢你的回答,
    但我希望nikto生成test.txt页面,而不是curl。
      

  5.   

    执行sh文件到权限 -rwxr-xr-x  如果运行Nikto的主机是通过HTTP proxy来访问互联网的,也可以使用代理来扫描,使用选项-u(useproxy)。下面将通过HTTP proxy来扫描,如下所示:perl nikto.ph -h www.fjnu.edu.cn -o test.txt