kali 安装nessus docker 版本
直接运行容器,从远程提取镜像
项目地址
https://github.com/elliot-bia/nessus
docker run -itd --name=ramisec_nessus -p 8834:8834 ramisec/nessus
修改nessus管理密码
进入docker容器的命令行
docker exec -it ramisec_nessus bash
依次执行以下命令
# 进入这个目录
cd /opt/nessus/sbin
# 列出登录用户
nessuscli lsuser
# 修改指定用户的密码(以admin为例)
nessuscli chpasswd admin
更新 这个如果不行就是docker网络有问题,请往下看
docker exec -it ramisec_nessus /bin/bash /nessus/update.sh
网页打开8834端口登录
下载插件
按照github上面的方法下载插件,然后使用update.sh脚本自动编译破解,过程要等待很久不要着急,可以在8834端口查看进度
docker exec -it ramisec_nessus /bin/bash -c "/nessus/update.sh UPDATE_URL_YOU_GOT"
获取下载连接,需要先得到本机软件的id,然后在拿激活码,
The UPDATE_URL_YOU_GOT you need to apply in nessus website to get an activation-code, and generate it in this website For example:
Any stings like aaaaaa11b2222cc33d44e5f6666a777b8cc99912 would be available, but remeber must not be the same 😃
And you will get the UPDATE_URL_YOU_GOT
但是我的docker 网路有问题,无法下载,所以我修改了update脚本,然后在主机下载好插件,然后在复制到docker 里面
通过上面的连接用浏览器下载插件all-2.0.tar.gz
然后docker cp /path/local/file conntainerid:/filepath
重点修改update.sh如下
RESULT=$(curl -s -k https://plugins.nessus.org/v2/plugins.php)
filename=all-2.0.tar.gz
filesize=`ls -l $filename | awk '{ print $5 }'`
maxsize=$((1024*10))
if [ $filesize -gt $maxsize ]
then
echo -e "\033[1;32m「 文件下载成功!\ndownload succeed! 」\033[0m\n\n"
else
echo -e "---------------------\n\n\n
\033[1;31m「 文件下载出错,请检查网络!」\n 「download plugins error, please check network! 」\033[0m
\n\n\n---------------------"
exit
fi
/etc/init.d/nessusd stop > /dev/null 2>&1
/bin/rm -rf /opt/nessus/lib/nessus/plugins/plugin_feed_info.inc
rm -rf /opt/nessus/var/nessus/agent-activity.db > /dev/null 2>&1
/opt/nessus/sbin/nessuscli update all-2.0.tar.gz
/etc/init.d/nessusd start
echo -e "---------------------\n\n\n
\033[1;32m「 正在破解,请耐心等待。。。\n Cracking, please wait... 」\033[0m \n\n
\033[1;32m「 Crack by twitter@Elliot58616851 \n && Thanks Open Source Enthusiast 」\033[0m \n\n\n---------------------"
TIME_USED=0;
while true
do
if [ ! -f "/opt/nessus/var/nessus/agent-activity.db" ]; then
echo -e "正在编译中。。。请稍等\ncompiling...please wait\ncount: $TIME_USED s\n---------------------";
TIME_USED=$(($TIME_USED+3));
sleep 3;
else
sleep 10;
echo -e "---------------------\n
\033[1;32m「 编译完成!\n compile complete! 」\033[0m\n---------------------";
break;
fi
done
/etc/init.d/nessusd stop
echo -e "---------------------\n\n\n\033[1;32m 「 破解成功,重启中。。。\n Crack succeed, restarting...」\033[0m\n\n
\033[1;32m 「 Crack by twitter@Elliot58616851 \n && Thanks Open Source Enthusiast 」\033[0m \n---------------------"
echo -e '
#!/bin/bash\n
/bin/echo -e "PLUGIN_SET = \"'$RESULT'\";\nPLUGIN_FEED = \"ProfessionalFeed (Direct)\";\nPLUGIN_FEED_TRANSPORT = \"Tenable Network Security Lightning\";" > /opt/nessus/var/nessus/plugin_feed_info.inc
/bin/rm -rf /opt/nessus/lib/nessus/plugins/plugin_feed_info.inc
/etc/init.d/nessusd start ' > /nessus/start.sh
rm -rf all-2.0.tar.gz
/bin/echo -e "PLUGIN_SET = \"$RESULT\";\nPLUGIN_FEED = \"ProfessionalFeed (Direct)\";\nPLUGIN_FEED_TRANSPORT = \"Tenable Network Security Lightning\";" > /opt/nessus/var/nessus/plugin_feed_info.inc
/bin/rm -rf /opt/nessus/lib/nessus/plugins/plugin_feed_info.inc
/etc/init.d/nessusd start
exit
注意
因为nessus容器里没有vi,所以在主机修改好然后利用docker cp 替换掉里面的update.sh