Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: cve_2016_4171_flash.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- # Vulnerability Source: https://nvd.nist.gov/vuln/detail/CVE-2016-4171
- """
- Description:
- This script checks for the presence of vulnerable Adobe Flash Player configurations on the user's machine
- in relation to the CVE-2016-4171 vulnerability. It retrieves a list of installed software using the WMI module
- and compares it with a predefined list of vulnerable Adobe Flash Player configurations associated with the CVE.
- If any vulnerable configurations are found, it displays a warning message to prompt the user to take
- immediate action to mitigate the vulnerability.
- Requirements:
- - Python 3.x: The script is written in Python 3 and requires a Python interpreter of version 3 or higher to run.
- - WMI Module: The script uses the WMI module to interact with the Windows Management Instrumentation (WMI) API
- to retrieve a list of installed software on a Windows system. Ensure that the WMI module is installed.
- You can install it using pip: `pip install WMI`.
- Usage:
- 1. Ensure Python 3.x is installed on your system.
- 2. Install the WMI module by running `pip install WMI`.
- 3. Run the script using the command `python cve_2016_4171_flash.py`.
- 4. The script will verify if any vulnerable Adobe Flash Player configurations are installed on your machine
- and provide instructions for mitigation if necessary.
- Functions:
- - get_installed_software(): Retrieves a list of installed software on the user's machine using the WMI module.
- - check_for_vulnerabilities(): Compares the list of installed software with a predefined list of vulnerable
- Adobe Flash Player configurations and displays a warning message if any vulnerable configurations are found.
- Important Notes:
- - The predefined list of vulnerable Adobe Flash Player configurations in this script corresponds to the CVE-2016-4171 vulnerability.
- """
- import wmi
- def get_installed_software():
- """
- Retrieves a list of installed software on the user's machine using the WMI module.
- Returns:
- list: A list containing the names of installed software.
- """
- c = wmi.WMI()
- installed_software = []
- for item in c.Win32_Product():
- installed_software.append(item.Caption)
- return installed_software
- def check_for_vulnerabilities():
- """
- Compares the list of installed software with a predefined list of vulnerable Adobe Flash Player configurations
- and displays a warning message if any vulnerable configurations are found.
- """
- installed_software = get_installed_software()
- vulnerable_flash_versions = [
- "Adobe Flash Player 21.0.0.242",
- "Adobe Flash Player for Linux up to (including) 11.2.202.621 running on/with Linux Kernel",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Apple MacOS X",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Microsoft Windows",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Google Chrome OS",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Microsoft Internet Explorer up to (including) 21.0.0.242 running on/with Microsoft Windows 8.1",
- "Adobe Flash Player up to (including) 18.0.0.352 running on/with Apple MacOS X",
- "Adobe Flash Player up to (including) 18.0.0.352 running on/with Microsoft Windows",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Microsoft Edge up to (including) 21.0.0.242 running on/with Microsoft Windows 10",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Redhat Enterprise Linux Desktop 5.0, 6.0",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Redhat Enterprise Linux Server 5.0, 6.0",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Redhat Enterprise Linux Workstation 5.0, 6.0",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with OpenSuse 13.1, 13.2",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Suse Linux Enterprise Desktop 12, 12 SP1",
- "Adobe Flash Player up to (including) 21.0.0.242 running on/with Suse Linux Enterprise Workstation Extension 12, 12 SP1"
- ]
- vulnerable_installed = [software for software in installed_software if software in vulnerable_flash_versions]
- if vulnerable_installed:
- print("\nWarning:\nThe following vulnerable Adobe Flash Player configurations are installed on your machine:")
- for software in vulnerable_installed:
- print("- " + software)
- print("\nPlease take immediate action to mitigate the vulnerability by applying updates per vendor instructions.\n")
- else:
- print("\nAll clear!\nNone of the vulnerable Adobe Flash Player configurations are installed on your machine.\n")
- if __name__ == "__main__":
- print("Verifying vulnerable Adobe Flash Player configurations...")
- check_for_vulnerabilities()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement