我正在开发一个涉及wapiti和nikto网络工具的项目。我已设法使用此命令为这两个工具生成一个报告
python wapiti.py www.kca.ac.ke ;perl nikto.pl -h www.kca.ac.ke -Display V -F htm -output /root/.wapiti/generated_report/index.html.
但我想运行像
这样的命令python wapiti.py www.kca.ac.ke
获取wapiti和nikto网络扫描报告。我如何实现这些人?
答案 0 :(得分:0)
shell脚本可以工作。将以下内容保存为“run_wapiti_and_nikto_scans”,然后将其运行为:
bash run_wapiti_and_nikto_scans www.my.site.com
这是脚本:
#!/bin/bash
SITE=$1
if [ -n "$SITE" ]; then # -n tests to see if the argument is non empty
echo "Looking to scan $SITE"
echo "Running 'python wapiti.py $SITE'"
python wapiti.py $SITE || echo "Failed to run wapiti!" && exit 1;
echo "Running 'perl nikto.pl -h $SITE -Display V -F htm -output /root/.wapiti/generated_report/index.html'"
perl nikto.pl -h $SITE -Display V -F htm -output /root/.wapiti/generated_report/index.html || echo "Failed to run nikto!" && exit 1;
echo "Done!"
exit 0; # Success
fi
echo "usage: run_wapiti_and_nikto_scans www.my.site.com";
exit 1; # Failure