Coder Social home page Coder Social logo

mrx6s0 / xss-keylogger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hadynz/xss-keylogger

0.0 2.0 0.0 172 KB

A keystroke logger to exploit XSS vulnerabilities in a site - for my personal Educational purposes only

License: MIT License

JavaScript 40.51% HTML 59.49%

xss-keylogger's Introduction

xss-keylogger

A simple keystroke logger that listens and sends all keystrokes for a user on a Cross-site scripting (XSS) vulnerable page to a remote dashboard page via websockets.

Demo

Introduction

The XSS Keylogger project is based on a client side script which is to be embedded in a a vulnerable page that listens to keystrokes on a page, and broadcasts it to an actively running Node server.

The client side script connects using a persistent websocket connection to the Node server. The Node server then in turn relays the information received to a remote monitoring dashboard which could optionally be running.

The remote monitoring dashboard is also able to send a JavaScript snippet that is run remotely on a XSS exploited web page that is being visited by an unsuspected user by piping it through eval().

Motivation

This project was created for XSS educational purposes and to raise awareness on how such a vulnerability can be exploited.

Important: This solution should not be used for any malicious or illegal purposes.

Setup

Install npm, the Node package manager, using the Homebrew package manager (or using any other means of getting npm installed. Once installed, run npm install to resolve and install project related dependencies.

brew install npm
npm install

Running

Run node index.js to start up the Node server. The server will run on port :3000 by default. The snooping client script will be available to access on the following URL:

http://localhost:3000/snoop.js

Demo Harness

To demonstrate this utility locally, point your browser to the following two URLs:

  • http://localhost:3000/innocent.html - a sample web page that has been exploited with the XSS keystroke logger client script. Any text typed on the input fields of this page will immediately be made broadcasted and made visible to a sample remote spy dashboard.

  • http://localhost:3000/monitor.html - a spy dashboard that logs all remote keystrokes from exploited clients.

From the spy dashboard, you can type and send a JavaScript snippet to run remotely in the context of the exploited client. Some tame code snippets that you can try:

// Show a popup remotely
alert("You've been Sn00ped!");

// Change background of client page to pink
document.body.style.background = 'pink';

Embedding Client Side script

A blog post write-up detailing how the keylogger can be embedded in a live XSS vulnerable site is coming soon.

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.