vuls安装记录

第一步安装go环境
apt-get install golang-go
(显示出错,go版本apt安装太低,apt-get purge golang-go卸载后手动安装,必须1.8.3以上)

还需将/usr/local/目录中的go目录删除   rm -rf go
wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz
mkdir $HOME/go //设置工作目录
vi /etc/profile.d/goenv.sh
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
source /etc/profile.d/goenv.sh //环境变量设置为当前shell

第二步部署go-cve-dictionary,CVE样本库
sudo mkdir /var/log/vuls //创建目录设置权限,如果是root可以不设置
sudo chown root /var/log/vuls
sudo chmod 700 /var/log/vuls
//sudo chmod 777 -R xxx (更改文件夹及其子文件夹权限为777)
//sudo chmod 600 ××× (只有所有者有读和写的权限)
//sudo chmod 644 ××× (所有者有读和写的权限,组用户只有读的权限)
//sudo chmod 700 ××× (只有所有者有读和写以及执行的权限)
//sudo chmod 666 ××× (每个人都有读和写的权限)
//sudo chmod 777 ××× (每个人都有读和写以及执行的权限
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

第三步获取漏洞数据
部署go-cve-dictionary
cd $HOME
for i in `seq 2002 $(date +"%Y")`; do go-cve-dictionary fetchnvd -years $i; done
//bash循环从2002年开始的数据
//下载完成后会存在一个数据库
ls -alh cve.sqlite3 //查看数据库容量

部署goval-dictionary
mkdir -p $GOPATH/src/github.com/kotakanbe
cd $GOPATH/src/github.com/kotakanbe
git clone https://github.com/kotakanbe/goval-dictionary.git
cd goval-dictionary
make install

//然后,由于要扫描的服务器是Ubuntu,因此要获取ubuntu的数据
二进制文件生成在$GOPATH/bin目录中
cd $HOME
goval-dictionary fetch-ubuntu 12 14 16 //获取所有版本数据

第四步部署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 //报了错误GNUmakefile:42: recipe for target 'lint' failed
手动克隆存储库来解决此问题
mkdir -p $GOPATH/src/golang.org/x \
&& git clone https://github.com/golang/lint.git $GOPATH/src/golang.org/x/lint \
&& go get -u golang.org/x/lint/golint

以上为安装过程

1.下面开始本地扫描模式
组态
cd $HOME
touch config.toml
cat config.toml
[servers]

[servers.localhost]
host = "localhost"
port = "local"

vuls configtest //扫描前检查配置

开始扫描
vuls scan

查看单行摘要
vuls report -format-one-line-text
查看简要摘要
vuls report -format-short-text
查看完整报告
vuls report -format-full-text | less
Vuls有基于终端的用户界面来显示扫描结果
vuls tui //查看报告
扫描结果保存在results目录中


2.远程扫描模式
本地主机创建秘钥
ssh-keygen -t rsa
~/.ssh/id_rsa.pub //复制公钥内容
#/root/.ssh/id_rsa. <== 私钥
#/root/.ssh/id_rsa.pub
进入远程主机
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
vi ~/.ssh/authorized_keys //复制公钥在其中
设置 SSH,打开密钥登录功能
编辑 /etc/ssh/sshd_config 文件,进行如下设置:
RSAAuthentication yes
PubkeyAuthentication yes
另外,请留意 root 用户能否通过 SSH 登录:
PermitRootLogin yes
最后,重启 SSH 服务:
[root@host .ssh]$ service sshd restart
然后试试本地远程连接ssh通过私钥连接
ssh root@120.203.13.112 -p 2228 -i ~/.ssh/id_rsa
连接成功后输入exit退出ssh
cd $HOME
修改配置config.toml
把对象改为目标远程主机
[servers]

[servers.centos]
host = "120.203.13.112"
port = "2228"
user = "root"
keyPath = "/root/.ssh/id_rsa"

vuls configtest centos //检测服务器配置
vuls scan centos //开始扫描
vuls tui //查看报告
扫描结果保存在results目录中


使用WEB界面查看报告
VulsRepo
vuls report -format-json //创建一个json报告
cd $HOME
git clone https://github.com/usiusi360/vulsrepo.git //安装
cd $HOME/vulsrepo/server
cp vulsrepo-config.toml.sample vulsrepo-config.toml //复制配置文件
配置
vi vulsrepo-config.toml
根据自己目录而定
[Server]
rootPath = "/root/vulsrepo"
resultsPath = "/root/results"
serverPort = "9998"
serverIP = "0.0.0.0"
配置完后运行
./vulsrepo-server

 

转载于:https://www.cnblogs.com/esiarp/p/8990425.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Linux上搭建DNS服务器,可以按照以下步骤进行: 1. 安装DNS服务器软件,常见的有BIND、dnsmasq等,以BIND为例,可以使用以下命令进行安装: ``` sudo apt-get update sudo apt-get install bind9 ``` 2. 配置BIND,可以编辑`/etc/bind/named.conf.options`文件进行配置,例如设置DNS服务器监听的IP地址、DNS转发等: ``` options { directory "/var/cache/bind"; // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. // forwarders { // 0.0.0.0; // }; // listen-on-v6 { any; }; }; ``` 3. 配置DNS解析,可以编辑`/etc/bind/named.conf.local`文件进行配置,例如添加一个域名解析: ``` zone "example.com" { type master; file "/etc/bind/db.example.com"; }; ``` 4. 添加域名解析记录,可以编辑`/etc/bind/db.example.com`文件进行配置,例如添加一个主机名为`www`的A记录: ``` ; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA example.com. root.example.com. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS example.com. @ IN A 127.0.0.1 www IN A 192.168.0.1 ``` 5. 启动DNS服务器,可以使用以下命令启动BIND: ``` sudo systemctl start bind9 ``` 这样就可以在Linux上搭建DNS服务器了。需要注意的是,DNS服务器的配置和使用需要一定的技术和知识储备,建议在操作前先了解相关知识或寻求专业人士的帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值