#!/bin/bash # Function to scrape CVE details from the NVD website function scrape_cve_details() { local cve_id="$1" local url="https://www.opencve.io/cve/$cve_id" # Use curl to fetch HTML content local html_content=$(curl -s "$url") # Extract severity and description using grep local severity=$(echo "$html_content" | grep -oP 'Severity.*?\s*\K[^<]+') local description=$(echo "$html_content" | grep -oP '

.*?\s*\K[^<]+') # Output severity and description echo "CVE: $cve_id" echo "Severity: $severity" echo "Description: $description" echo "-----------------------------" } # Check if at least one CVE is provided as an argument if [ "$#" -eq 0 ]; then echo "Usage: $0 CVE-2021-XXXXX [CVE-2021-YYYYY ...]" exit 1 fi # Loop through provided CVEs and scrape details for cve in "$@"; do scrape_cve_details "$cve" done