顯示具有 openvas 標籤的文章。 顯示所有文章
顯示具有 openvas 標籤的文章。 顯示所有文章

2022年6月10日 星期五

OpenVAS on Ubuntu 20.04

# 更新系統

> sudo apt update

> sudo apt upgrade

> sudo apt dist-upgrade


# 抓取script

> wget https://raw.githubusercontent.com/yu210148/gvm_install/master/install_gvm.sh

> chmod +x install_gvm.sh


# 執行script

> sudo ./install_gvm.sh -v 21 -a -u

2020年10月26日 星期一

OpenVAS on CentOS 8

參考網站

https://www.libellux.com/openvas/#install-openvas-20-08-centos


 == 更新 CentOS ==

server@centos:~$ sudo yum -y update


== 關閉root可以登入ssh ==

server@centos:~$ sudo nano /etc/ssh/sshd_config

PermitRootLogin no

server@centos:~$ sudo systemctl restart sshd.service

server@centos:~$ sudo yum update

server@centos:~$ sudo nano /etc/ssh/sshd_config

PermitRootLogin no

server@centos:~$ sudo systemctl restart sshd.service

server@centos:~$ sudo yum update


== 查看SELinux狀態 ==

server@centos:~$ sudo sestatus

SELinux status:                 enabled


== 關閉SELinux ==

server@centos:~$ sudo setenforce 0

server@centos:~$ sudo nano /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled

 

== 重新開機 ==

server@centos:~$ sudo shutdown -r now


== 再次確認SELinux狀態 ==

server@centos:~$ sudo sestatus

SELinux status:                 disabled


== 安裝 wget ==

server@centos:~$ sudo yum install wget


== download the Atomicorp installer ==

server@centos:~$ wget -q -O - https://updates.atomicorp.com/installers/atomic | sudo sh

For supported software packages please contact us at: 

  sales@atomicorp.com

Do you agree to these terms? (yes/no) [Default: yes] yes

Enable repo by default? (yes/no) [Default: yes]: yes


== Enable PowerTools and install extra packages ==

server@centos:~$ sudo yum config-manager --set-enabled PowerTools

server@centos:~$ sudo yum install epel-release


== 安裝 gvm ==

server@centos:~$ sudo yum install gvm


== 更新及設定admin密碼(這個跑很久) ==

server@centos:~$ sudo gvm-setup


== 進入網站 ==

https://127.0.0.1/

https://ipv4/

https://[ipv6]/

2017年10月30日 星期一

OpenVAS 9 on CentOS 7

#禁止root ssh

>vi /etc/ssh/sshd_config

PermitRootLogin no

>systemctl restart sshd.service

======================================================================
#更新
yum -y update

======================================================================
#防火牆
http://blog.xuite.net/tolarku/blog/363801991-CentOS+7+Firewalld+防火牆說明介紹

======================================================================
#安裝OpenVAS

>vi /etc/selinux/config

SELINUX=disabled

>reboot

>yum install wget bzip2 texlive net-tools alien

>wget -q -O - http://www.atomicorp.com/installers/atomic | sh

>yum install redis openvas

>vim /etc/redis.conf
unixsocket /tmp/redis.sock
unixsocketperm 700

>systemctl enable redis
>systemctl restart redis

>openvas-setup

(下載更新 跑很久)

(設定admin帳號密碼)

#開啟防火牆
>firewall-cmd --permanent --zone=public --add-port=9392/tcp
>firewall-cmd --reload

======================================================================
#無法產生PDF檔的修正方法
>yum -y install texlive-changepage texlive-titlesec
>mkdir -p /usr/share/texlive/texmf-local/tex/latex/comment
>cd /usr/share/texlive/texmf-local/tex/latex/comment
>wget http://mirrors.ctan.org/macros/latex/contrib/comment/comment.sty
>chmod 644 comment.sty
>texhash

2017年10月25日 星期三

OpenVAS 9 on ubuntu

ubuntu server 16.04安裝

======================================================================
#參考網站
https://magiclen.org/ubuntu-server-16-04/
https://hackertarget.com/openvas-9-install-ubuntu-1604/
======================================================================
#設定固定IP
sudo vi /etc/network/interfaces

auto ens160
iface ens160 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.254

dns-nameservers 168.95.1.1

sudo /etc/init.d/networking restart

======================================================================
#系統更新
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

======================================================================
#安裝OpenVAS9
>sudo add-apt-repository ppa:mrazavi/openvas

>sudo apt update
>sudo apt install sqlite3
>sudo apt install openvas9

#安裝產生PDF報表軟體
>sudo apt install texlive-latex-extra --no-install-recommends

>sudo apt-get install texlive-fonts-recommended

>sudo apt install libopenvas9-dev

#同步資料 (資料量很大)
>sudo greenbone-nvt-sync
>sudo greenbone-scapdata-sync
>sudo greenbone-certdata-sync

>sudo service openvas-scanner restart

>sudo ps -ef | grep openvas

>sudo netstat -na

#增加可掃smb漏洞
>sudo apt install smbclient

>sudo service openvas-manager restart
>sudo openvasmd --rebuild --progress

======================================================================
#更改網頁預設使用port
#change gsad default port 4000
>sudo vi /etc/default/openvas-gsa

HTTP_ONLY=1
LISTEN_ADDRESS="0.0.0.0"
PORT_NUMBER=9392

>sudo /etc/init.d/openvas-gsa restart

======================================================================
#開啟防火牆及相關policy
#啟用
>sudo ufw enable

#停用
>sudo ufw disable

#允許全部
>sudo ufw default allow

#封鎖全部
>sudo ufw default deny

#刪除防火牆規則
>sudo ufw status numbered
>sudo ufw delete 'numbered'

#啟用log /var/log/ufw.log
>sudo ufw logging on

#查看規則及狀態
>sudo ufw status
>sudo ufw statusverbose

#範例
>sudo ufw allow ssh

>sudo ufw allow in 8080

>sudo ufw deny out 3389

>sudo ufw deny in 123/udp

>sudo ufw version

>sudo ufw allow from 10.0.0.2

>sudo ufw deny from 10.0.1.0/24

>sudo ufw allow from 10.10.1.0/24 to any port 22

OpenVAS 9 on FreeBSD

安裝OpenVAS9
>pkg install openvas9

>ee /etc/rc.conf

redis_enable="YES"
openvassd_enable="YES"
openvassd_flags=""
openvasmd_enable="YES"
openvasmd_flags=""
gsad_enable="YES"
gsad_flags="--listen=0.0.0.0 --port=9392 --http-only"


>cp /usr/local/etc/redis.conf.example redis.conf
>ee redis.conf
unixsocket /tmp/redis.sock

>service redis start

>openvassd
>greenbone-nvt-sync
>greenbone-scapdata-sync
>greenbone-certdata-sync
>openvasmd --rebuild --progress
>openvasmd --create-user=admin --role=Admin
>openvasmd --user=admin --new-password=admin

>service openvassd restart
#這個指令會有錯誤訊息,待查
#Unknown option --listen=127.0.0.1
#解法 /etc/rc.conf加入
#openvassd_flags=""

>service openvasmd restart
#重開機會開不起來
#log
#Setting GnuPG dir to '/var/lib/openvas/openvasmd/gnupg'
#Setting GnuPG dir failed: Invalid crypto engine
#目前找尋解決方法中
#可使用/usr/local/etc/rc.d/openvasmd start手動啟動

>openvasmd --rebuild --progress

>service gsad start


>pkg install texlive-texmf
#裝了也無法產出pdf檔
#目前找尋解決方法中
**pkg install tex-formats 補上pdflatex程式