Giter Club home page Giter Club logo

better-cve-2022-29464's Introduction

Better CVE-2022-29464

Certain WSO2 products allow unrestricted file upload with resultant remote code execution. The attacker must use a /fileupload endpoint with a Content-Disposition directory traversal sequence to reach a directory under the web root, such as a ../../../../repository/deployment/server/webapps directory.

Usage

python3 main.py https://example.com shell.jsp

Replace https://example.com with the vulnerable server and shell.jsp with a filename you want to use for upload.

Edit shell.jsp file as you want, but current shell works just fine too (better than other JSP shells, at least).
This shell can harvest output from stdout and stderr. CMDs are ran using /bin/sh.

Exposure

Mostly, sysadmins run WSO2 products as superuser. Using this exploit, you'll have superuser permissions over the whole system.

Database files are located at ~/repository/database directory.

  • username: wso2carbon
  • password: wso2carbon
  • DBMS: H2 1.4.196

You can use the IntelliJ IDEA to open H2 type databases, like this.

Download files from the server

Using this exploit, you can copy any file from any directory to ~/repository/deployment/server/webapps/authenticationendpoint. authenticationendpoint directory serves JSP, but can be used to serve other files too.

Example:

cp ~/repository/database/WSO2CARBON_DB.h2.db ~/repository/deployment/server/webapps/authenticationendpoint/WSO2CARBON_DB.h2.db

This command will copy the main DB file to a directory we can use to download it from.

Vulnerable products

  • API Manager - 2.2.0 and above
  • Identity Server - 5.2.0 and above (tested)
  • Identity Server Analytics - 5.4.0, 5.4.1, 5.5.0, 5.6.0
  • Identity Server as Key Manager - 5.3.0 and above
  • Enterprise Integrator - 6.2.0 and above

Disclaimer

I'm not responsible for any kind of thermonuclear war or you getting arrested. Use this exploit in a testing environment only.

better-cve-2022-29464's People

Contributors

jimidk avatar

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.