Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not displayed critical CVEs #7

Open
Ondrik8 opened this issue Oct 14, 2024 · 1 comment
Open

not displayed critical CVEs #7

Ondrik8 opened this issue Oct 14, 2024 · 1 comment

Comments

@Ondrik8
Copy link

Ondrik8 commented Oct 14, 2024

good afternoon here is the problem on kali linux double-checked on two hosts

host: 1 (first run after installation)
image

host: 2 (Previously the script worked and displayed critical CVEs, but after I upgraded the system this happened:)
image

@MidavSec
Copy link

MidavSec commented Oct 18, 2024

found a work around:

def do_critical(self, arg):
    'Get latest critical CVEs. Usage: critical'
    print()
    critical_log = log.progress("Looking for the latest critical CVEs")
    try:
        critical_url = requests.get("https://www.opencve.io/cve?cvss=critical&search=", headers=header)
        
        # New regex based on the HTML structure you provided
        criticals = re.findall(
            r'<a href="/cve/(CVE-\d{4}-\d+)">.*?</a>.*?<a href=.*?>(.*?)</a>.*?<a href=.*?>(.*?)</a>.*?(\d{4}-\d{2}-\d{2}).*?<span class="label label-critical">(\d+\.?\d*)\s*Critical</span>.*?<tr class="cve-summary">\s*<td.*?>(.*?)</td>',
            critical_url.text,
            re.DOTALL
        )

        critical_log.success(colorama.Fore.GREEN + "✓" + colorama.Style.RESET_ALL)
        
        # PrettyTable to format output
        x = PrettyTable()
        x.field_names = ["CVE", "CVSS", "Vendor", "Product", "Description", "Updated"]
        
        for critical in criticals:
            cve_id = critical[0]
            vendor = critical[1]
            product = critical[2]
            updated = critical[3]
            cvss = critical[4]
            description = critical[5][:100]  # Limit description length

            # Add row to the table
            x.add_row([cve_id, colorama.Fore.RED + cvss + colorama.Style.RESET_ALL, vendor[:20], product[:20], description, updated])

        print()
        print(x)
        print()
    except Exception as e:
        critical_log.failure(e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants