General-purpose network vulnerability scanner with sequential port discovery pipeline.
The scanner uses a three-phase scanning pipeline:
Discovery (RustScan) → Enumeration (Naabu) → Vulnerability (Nmap)
↓ ↓ ↓
Find open ports Detailed enumeration Scan discovered ports
✅ Port Discovery Pipeline - Nmap only scans ports discovered by RustScan/Naabu
✅ Protocol Agnostic - No hardcoded protocol-specific logic
✅ Template-Based - Customizable scan profiles with NSE scripts
✅ Source Attribution - Complete audit trail of scan tools and configurations
✅ Parallel Execution - Worker pool for concurrent host scanning
# Scanner runs automatically in sirius-engine container
docker logs -f sirius-engine
# Trigger scan via UI:
# http://localhost:3000/scanner → Select template → Start scan| Scan Type | Tool | Purpose |
|---|---|---|
enumeration |
Naabu | Fast port enumeration |
discovery |
RustScan | Host and service discovery |
vulnerability |
Nmap+NSE | Vulnerability scanning |
See: SCAN-TYPES.md for detailed information.
-
Discovery Phase (if enabled):
- RustScan quickly finds open ports
- Example: discovers [80, 443, 445, 3389]
-
Enumeration Phase (if enabled):
- Naabu performs detailed port enumeration
- Merges results with discovery phase
-
Vulnerability Phase:
- Nmap scans ONLY discovered ports
- Falls back to template
port_rangeif no ports discovered - Skips scan if no ports and no template range
See: PORT-PIPELINE-IMPLEMENTED.md for architecture details.
{
"name": "Web Application Scan",
"type": "custom",
"scan_options": {
"scan_types": ["discovery", "vulnerability"],
"port_range": "", // Empty - uses discovered ports
"parallel": true
},
"enabled_scripts": ["http-vuln-*", "ssl-*"]
}Benefits:
- ✅ Only scans open ports (fast!)
- ✅ No wasted time on closed ports
- ✅ Adapts to target configuration
{
"name": "SMB Direct Scan",
"type": "custom",
"scan_options": {
"scan_types": ["vulnerability"],
"port_range": "139,445", // Explicit ports
"parallel": true
},
"enabled_scripts": ["smb-vuln-*", "smb2-*"]
}Use when:
- You know exact ports to scan
- Targeting specific services
- Fastest for known configurations
See: PORT-RANGE-OPTIMIZATION.md for port recommendations by protocol.
| Approach | Ports Scanned | Scan Time |
|---|---|---|
| Port Pipeline (discovery → vuln) | 4 discovered ports | ~1 minute |
| Traditional (vuln only with 1-65535) | All 65,535 ports | ~30 minutes |
Result: 30x faster for typical scans
app-scanner/
├── cmd/ # Test utilities
├── internal/
│ ├── scan/ # Core scanning logic
│ │ ├── manager.go # Scan orchestration
│ │ ├── factory.go # Tool factory
│ │ ├── strategies.go # Scan strategies
│ │ └── worker_pool.go # Parallel execution
│ ├── nse/ # NSE script management
│ └── templates/ # Template management
├── modules/
│ ├── nmap/ # Nmap integration
│ ├── rustscan/ # RustScan integration
│ └── naabu/ # Naabu integration
└── pkg/
├── models/ # Data models
├── queue/ # RabbitMQ integration
└── store/ # ValKey integration
# In container
docker exec sirius-engine bash -c "cd /app-scanner && go build ."
# Local (requires Go 1.21+)
cd /Users/oz/Projects/Sirius-Project/minor-projects/app-scanner
go build .# Run specific test
go run cmd/scan-full-test/main.go
# Validate NSE scripts
go run cmd/validate-nse-fix/main.go# RabbitMQ
RABBITMQ_HOST=sirius-rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_QUEUE=scan_requests
# ValKey (Redis)
VALKEY_ADDR=sirius-valkey:6379
# API
GO_API_URL=http://sirius-go-api:8080
# Scanning
NMAP_PATH=/usr/bin/nmap
NSE_SCRIPTS_DIR=/opt/sirius/nse/sirius-nseSymptom: Scan runs for 10+ minutes
Cause: Scanning too many ports
Solution:
- Enable
discoveryscan type to find open ports first - Use protocol-specific port ranges (see PORT-RANGE-OPTIMIZATION.md)
- Avoid
port_range: "1-65535"unless necessary
Symptom: "No ports discovered and no port_range - skipping"
Cause: Target has no open ports OR discovery failed
Solution:
- Verify target is accessible:
docker exec sirius-engine ping <target> - Check firewall rules
- Add fallback
port_rangein template
Symptom: "failed to build script flag" or "no port range specified"
Cause: Template misconfiguration
Solution:
- Ensure template has
enabled_scriptsorport_range - Check NSE scripts are valid:
go run cmd/validate-nse-fix/main.go - Review scanner logs:
docker logs sirius-engine
- SCAN-TYPES.md - Canonical scan types reference
- PORT-RANGE-OPTIMIZATION.md - Port range recommendations
- PORT-PIPELINE-IMPLEMENTED.md - Architecture deep dive
- ARCHITECTURAL-FIX-PORT-PIPELINE.md - Technical implementation details
- General Purpose - No protocol-specific hardcoded logic
- Discovery-Driven - Nmap scans discovered ports, not arbitrary ranges
- Template-Based - Users control scan behavior via templates
- Performance-Focused - Only scan what's necessary
- Observable - Comprehensive logging and audit trails
Built with: Go, Nmap, RustScan, Naabu, RabbitMQ, ValKey