Build a Vulnerability Scanning Lab
Regular vulnerability scanning is essential for maintaining security posture. This project guides you through setting up a dedicated scanning lab using OpenVAS (Greenbone Vulnerability Management).
Project Overview
What you'll build:
- Isolated vulnerability scanning environment
- OpenVAS scanner with web interface
- Target network for safe testing
- Reporting and remediation workflow
Time to complete: 2-4 hours
Why a Dedicated Scanning Lab?
- Safe testing - Scan without impacting production
- Learning - Understand vulnerabilities hands-on
- Process development - Build scanning procedures
- Tool evaluation - Compare different scanners
Architecture
┌─────────────────────────────────────────────────────┐
│ Scanning Lab Network │
│ (Isolated VLAN) │
│ │
│ ┌─────────────┐ ┌─────────────────────┐ │
│ │ OpenVAS │ │ Target Machines │ │
│ │ Scanner │──────►│ (Vulnerable VMs) │ │
│ │ (Manager) │ │ │ │
│ └─────────────┘ └─────────────────────┘ │
│ │ │
│ │ Web UI │
│ ▼ │
│ ┌─────────────┐ │
│ │ Analyst │ │
│ │ Workstation │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────┘Prerequisites
- Hypervisor (Proxmox, VMware, VirtualBox)
- 8GB+ RAM available for VMs
- 100GB+ storage
- Isolated network segment
Part 1: OpenVAS Deployment
Option A: Docker Deployment (Recommended)
# Create project directory
mkdir -p /opt/openvas
cd /opt/openvas
# Create docker-compose.yml
cat > docker-compose.yml << 'EOF'
version: '3.8'
services:
vulnerability-scanner:
image: greenbone/community-container:stable
container_name: openvas
restart: unless-stopped
ports:
- "127.0.0.1:9392:9392"
volumes:
- openvas_data:/var/lib/gvm
- openvas_feeds:/var/lib/openvas
volumes:
openvas_data:
openvas_feeds:
EOF
# Start container
docker-compose up -d
# Initial setup takes 15-30 minutes for feed sync
docker logs -f openvasOption B: Dedicated VM
# Ubuntu 22.04 installation
sudo apt update
sudo apt install -y gvm
# Initialize GVM
sudo gvm-setup
# Note the generated admin password
# Verify installation
sudo gvm-check-setupAccess Web Interface
After feed synchronization:
- Open browser to
https://localhost:9392 - Login with admin credentials
- Wait for feed update to complete
Part 2: Create Target Network
Intentionally Vulnerable VMs
Download and deploy practice targets:
Metasploitable 3:
# Using Vagrant
vagrant init rapid7/metasploitable3-ub1404
vagrant upVulnHub Images:
- Download from vulnhub.com
- Various difficulty levels
- Import as VMs
DVWA (Web Application):
# docker-compose.yml addition
services:
dvwa:
image: vulnerables/web-dvwa
container_name: dvwa
ports:
- "8081:80"
environment:
- MYSQL_PASS=p@ssw0rdNetwork Isolation
Ensure scanning network is isolated:
# Firewall rules (example)
# Allow: Scanner -> Targets (all ports)
# Allow: Analyst -> Scanner (web interface)
# Deny: Scanning network -> Production
# Deny: Scanning network -> InternetPart 3: Configure OpenVAS
Create Target Definition
- Navigate to Configuration > Targets
- Click New Target
- Configure:
- Name: Lab Targets
- Hosts: 10.100.0.0/24 (your target network)
- Port List: All TCP and UDP
Configure Scan Settings
- Go to Configuration > Scan Configs
- Clone "Full and fast" for customization
- Adjust based on needs:
- Enable/disable specific NVT families
- Adjust concurrent hosts
- Set timeout values
Create Scheduled Task
- Navigate to Scans > Tasks
- Click New Task
- Configure:
- Name: Weekly Lab Scan
- Target: Lab Targets
- Scanner: Default
- Scan Config: Full and fast
- Schedule: Weekly
Part 4: Running Scans
Manual Scan
1. Go to Scans > Tasks
2. Select your task
3. Click Start (play button)
4. Monitor progress in dashboardInterpreting Results
Severity Levels:
| Level | CVSS Score | Action Required |
|---|---|---|
| Critical | 9.0 - 10.0 | Immediate |
| High | 7.0 - 8.9 | Within 24-48h |
| Medium | 4.0 - 6.9 | Within 30 days |
| Low | 0.1 - 3.9 | Risk acceptance or schedule |
Export Reports
- Go to Scans > Reports
- Select completed scan
- Export options:
- PDF (executive summary)
- CSV (for tracking)
- XML (for integration)
Part 5: Remediation Workflow
Tracking Findings
Create a tracking system:
## Vulnerability Tracking
| ID | Host | Vulnerability | Severity | Status | Assigned | Due |
|----|------|---------------|----------|--------|----------|-----|
| 001 | 10.100.0.10 | SSH Weak Ciphers | Medium | Open | Admin | 2/15 |
| 002 | 10.100.0.20 | Apache CVE-2024-xxx | High | In Progress | DevOps | 2/10 |Verification Scans
After remediation:
- Create targeted scan for specific vulnerabilities
- Run verification scan
- Compare results
- Update tracking
Part 6: Automation
API Integration
#!/usr/bin/env python3
# Example: Automated scan status check
from gvm.connections import UnixSocketConnection
from gvm.protocols.gmp import Gmp
from gvm.transforms import EtreeTransform
# Connect to GVM
connection = UnixSocketConnection(path='/var/run/gvmd/gvmd.sock')
transform = EtreeTransform()
with Gmp(connection=connection, transform=transform) as gmp:
gmp.authenticate('admin', 'your-password')
# Get all tasks
tasks = gmp.get_tasks()
for task in tasks.findall('task'):
name = task.find('name').text
status = task.find('status').text
print(f"Task: {name}, Status: {status}")Scheduled Reporting
#!/bin/bash
# /opt/openvas/weekly-report.sh
# Generate and email weekly report
# Integrate with your reporting system
DATE=$(date +%Y-%m-%d)
REPORT_DIR="/opt/openvas/reports"
# Export via API or web interface
# Email to security teamBest Practices
Scanning Guidelines
- Schedule during off-hours - Minimize impact
- Start with light scans - Identify issues before deep scans
- Document everything - Track scan history
- Validate findings - Manual verification of critical issues
- Regular feed updates - Keep vulnerability definitions current
Safe Scanning
DO:
✓ Scan only authorized systems
✓ Use isolated networks for testing
✓ Coordinate with system owners
✓ Document scan activities
DON'T:
✗ Scan production without approval
✗ Scan systems you don't own
✗ Run aggressive scans blindly
✗ Ignore scan resultsExpanding the Lab
Additional Scanners
Consider adding:
- Nessus Essentials - Free for 16 IPs
- Nuclei - Fast template-based scanner
- Nikto - Web server scanner
- OWASP ZAP - Web application scanner
Integration Ideas
- SIEM integration for alerts
- Ticketing system for remediation tracking
- Dashboard aggregation
- Compliance reporting
Troubleshooting
Common Issues
Scans running slowly:
- Reduce concurrent hosts
- Check network connectivity
- Verify target availability
Missing vulnerabilities:
- Update NVT feeds
- Enable additional scan families
- Use credentialed scanning
Feed sync failures:
- Check internet connectivity
- Verify proxy settings
- Check disk space
Security Considerations
- Keep scanner updated
- Secure admin credentials
- Restrict network access to scanner
- Encrypt scan results
- Audit scanner access
Conclusion
A dedicated vulnerability scanning lab provides invaluable insights into your security posture. Regular scanning, combined with effective remediation tracking, significantly reduces your attack surface.
Next Steps
- Expand target inventory
- Implement credentialed scanning
- Integrate with SIEM
- Automate remediation workflows
- Build compliance reports
Last updated: January 2026