红联Linux门户
Linux帮助

在Ubuntu 16.04上使用Vuls扫描漏洞

发布时间:2017-07-19 08:57:54来源:Linux网站作者:Linux
介绍
Vuls是用Go语言制作的开源漏洞扫描程序。 vuls的最大导入功能是具有无代理架构,这意味着扫描程序使用ssh扫描其他主机。它有电子邮件支持和Slack通知。
 
要求
Ubuntu 16.04 上安装 GO(http://www.linuxdiyf.com/linux/32027.html)
 
安装
接下来我们需要创建一些日志目录。 与系统的用户更改user_for_scanner。
sudo mkdir /var/log/vuls
sudo chown user_for_scanner /var/log/vuls
sudo chmod 700 /var/log/vuls
现在我们要安装一个漏洞数据库。
mkdir -p $GOPATH/src/github.com/kotakanbe
cd $GOPATH/src/github.com/kotakanbe
git clone https://github.com/kotakanbe/go-cve-dictionary.git
cd go-cve-dictionary
make install
要下载数据库执行:
for i in {2002..2016}; do go-cve-dictionary fetchnvd -years $i; done
我们正在准备安装vuls
mkdir -p $GOPATH/src/github.com/future-architect
cd $GOPATH/src/github.com/future-architect
git clone https://github.com/future-architect/vuls.git
cd vuls
make install
 
利用漏洞
Now that everthing was installed we are going to show you how to use vulns. First we are going to create a config file in the $HOME called "config.toml":
现在,一切都安装好了,我们将向您展示如何使用vulns。 首先,我们将在$HOME中创建一个名为“config.toml”的配置文件:
cd $HOME
touch config.toml
然后添加以下内容:
[servers]
[servers.localhost]
host         = "localhost"
port        = "local"
开始执行 :
vuls scan
如果出现问题,尝试执行vuls configtest来检查配置文件是否正确。
您可以创建报告:
vuls report -format-one-line-text -cvedb-path=$PWD/cve.sqlite3
 
附录
Solving Error: cannot find package "github.com/mattn/go-sqlite3" in any of:
如果由于某种原因您可能会出现以下这个错误:
main.go:9:2: cannot find package "github.com/google/subcommands" in any of:
/usr/local/go/src/github.com/google/subcommands (from $GOROOT)
/home/leonardo/go/src/github.com/google/subcommands (from $GOPATH)
main.go:10:2: cannot find package "github.com/kotakanbe/go-cve-dictionary/commands" in any of:
/usr/local/go/src/github.com/kotakanbe/go-cve-dictionary/commands (from $GOROOT)
/home/leonardo/go/src/github.com/kotakanbe/go-cve-dictionary/commands (from $GOPATH)
main.go:12:2: cannot find package "github.com/mattn/go-sqlite3" in any of:
/usr/local/go/src/github.com/mattn/go-sqlite3 (from $GOROOT)
/home/leonardo/go/src/github.com/mattn/go-sqlite3 (from $GOPATH)
试试这个来解决问题
go get github.com/google/subcommands
go get github.com/kotakanbe/go-cve-dictionary
go get github.com/mattn/go-sqlite3
make install
 
本文永久更新地址:http://www.linuxdiyf.com/linux/32026.html