Advertisement
Python253

cve_2024_21412_windows_shortcut

Apr 9th, 2024
1,126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.37 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Filename: cve_2024_21412_windows_shortcut.py
  4. # Version: 1.0.0
  5. # Author: Jeoi Reqi
  6. # Vulnerability Source: https://nvd.nist.gov/vuln/detail/CVE-2024-21412
  7.  
  8. """
  9. Description:
  10. This script checks for the presence of vulnerable configurations related to the CVE-2024-21412 Internet Shortcut Files Security Feature Bypass vulnerability.
  11. It retrieves the Windows version and compares it with a predefined list of affected software configurations.
  12. If the Windows version is found to be vulnerable, it displays a warning message. Otherwise, it indicates that the system is not vulnerable.
  13.  
  14. Requirements:
  15. - Python 3.x
  16.  
  17. Usage:
  18. Run the script using the command `python cve_2024_21412_windows.py`.
  19.  
  20. Functions:
  21. - get_windows_version(): Retrieves the version of the installed Windows operating system.
  22. - check_for_vulnerabilities(): Compares the Windows version with a predefined list of affected software configurations and displays a warning message if necessary.
  23.  
  24. Important Notes:
  25. - The predefined list of affected software configurations corresponds to the CVE-2024-21412 Internet Shortcut Files Security Feature Bypass vulnerability.
  26. """
  27.  
  28. import platform
  29.  
  30. def get_windows_version():
  31.     """
  32.    Retrieves the version of the installed Windows operating system.
  33.    
  34.    Returns:
  35.        str: A string representing the Windows version.
  36.    """
  37.     return platform.win32_ver()[0]
  38.  
  39. def check_for_vulnerabilities():
  40.     """
  41.    Compares the Windows version with a predefined list of affected software configurations
  42.    and displays a warning message if the system is found to be vulnerable.
  43.    """
  44.     windows_version = get_windows_version()
  45.     vulnerable_versions = [
  46.         "10.0.17763.5458", "10.0.19044.4046", "10.0.19045.4046",
  47.         "10.0.22000.2777", "10.0.22621.3155", "10.0.22631.3155",
  48.         "10.0.25398.709"
  49.     ]
  50.     if windows_version in vulnerable_versions:
  51.         print("\nWarning:\nYour Windows version ({}) is vulnerable to the Internet Shortcut Files Security Feature Bypass vulnerability.".format(windows_version))
  52.     else:
  53.         print("\nAll clear!\nYour Windows version ({}) is not vulnerable to the Internet Shortcut Files Security Feature Bypass vulnerability.\n".format(windows_version))
  54.  
  55. if __name__ == "__main__":
  56.     print("Verifying vulnerable configurations...")
  57.     check_for_vulnerabilities()
  58.  
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement