Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: cve_2024_21412_windows_shortcut.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- # Vulnerability Source: https://nvd.nist.gov/vuln/detail/CVE-2024-21412
- """
- Description:
- This script checks for the presence of vulnerable configurations related to the CVE-2024-21412 Internet Shortcut Files Security Feature Bypass vulnerability.
- It retrieves the Windows version and compares it with a predefined list of affected software configurations.
- If the Windows version is found to be vulnerable, it displays a warning message. Otherwise, it indicates that the system is not vulnerable.
- Requirements:
- - Python 3.x
- Usage:
- Run the script using the command `python cve_2024_21412_windows.py`.
- Functions:
- - get_windows_version(): Retrieves the version of the installed Windows operating system.
- - check_for_vulnerabilities(): Compares the Windows version with a predefined list of affected software configurations and displays a warning message if necessary.
- Important Notes:
- - The predefined list of affected software configurations corresponds to the CVE-2024-21412 Internet Shortcut Files Security Feature Bypass vulnerability.
- """
- import platform
- def get_windows_version():
- """
- Retrieves the version of the installed Windows operating system.
- Returns:
- str: A string representing the Windows version.
- """
- return platform.win32_ver()[0]
- def check_for_vulnerabilities():
- """
- Compares the Windows version with a predefined list of affected software configurations
- and displays a warning message if the system is found to be vulnerable.
- """
- windows_version = get_windows_version()
- vulnerable_versions = [
- "10.0.17763.5458", "10.0.19044.4046", "10.0.19045.4046",
- "10.0.22000.2777", "10.0.22621.3155", "10.0.22631.3155",
- "10.0.25398.709"
- ]
- if windows_version in vulnerable_versions:
- print("\nWarning:\nYour Windows version ({}) is vulnerable to the Internet Shortcut Files Security Feature Bypass vulnerability.".format(windows_version))
- else:
- print("\nAll clear!\nYour Windows version ({}) is not vulnerable to the Internet Shortcut Files Security Feature Bypass vulnerability.\n".format(windows_version))
- if __name__ == "__main__":
- print("Verifying vulnerable configurations...")
- check_for_vulnerabilities()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement