vulsインストール

この記事は公開されてから半年以上経過しています。情報が古い可能性がありますので、ご注意ください。

概要

SSH経由で特定サーバの脆弱性を確認出来るツールです。
対象はミドルウェア・ライブラリ・フレームワーク。

環境

OS Amazon Linux 2016.03
Type t2.nano

※t2.nanoの場合メモリ不足でエラーになるためSWAP設定必須です。

インストール方法

今回はリモートのサーバにインストールし、自身(localhost)の脆弱性を確認してみます。

Logディレクトリ作成

sudo su -
mkdir /var/log/vuls

Goインストール

下記サイトから最新のコードをダウンロード
https://golang.org/dl/

cd /usr/local/src/
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
tar zxf go1.6.2.linux-amd64.tar.gz
mv ./go ../
vi /etc/profile.d/goenv.sh
---下記を記載---
export GOROOT=/usr/local/go
export GOPATH=/opt/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
---ここまで---
source /etc/profile.d/goenv.sh

必要パッケージインストール

yum install git gcc

go-cve-dictionaryインストール

vulsは脆弱性の照合にCVEを使用しています。
t2.nanoを使用する場合はメモリ不足でエラーになるためSWAP設定必須です。

go get github.com/kotakanbe/go-cve-dictionary
for i in {2002..2016}; do go-cve-dictionary fetchnvd -years $i; done
---1時間程度掛かる---
go-cve-dictionary fetchjvn -entire
---1時間程度掛かる---
go-cve-dictionary server &
curl http://localhost:1323/cves/CVE-2015-0235

vulsインストール

go get github.com/future-architect/vuls
ssh-keygen
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
vi /etc/ssh/sshd_config
---下記を変更---
#PermitRootLogin yes
↓
PermitRootLogin yes

PermitRootLogin forced-commands-only
↓
#PermitRootLogin forced-commands-only
---ここまで---
/etc/init.d/sshd restart
ssh localhost
exit
vi config.toml
---下記を記載---
[servers]
[servers.localhost]
host = "localhost"
port = "22"
user = "root"
keyPath = "/root/.ssh/id_rsa"
---ここまで---
vuls prepare
vuls scan

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Time limit is exhausted. Please reload CAPTCHA.