Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: cve_2024_29745_pixel_information_disclosure.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- # Vulnerability Source: https://nvd.nist.gov/vuln/detail/CVE-2024-29745
- """
- Description:
- This script checks if the system is affected by CVE-2024-29745, an information disclosure vulnerability in Android Pixel devices.
- The vulnerability allows for local information disclosure due to uninitialized data, without requiring additional execution privileges.
- The script retrieves the system's configuration and compares it with the affected software configuration mentioned in the CVE details.
- If they match, it indicates that the system is affected, and mitigations per vendor instructions or discontinuation of product use are recommended.
- Requirements:
- - Python 3.x
- - Android Pixel
- Usage:
- Execute the script using `python cve_2024_29745_pixel_information_disclosure.py`.
- Functions:
- - get_system_configuration(): Retrieves the system's configuration as a Common Platform Enumeration (CPE) string.
- - check_vulnerability(system_configuration, affected_configuration): Checks if the system is affected by the vulnerability.
- Important Notes:
- - The system configuration is determined based on the platform information retrieved using the `platform` module.
- - The affected software configuration mentioned in the CVE details is hardcoded in the script for comparison.
- """
- import platform
- def get_system_configuration():
- """
- Retrieves the system's configuration as a Common Platform Enumeration (CPE) string.
- This function returns the Android version of a Google Pixel device.
- """
- # Retrieve the system's platform information
- platform_info = platform.platform()
- # Check if the platform information contains 'Android' and 'Pixel'
- if 'Android' in platform_info and 'Pixel' in platform_info:
- # Return the system configuration as a CPE string
- return "cpe:2.3:o:google:android:-:*:*:*:*:*:*:*"
- else:
- # Return None if the system configuration does not match the desired format
- return None
- def check_vulnerability(system_configuration, affected_configuration):
- """
- Checks if the system is affected by the vulnerability.
- """
- if system_configuration == affected_configuration:
- print("The system is affected by CVE-2024-29745.")
- print("Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.")
- else:
- print("The system is not affected by CVE-2024-29745.")
- # Get the system configuration
- system_configuration = get_system_configuration()
- # Define the affected software configuration
- affected_configuration = "cpe:2.3:o:google:android:-:*:*:*:*:*:*:*"
- # Check vulnerability
- if system_configuration:
- check_vulnerability(system_configuration, affected_configuration)
- else:
- print("Unable to retrieve system configuration.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement