Getting Started with Vulnerability Scanning¶
This guide will help you set up your environment and prepare for vulnerability scanning practice.
Environment Setup¶
Required Tools¶
1. Kali Linux¶
Installation Options: - VM: VirtualBox or VMware - WSL2: Windows Subsystem for Linux - Bare Metal: Dual boot or dedicated machine - Cloud: AWS/Azure Kali instances
Download: Kali.org
2. Nmap¶
Pre-installed on Kali Linux. To verify:
Manual Installation (if needed):
3. Nessus Essentials¶
See the Nessus guide for detailed installation instructions.
Quick Start:
# Download from tenable.com
# Install the .deb package
sudo apt install ./Nessus-<version>-debian10_amd64.deb
# Start service
sudo systemctl start nessusd.service
# Access web interface
https://localhost:8834
Lab Environments¶
Recommended Platforms¶
Hack The Box (HTB)¶
- Free Tier: Access to retired machines
- VIP: Active machines and extra features
- Website: hackthebox.com
Setup:
TryHackMe¶
- Free: Beginner-friendly rooms
- Premium: Advanced content
- Website: tryhackme.com
VulnHub¶
- Free: Download vulnerable VMs
- Website: vulnhub.com
OffSec Proving Grounds¶
- Play: Free practice machines
- Practice: Additional machines for subscribers
- Website: portal.offsec.com
Basic Workflow¶
1. Reconnaissance¶
# Ping sweep
nmap -sn <target_range>
# Port scan
sudo nmap -sS -p- <target>
# Service detection
sudo nmap -sV -sC -p <ports> <target>
2. Vulnerability Scanning¶
# Nmap NSE vuln scripts
sudo nmap -sV -p <ports> --script "vuln" <target> -oA scan_results
# Specific CVE check
sudo nmap -sV -p <port> --script "http-vuln-cve2021-41773" <target>
3. Analysis¶
# Review results
cat scan_results.nmap
# Extract vulnerabilities
grep -i "VULNERABLE" scan_results.nmap
4. Manual Verification¶
# Verify findings with manual tools
curl -k "http://<target>/vulnerable/path"
# Test exploitability
searchsploit <service_name>
File Organization¶
Create a structured workspace:
mkdir -p ~/htb/{machines,writeups,tools}
mkdir -p ~/oscp/{scans,exploits,notes,scripts}
# Example structure:
~/oscp/
├── scans/
│ ├── nmap/
│ ├── nessus/
│ └── other/
├── exploits/
├── notes/
└── scripts/
Essential Commands Reference¶
Nmap Quick Reference¶
# Basic scan
nmap <target>
# TCP SYN scan (requires root)
sudo nmap -sS <target>
# Service/version detection
nmap -sV <target>
# OS detection
sudo nmap -O <target>
# All-in-one scan
sudo nmap -sV -sC -O -p- <target>
# Vuln scan
sudo nmap -sV --script "vuln" <target>
# Output to all formats
nmap <target> -oA output_name
Nessus Quick Reference¶
- Navigate to
https://localhost:8834 - New Scan → Select template
- Configure name and targets
- (Optional) Add credentials for authenticated scan
- Launch scan
- Review results when complete
- Export report (PDF/HTML/CSV)
Practice Exercises¶
Exercise 1: Port Scanning¶
- Scan a local VM or HTB machine
- Identify all open ports
- Determine service versions
- Document findings
Exercise 2: NSE Scripting¶
- Use the
vulncategory against a target - Identify at least one vulnerability
- Manually verify the finding
- Document the CVE and CVSS score
Exercise 3: Nessus Scanning¶
- Install Nessus Essentials
- Perform a basic network scan
- Review and categorize findings
- Generate a professional report
Common Issues and Solutions¶
Issue: Nmap No Results¶
Problem: Scan returns no open ports
Solutions:
# Check if host is up
ping <target>
# Try different scan types
sudo nmap -Pn <target> # Skip ping
sudo nmap -sT <target> # TCP connect scan
sudo nmap -A <target> # Aggressive scan
Issue: Nessus Won't Start¶
Problem: nessusd service fails
Solutions:
# Check status
sudo systemctl status nessusd
# Restart service
sudo systemctl restart nessusd
# Check logs
sudo journalctl -u nessusd -n 50
Issue: Permission Denied¶
Problem: Cannot run privileged scans
Solutions:
# Use sudo
sudo nmap -sS <target>
# Or add capabilities (advanced)
sudo setcap cap_net_raw,cap_net_admin=eip $(which nmap)
Next Steps¶
Now that your environment is ready:
- Read the Theory - Understand fundamental concepts
- Practice with Nmap - Learn NSE scripting
- Master Nessus - Comprehensive scanning
- Apply Knowledge - OSCP-specific strategies
Additional Resources¶
- Nmap Book: nmap.org/book
- NSE Documentation: nmap.org/nsedoc
- Tenable University: Free Nessus training
- OSCP Syllabus: offsec.com
Pro Tip
Create scripts to automate your scanning workflow. Example:
Remember
Always obtain proper authorization before scanning any systems. Practice only on:
- Your own systems
- Authorized lab environments (HTB, THM, VulnHub)
- Systems with explicit written permission