Giter Site home page Giter Site logo

vuln-nodejs-app's Introduction

Vulnerable NodeJS Application

License contributions welcome version

Vulnerable NodeJS application is developed for web application penetration testers, developers and secure code review. It can be easily deployed using docker or by manual install complete steps are provided below. this application will help you in learning how to find vulnerabilities in web applicaiton using black box, white box approach and in learning how to fix them.

How to use it?

  • Black box testing: Deploy the appplication using docker and start solving the exercises.
  • Secure code review: Manually install the application this will allow you to use debugger while solving the exercises and will help you in finding vulnerabilities in application code.
  • Developers: Identify vulnerabilities in application code & try to fix them.

Tech Stack

  • NodeJS
  • Application design pattern: MVC
  • Web framework: Express
  • Template Engine: EJS
  • SQL Database: MySQL
  • NoSQL Database: MongoDB
  • React to cover ReactJS exercise
  • JWT for authentication
  • GraphQL
  • Socket.IO
  • Docker

Preview

vuln-nodejs-app

Complete list of exercises

  1. Command Injection
  2. Insecure Deserialization
  3. SQL Injection
  4. XML external entity injection
  5. XSS
  6. Server Side Template Injection
  7. JWT weak secret
  8. Insecure direct object references
  9. SSRF via PDF generator
  10. postMessage XSS
  11. postMessage CSRF
  12. Information Disclosure using addEventListener
  13. CORS Information Disclosure
  14. CORS CSRF
  15. 2FA Insecure Implementation
  16. Cross-Site WebSocket Hijacking
  17. WebSocket XSS
  18. ReactJS href XSS
  19. React ref-innerHTML XSS
  20. NoSQL Injection
  21. GraphQL Information Disclosure
  22. GraphQL SQL Injection
  23. GraphQL CSRF
  24. GraphQL IDOR
  25. XSS using SVG file uplaod
  26. JSONP Injection
  27. NoSQL Javascript Injection

Installation

Using docker-compose

  1. Clone the repository.
git clone https://github.com/payatu/vuln-nodejs-app.git
cd ./vuln-nodejs-app
  1. Download and build the image.
docker-compose up --build -d
  1. Start the application.
docker-compose up -d  # Remove -d flag if you want to see logs

access the application http://localhost:9000

Manual install

  1. Clone the repository.
git clone https://github.com/payatu/vuln-nodejs-app.git
cd ./vuln-nodejs-app
  1. Create MySQL database.
$ mysql -u <mysql_user> -p

mysql> create database vuln_nodejs_app;
  1. Update your MySQL and MongoDB database username and password inside .env file.
DB_PORT=3306
DB_NAME=vuln_nodejs_app
DB_USER=vuln_nodejs_user
DB_PASS=passw0rd
HOST_PORT=9000
JWT_SECRET=secret
MONGODB_SERVER=localhost
MONGODB_ADMINUSERNAME=
MONGODB_ADMINPASSWORD=
  1. Install dependencies.
npm install
  1. Build React frontend.
npm run build
  1. Start the server
node server.js

You can now access the application at http://localhost:9000

Solutions

Available in markdown and pdf format.

PDF: solutions.pdf
Markdown: solutions.md

Contribution

Contributions are always appreciated and you can contribute in this project by following ways:

  • By adding more exercises.
  • By reporting issues or by solving open issues.
  • By making pull request it can be for anything (UI, New Feature, Fixing mistyped words etc)
  • Don't have time to code but have an idea of exercise open a issue and we will implement it.
  • By spreading the word about this project.
  • By doing write-up of exercise we will add your writeup in community write-ups section.

TODO:

  • Dockerize the application.
  • Add more vulnerabilites.
  • Use database to store user information.

Author

@tauh33dkhan

vuln-nodejs-app's People

Contributors

prakash-poatan avatar tauh33dkhan 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.