Cyber Services / All lessons / CEH — Ethical Hacking / Vulnerability Scoring System and Database

Vulnerability Scoring System and Database

Module 24 of 130 · 9 min read · Free to read

MODULES ↓ Command blocks have a COPY button

Decoding CWE, CVE, NVD, and CVSS for Effective Ethical Hacking

The Need for Standardization in Vulnerability Management

The cybersecurity landscape is flooded with information about software flaws, weaknesses, and exploits. To effectively manage risk, communicate findings, and prioritize remediation, the industry relies on a standardized ecosystem for identifying, classifying, and scoring vulnerabilities. Understanding these key components is fundamental for any security professional, especially Certified Ethical Hackers.

CWE - Common Weakness Enumeration: The 'What' and 'Why' of Flaws

Definition:
CWE™ is a formal list or dictionary of common software and hardware weakness types. Maintained by MITRE, it serves as a common language for describing the *root causes* of vulnerabilities, focusing on flaws in architecture, design, code, or implementation that can lead to exploitable security issues.
Purpose:
To provide a standard taxonomy for identifying and categorizing weaknesses. It aims to help developers prevent flaws during coding and aids security practitioners in understanding the *nature* of vulnerabilities found during assessments.
Key Characteristics:
Hierarchical structure (categories like "Improper Input Validation," specific weaknesses like "SQL Injection" - CWE-89, "Cross-Site Scripting" - CWE-79), focus on the *type* of flaw, not a specific instance in a product.
CEH Relevance:
Understanding CWE helps ethical hackers recognize common patterns of vulnerabilities during code review or testing. It provides a framework for discussing the *types* of weaknesses discovered and informs secure coding best practices, which CEHs often advise on.

CVE - Common Vulnerabilities and Exposures: The 'Which' Specific Instance

Definition:
CVE® is a system providing unique identifiers (CVE-YYYY-NNNNN format) for publicly disclosed cybersecurity vulnerabilities. Also maintained by MITRE, each CVE ID refers to one specific vulnerability in a particular version of a specific product or library.
Purpose:
To provide a standard, unambiguous way to *reference* a distinct vulnerability across different tools, databases, advisories, and security reports. It facilitates communication and data correlation.
Key Characteristics:
Unique ID per vulnerability instance, vendor/researcher disclosure coordination, focuses on a *specific flaw in a specific product*. Does *not* include severity scoring or detailed technical analysis itself (that's where NVD comes in).
CEH Relevance:
CVE IDs are the primary way ethical hackers search for exploits (e.g., in Metasploit, Exploit-DB). They are essential for tracking vulnerability remediation, referencing findings in penetration test reports, and correlating data from different scanning tools.

NVD - National Vulnerability Database: The 'How Bad' and 'Where'

Definition:
The NVD is the U.S. government's repository of vulnerability management data, built upon and synchronized with the CVE list. Maintained by NIST, it *enriches* CVE data with additional analysis and context.
Purpose:
To provide detailed information and analysis for CVE-identified vulnerabilities, enabling standardized vulnerability management across government and industry.
Key Characteristics:
Provides CVSS severity scores, impact metrics, vulnerability type categorizations (CWE mappings), applicability statements (affected software configurations via CPE - Common Platform Enumeration), fix information, and links to external references/advisories.
CEH Relevance:
NVD is the go-to source for understanding the *severity* and *impact* of a specific CVE. Ethical hackers use NVD data (especially CVSS scores) to prioritize vulnerabilities found during assessments, gauge potential risk, and justify the importance of remediation efforts to clients or management. Many vulnerability scanners use NVD data.

CVSS - Common Vulnerability Scoring System: The Severity Score

Definition:
CVSS is an open industry standard framework (currently CVSS v3.1, managed by FIRST.org) for assessing the characteristics and severity of software vulnerabilities and assigning a numerical score (0.0-10.0) reflecting their potential impact.
Purpose:
To provide a standardized, transparent, and repeatable method for rating vulnerability severity, enabling organizations to prioritize responses and resources effectively.
Key Characteristics:
  • Base Score Group: Represents the intrinsic qualities of a vulnerability (exploitability metrics like Attack Vector, Attack Complexity, Privileges Required, User Interaction; impact metrics like Confidentiality, Integrity, Availability). This is the score most commonly cited.
  • Temporal Score Group: Modifies the Base score based on time-related factors (exploit code maturity, remediation level, report confidence).
  • Environmental Score Group: Allows organizations to customize the score based on their specific environment (mitigating controls, specific asset importance).
CEH Relevance:
CVSS scores are fundamental for risk assessment and reporting. Ethical hackers must understand how scores are calculated (at least the Base metrics conceptually) to interpret vulnerability scanner results accurately, prioritize findings in penetration test reports, and communicate the urgency of remediation based on quantifiable severity.

Severity Ranges (CVSS v3.x):

  • 0.0: None
  • 0.1 - 3.9: Low
  • 4.0 - 6.9: Medium
  • 7.0 - 8.9: High
  • 9.0 - 10.0: Critical

The Interplay: How They Work Together

Connecting the Dots:
  1. A Weakness Type (e.g., SQL Injection) is cataloged in CWE.
  2. A Specific Vulnerability (e.g., SQL Injection in CoolApp v1.2's login page) is identified and assigned a unique CVE ID.
  3. The NVD ingests the CVE, analyzes it, maps it back to relevant CWEs, identifies affected products (CPE), provides references, and calculates a CVSS Base Score.
  4. The CVSS score provides a standardized measure of the vulnerability's severity, aiding prioritization.

Ethical hackers use this entire ecosystem to understand, identify, prioritize, and exploit (or recommend remediation for) vulnerabilities.

Practical Application: Metasploit Vulnerability Intelligence Activities

Theory is essential, but practical application solidifies understanding. These activities demonstrate how to leverage Metasploit to interact with the vulnerability ecosystem concepts discussed (CVE, NVD, CVSS, CWE).

Activity 1: Deep Dive into a Known Vulnerability (MS17-010 / EternalBlue)

Objective: Utilize Metasploit and external resources to fully profile the infamous EternalBlue vulnerability, linking CVE, module information, and NVD data.

Scenario: You suspect a Windows 7 machine in your lab (192.168.1.150) might be vulnerable to MS17-010.

  1. Start Metasploit & Verify Database

    $ msfconsole
    msf6 > db_status
  2. Scan for the Specific Vulnerability (Auxiliary Module)

    Before attempting exploitation, confirm the vulnerability using the dedicated scanner.

    msf6 > use auxiliary/scanner/smb/smb_ms17_010
    msf6 auxiliary(scanner/smb/smb_ms17_010) > set RHOSTS 192.168.1.150 # Set target IP
    msf6 auxiliary(scanner/smb/smb_ms17_010) > run

    Observe the output. A "[+] Likelihood: Vulnerable" message indicates a high probability.

  3. Find Exploits via CVE

    The primary CVE is CVE-2017-0144.

    msf6 > search cve:2017-0144 type:exploit

    Note the available exploit modules, like exploit/windows/smb/ms17_010_eternalblue and exploit/windows/smb/ms17_010_psexec.

  4. Analyze Exploit Module Details

    Select the 'eternalblue' variant for analysis.

    msf6 > use exploit/windows/smb/ms17_010_eternalblue
    msf6 exploit(windows/smb/ms17_010_eternalblue) > info

    Focus Areas in Output:

    • References Section: Confirm CVE-2017-0144 is listed. Note other related CVEs (0143, 0145, 0146, 0148) and the MSB (MS17-010). These are crucial for cross-referencing. Note the URLs provided for deeper research.
    • Rank: Note the 'Excellent' rank, indicating high reliability.
    • Description: Understand the summary of the SMBv1 vulnerability exploited.
    • Platform/Arch: Confirm it targets Windows.
  5. External NVD Lookup & Correlation

    Open a browser and navigate to the NVD page for CVE-2017-0144 (https://nvd.nist.gov/vuln/detail/CVE-2017-0144).

    • CVSS Score: Identify the CVSS v3.x Base Score (e.g., 9.8 Critical). Understand *why* it's critical by looking at the Base Metrics (Attack Vector: Network, Privileges Required: None, User Interaction: None, Impact: High C/I/A).
    • CWE Link: Find the associated Weakness ID (e.g., CWE-416 Use After Free, or others depending on specific analysis path). Click the CWE link to understand the *type* of coding flaw.
    • CPEs: Review the Common Platform Enumeration list to see the specific Windows versions officially listed as vulnerable.
CEH Takeaway (Activity 1): This demonstrates the end-to-end intelligence workflow: Scan Confirmation -> CVE Search -> Metasploit Module Analysis (References) -> NVD Lookup (CVSS Severity, CWE Type, CPE Applicability). This structured approach is vital for reporting and risk assessment.
Activity 2: Searching by Product/Version & Analyzing Results

Objective: Simulate finding a vulnerability based on a specific software version identified during reconnaissance and trace it through the ecosystem.

Scenario: During scanning (e.g., Nmap import), you identified a server (192.168.1.180) running "Apache Struts 2.3.34".

  1. Search Metasploit by Product Name

    msf6 > search struts type:exploit

    This yields many results. Refine the search if possible (though version searching isn't always precise in Metasploit `search`). A well-known Struts RCE is CVE-2017-5638.

  2. Search Metasploit by Known CVE for that Version

    Assume external research linked Struts 2.3.34 to CVE-2017-5638.

    msf6 > search cve:2017-5638

    Identify relevant modules like exploit/multi/http/struts2_content_type_ognl.

  3. Get Module Information

    msf6 > info exploit/multi/http/struts2_content_type_ognl

    Focus Areas in Output:

    • Check the **References** for CVE-2017-5638.
    • Read the **Description** to understand it involves OGNL injection via the Content-Type header.
    • Note the **Targets** might be automatic or require selection.
  4. External NVD Lookup

    Visit the NVD page for CVE-2017-5638 (https://nvd.nist.gov/vuln/detail/CVE-2017-5638).

    • Find the **CVSS v3.x Score** (e.g., 10.0 Critical). Analyze the vector string to see why (Network exploitable, No privileges/interaction needed, High C/I/A impact).
    • Identify the **CWE** (e.g., CWE-502 Deserialization of Untrusted Data, potentially linked from OGNL injection).
    • Review the **Description** and **References** for technical details.
CEH Takeaway (Activity 2): Reinforces using CVEs found via product version research. Demonstrates how critical severity scores (CVSS 10.0) arise from easily exploitable, high-impact vulnerabilities. Shows mapping to CWE provides insight into the vulnerability *class*.
Activity 3: Leveraging the Metasploit Database (`vulns` command)

Objective: Demonstrate how importing scan data populates the `vulns` database and how this can streamline vulnerability research within Metasploit.

Scenario: You have already imported an Nmap XML scan (full_scan.xml) containing results for several hosts, including potential vulnerabilities identified by Nmap's NSE scripts.

  1. List Hosts and Services (Recap)

    msf6 > hosts      # See imported hosts
    msf6 > services   # See discovered services
  2. Query the Vulnerabilities Database

    msf6 > vulns

    This command lists vulnerabilities associated with hosts in the current workspace, often populated by imported scans or specific Metasploit vulnerability scanners. Observe the columns:

    • Timestamp: When the vuln was added.
    • Host: The affected IP address.
    • Name: Often includes the CVE ID or scanner finding (e.g., "MS17-010 SMB RCE Detection", "VNC Authentication None").
    • References: Crucially, often lists direct CVE IDs or other references (MSB, BID).
    • Sometimes (depending on importer/scanner) you might see CVSS scores here too.
  3. Filtering Vulnerabilities

    # Show vulns only for a specific host
    msf6 > vulns -a 192.168.1.150
    
    # Show vulns related to a specific service name (e.g., smb)
    msf6 > vulns -s smb
    
    # Search vuln names/refs for a keyword
    msf6 > vulns -S MS17-010
    
    # Show specific columns including references
    msf6 > vulns -c host,name,refs
  4. Linking Vulns to Modules

    While `vulns` doesn't directly launch exploits, identifying the CVEs/names listed allows you to immediately pivot to the `search` command, as shown in previous activities.

    # Example: vulns output shows CVE-2017-0144 for 192.168.1.150
    msf6 > search cve:2017-0144 # Leads directly to relevant modules
CEH Takeaway (Activity 3): Demonstrates the power of integrating external scan data. Using the `vulns` command provides a centralized view of potential issues linked to specific hosts within your engagement workspace, making the process of identifying CVEs and finding corresponding Metasploit modules much more efficient.

Activity Summary: By completing these activities, students gain hands-on experience searching for vulnerabilities using different criteria (CVE, product), interpreting module information, correlating findings with external NVD data (CVSS, CWE), and leveraging Metasploit's database capabilities. This practical application reinforces the theoretical concepts of the vulnerability ecosystem.

Conclusion: Integrating Knowledge for Effective Security Assessment

Understanding the roles and interplay of CWE, CVE, NVD, and CVSS transforms vulnerability data from a confusing list into actionable intelligence. For the Certified Ethical Hacker, these systems are not just academic concepts; they are essential tools for navigating the vulnerability landscape, communicating effectively, prioritizing risks, and conducting thorough, professional security assessments using frameworks like Metasploit.

Modules (130) ← CEH — Ethical Hacking