Components :
- Faraday-server : Faraday is a wonderful IPE (Integrated Penetration-Test Environnement) wich can parse and visaulize Grennbone's results in a beautiful dashboard.
- faraday-cli : Faraday's command-line interface
- docker image of GVM core (with no webUI) : build from source, pulled from Docker hub
- bash script
Fully fonctionnal on a Debian host, feel free to tell if it's not working on other distrib.
I've created nothing, just compiling, all credits are listed at the end of this readme.
This tool get your ip address from NIC and do a nmap ARP scan to get alive hosts on network. The scan results are pulled in a text file, this file is given to Greenbone container in order to run a vulnerability scan only on alive hosts. Then, theXML file is generated and send to Faraday, thanks to faraday-cli.
When finished, the results of the scan are visible on the Faraday web page http://:5985
Download and execute install file
wget https://raw.githubusercontent.com/Kptainflintt/Lazyvuln/master/install.bash
chmod +x install.bash
./install.bash
When installing, script will ask you for scheduled scan if you want. It's just a cron job, executed daily, weekly or monthly. You can also create your own cron job later (for help, you can use https://crontab.guru/) This will use my script to launch scan and pull XML results in faraday, with naming it with date (like scan_11-10-2022.xml)
This script is not mandatory, but can automate scan with upload to Faraday-server.You also can run it manually when you want
ATTENTION : please take care of faraday's password given at the end of the script!!!!
If you want to be notified when scan finished, you can use ssmtp and mailutils, just :
apt install ssmtp mailutils -y
Copy ssmtp.conf in this repo and change values to your own, copy it to /etc/ssmtp and add to /usr/bin/start-scan, at the end :
echo "The scan ended successfully, you should be able to see results on your faraday webui" | mail -s "Scan ended" *your_email_here*
If you want to run a scan, just launch
start-scan
And wait for it to finish. Duration depends of :
- Number of targets
- CPU
- RAM
So it can take 10 mn or even 10 hours, be patient!
For each scan, the script will create a new panel in Faraday, so you can navigate between your scans.
WARNING : I have some issues with faraday's password sometimes. If specials characters like "(" are generated, authentication withfaraday-cli can fail. I you're facing this issue, do the following to change faraday's password (or if you want to change it) :
- Get container ID :
root@debian:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8db8c51c1826 faradaysec/faraday "/entrypoint.sh" 29 minutes ago Up 29 minutes 0.0.0.0:5985->5985/tcp, 0.0.0.0:9000->9000/tcp faraday_app
4a0cb600a2ff postgres:12.7-alpine "docker-entrypoint.s…" 29 minutes ago Up 29 minutes 0.0.0.0:49154->5432/tcp faraday_db
b9e7ab58287e redis:6.2-alpine "docker-entrypoint.s…" 29 minutes ago Up 29 minutes 0.0.0.0:49153->6379/tcp faraday_redis
For me, it's 8db8c51c1826, so :
docker exec -it 8db8c51c1826 bash
Then :
faraday-manage change-password
docker run --rm -v $(pwd):/reports/:rw kptainflintt/lazyvuln python3 -u scan.py <target> [options]
This will start up the container (optionnaly pull it) and update the NVTs cache - it can take some time, so be patient.
After that, the scan script will run and the progress will be displayed in the console.
Target can be a single IP or CIDR or a comma separated list of IP addresses or CIDRs.
It is possible to specify output filename with -o or --output argument.
By default report is saved as openvas.report.
- Anonymous XML
- CSV Results
- ITG
- TXT
- XML
You can select what report format will be used with -f or --format argument with one of the available profiles.
By default XML format is used to generate the report.
- Base
- Discovery
- Empty
- Full and fast
- Host Discovery
- System Discovery
- GaussDB 100 V300R001C00 Security Hardening Guide (Standalone)
- EulerOS Linux Security Configuration
- Huawei Datacom Product Security Configuration Audit Guide
- IT-Grundschutz
You can select scan profile by adding -p or --profile argument with one of the available profiles.
By default Full and fast profile is used.
- Scan Config Default
- ICMP, TCP-ACK Service & ARP Ping
- TCP-ACK Service & ARP Ping
- ICMP & ARP Ping
- ICMP & TCP-ACK Service Ping
- ARP Ping
- TCP-ACK Service Ping
- TCP-SYN Service Ping
- ICMP Ping
- Consider Alive
You can select scan alive tests by adding -t or --tests argument with one of the available tests.
By default ICMP, TCP-ACK Service & ARP Ping alive tests are used.
- All IANA Assigned TCP
- All IANA Assigned TCP and UDP
- All TCP and Nmap top 100 UDP
You can select scan alive tests by adding -P or --ports argument with one of the available tests.
By default All TCP and Nmap top 100 UDP port list is used. Note that using All TCP and Nmap top 100 UDP will significantly increase the scan time.
You can exclude hosts from specified target by adding -e or --exclude argument with list of IPs.
By default list of excluded hosts is empty.
It is possible to override max_hosts variable in OpenVAS config which specify maximum number of simultaneous hosts tested. Just add -m or --max argument with wanted numeric value.
By default 10 is used as max_hosts variable value.
It is possible to override max_checks variable in OpenVAS config which specify maximum number of simultaneous checks against each host tested. Just add -c or --checks argument with wanted numeric value.
By default 3 is used as max_checks variable value.
You can enable printing command responses by adding --debug argument.
You can also add --update argument to force update.
This will synchronize OpenVAS feeds before making the scan.
Feeds update is quite slow, so it will take significantly more time.
First, if you not use install script, you have to compose faraday's container
wget https://raw.githubusercontent.com/infobyte/faraday/master/docker-compose.yaml
docker-compose up
Credentials will be in screen output, take care of it!
Then, install faraday-cli :
pip install faraday-cli
You can now open a session in faraday
faraday-cli auth -f http://localhost:5985 -u faraday -p *your password*
Create a workspace :
faraday-cli workspace create *name of your workspace*
And, finally, send XML to it:
faraday-cli tool report *path-to-your-scan-result*
More informations : https://docs.faraday-cli.faradaysec.com/
- Mike Splain for creating the original OpenVAS docker image
- ICTU team for creating the base automation script for OpenVAS
- Eugene Merlinsky for adjusting the project to work with Greenbone 20.8.0
- thedoctor0 for his great job
- lukewegryn fir the automation script
- Faraday's team
- Greenbone's team