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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
sharker — シンプルで信頼性が高く、比較的高速なネットワークキャプチャ解析ツール。 | Kitploit
ツール/GitHubGitHub/synacktiv/sharker
パケットスニッフィングと分析パスワードクラッキング情報収集ウェブセキュリティネットワークセキュリティデジタルフォレンジック
GitHubsynacktiv/sharker

sharker

シンプルで信頼性が高く、比較的高速なネットワークキャプチャ解析ツール。

リポジトリを見る
3313ヶ月前Kitploit レビュー済み

人気

すべて見る →

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

すべてのツールを探索

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

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

Sharker: Wiresharkが終わったところから、私たちは始まる

Sharkerは、PCAPファイルやライブインターフェースから価値あるデータを抽出するための、強力で拡張可能なツールです。tshark のパワーを活用してネットワークキャプチャを効率的に解析し、柔軟なフィルタリングシステムを適用して、有益な情報を正確に特定・抽出します。

主な機能

  • 拡張可能なフィルタリング: Pythonベースのフィルタを作成して、ネットワークパケットからあらゆるデータを抽出できます。
  • 強力なフィルタリングエンジン: フィルタやフィルタカテゴリを選択的に有効/無効にして、分析を微調整し高速化できます。
  • 複数の入力ソース: .pcap ファイル、キャプチャのディレクトリ、さらにはインターフェースからのライブネットワークトラフィックを解析できます。
  • 柔軟な出力: 結果を整理されたテキストファイルに保存したり、コンソールに出力したり、その両方を行うことができます。

必要条件

  • tshark: Wiresharkのコマンドライン版であるtsharkは必須です。通常はシステムのパッケージマネージャからインストールできます(例: apt-get install tshark、brew install wireshark)。
  • Python 3
  • Pythonライブラリ: 必要なライブラリは requirements.txt にリストされており、pip/pipx でインストールできます。

インストール

Sharker は、pipx(推奨)または標準の pip と venv 環境を使用してインストールできます。

pipx を使用する(推奨)

root@kitploit:~
# Install from this repository
pipx install git+https://github.com/synacktiv/sharker.git

# Verify the installation
sharker -h

pip と venv を使用する

root@kitploit:~
# Clone the repository
git clone https://github.com/synacktiv/sharker.git
cd sharker

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Sharker
pip install .

# Verify the installation
sharker -h

使用方法

Sharker の基本的な構文は次のとおりです:

root@kitploit:~
sharker [OPTIONS] [PCAP_FILE(s)]

一般的なオプション

メインオプション

フィルタリングオプション

使用例

1. 単一のPCAPを解析して結果を保存する:

root@kitploit:~
sharker my_capture.pcap

これにより、heavy カテゴリを除くすべてのフィルタが実行され、出力は sharker_out/ ディレクトリに保存されます。creds カテゴリのフィルタは、標準出力にも出力されます。

2. すべてのフィルタを適用し、可能な限り高速に実行する:

root@kitploit:~
sharker -A -F my_captures.pcap

これにより、すべてのフィルタが適用され、すべてがファイルに出力されます。コンソールには結果は表示されません。

3. 資格情報に焦点を当ててPCAPのディレクトリを解析する:

root@kitploit:~
sharker -d /path/to/pcaps -c creds

このコマンドは、指定されたディレクトリ内のすべてのPCAPファイルを処理しますが、creds カテゴリのフィルタのみを実行します。

4. ライブトラフィックをキャプチャし、HTTP関連情報をコンソールに出力する:

root@kitploit:~
sudo sharker -i eth0 -c http -m console

これにより、eth0 インターフェースからトラフィックをキャプチャし、http カテゴリのフィルタのみを実行して、すべての結果をターミナルに直接出力します。

5. 利用可能なすべてのフィルタを一覧表示する:

root@kitploit:~
sharker -L

ヘルプ出力

クリックして完全なヘルプ出力を表示
root@kitploit:~
$ sharker -h
Usage: sharker [OPTIONS] [PCAP[ PCAP[ ...]]

  Sharker: A reasonably fast network protocol analysis tool with extensible
  filters.

Options:
  Input Source:
    -d, --pcap-dir DIR            Path to a directory containing PCAP files to
                                  parse.
    -i, --interface IFACE         Network interface to capture live data from
                                  (e.g., eth0, wlan0).
  Output Handling:                By default, everything is written to file,
                                  and only creds category is printed to
                                  console. For very large PCAPs, advised to
                                  disable console output or at least colors,
                                  since it slows down the parsing.
    -m, --output-mode [file|console|both|develop]
                                  Which output mode to enable.  [default:
                                  both]
    -u, --unique                  Output only unique results, will gradually
                                  take more and more RAM.
    -F, --fast                    Fastest configuration (do not affect filter
                                  selection).
  Output file mode:
    -o, --output-dir DIR          Output directory.
    -op, --output-prefix NAME     Prefix to use for the output files, defaults
                                  to the PCAP/interface name.
  Output console mode:
    -P                            Send all filters to console (default in
                                  console output mode).
    -C                            Do not use colors in console output, will
                                  speed up sharker when lot of stuff is
                                  printed.
    -pf FILT[,FILT[...]]          Send specific filters output to console.
    -xpf FILT[,FILT[...]]         Do not send specific filters to console.
    -pc CAT[,CAT[...]]            Send specific filter categories to console.
    -xpc CAT[,CAT[...]]           Do not send specific categories to console.
    -nwf FILT[,FILT[...]]         Do not write filters output to file.
    -nwc CAT[,CAT[...]]           Do not write filter categories to file.
  Filter Selection:
    -A, --all                     Enable all filters, will be slower.
    -f, --filters FILT[,FILT[...]]
                                  Only run specified filters.
    -nf, --not-filters FILT[,FILT[...]]
                                  Exclude specified filters.
    -c, --categories CAT[,CAT[...]]
                                  Only run specified categories of filters.
    -nc, --not-categories CAT[,CAT[...]]
                                  Exclude specified categories of filters.
  Filter Information:
    -l, --list-filters            List filters that would be active with
                                  current filtering options.
    -L, --list-all-filters        List all available filters.
    -Lc, --list-all-filter-categories
                                  List all available filter categories.
  Debugging:
    -v, --verbose                 Verbose mode.
  -h, --help                      Show this message and exit.

フィルタシステム

Sharker のパワーは、sharker/filters/ ディレクトリにあるフィルタにあります。各フィルタは Python クラスであり、以下を定義します:

  • name: フィルタの一意の名前です。
  • description: フィルタが何を行うかの簡単な説明です。
  • pcap_filter: このフィルタに関連するパケットを選択するための tshark 表示フィルタです。
  • categories: フィルタが属するカテゴリのリストです(例: creds、dns、http)。heavy は、多数のパケットに一致するフィルタや、低速な処理を行うフィルタに使用できます。
  • mandatory_selectors および optional_selectors: 対象データを識別するためにパケットの JSON 表現内で探すキーです。フィルタに parser 関数が定義されていない場合、Sharker はこれらの属性を使用してデータを出力します。
  • parser(): パケットデータを処理し、抽出した情報を返す関数です。

デフォルトでは、Sharker は heavy カテゴリを除くすべてのフィルタを実行します。この動作は、-c、-nc、-f、-nf オプションでカスタマイズできます。

クリックしてNTLMハッシュ抽出の例を表示
root@kitploit:~
from .base import FilterConfigBase


class FilterConfig(FilterConfigBase):
    name = 'ntlmssp'
    description = 'Extract Net-NTLM hashes for cracking purposes'

    categories = [
        'creds',
        'windows'
    ]

    pcap_filter = 'gss-api || ntlmssp'

    mandatory_selectors = [
        'ntlmssp'
    ]

    def __init__(self, *args, **kwargs):
        self.challenges = {}
        super().__init__(*args, **kwargs)

    def parser(self, data):
        tcp_conn = data['tcp.stream'][0]
        msg_type = int(data['ntlmssp.messagetype'][0], 16) if 'ntlmssp.messagetype' in data else 0

        if msg_type == 1:
            # NTLM NEGOTIATE: nothing to do
            pass
        elif msg_type == 2:
            # NTLM CHALLENGE
            self.challenges[tcp_conn] = data['ntlmssp.ntlmserverchallenge'][0].replace(':', '')
        elif msg_type == 3:
            if tcp_conn not in self.challenges:
                self.log.error('Found an NTLM message type 3 (AUTH), but no type 2 (CHALLENGE) was received beforehand -> check in pcap if the challenge was not sent in an unsupported by tshark manner from the server, like in a Proxy-Authenticate HTTP header.')
                return 0

            ntresp = data['ntlmssp.auth.ntresponse'][0].replace(':', '')
            lmresp = data['ntlmssp.auth.lmresponse'][0].replace(':', '')
            user = data['ntlmssp.auth.username'][0]
            domain = data['ntlmssp.auth.domain'][0]
            workstation = data['ntlmssp.auth.hostname'][0]

            ntlm_hash = ''
            if len(ntresp) == 24 * 2:
                # NTLMv1 response
                if domain != '':
                    ntlm_hash = f'{user}::{domain}:{lmresp}:{ntresp}:{self.challenges[tcp_conn]}'
                else:
                    ntlm_hash = f'{user}::{workstation}:{lmresp}:{ntresp}:{self.challenges[tcp_conn]}'
            else:
                # NTLMv2 response
                if domain != '':
                    ntlm_hash = f'{user}::{domain}:{self.challenges[tcp_conn]}:{ntresp[:32]}:{ntresp[32:]}'
                else:
                    ntlm_hash = f'{user}::{workstation}:{self.challenges[tcp_conn]}:{ntresp[:32]}:{ntresp[32:]}'

            del self.challenges[tcp_conn]
            self.output(ntlm_hash)
            return 1

        return 0

開発

Sharker に貢献したい場合や独自のフィルタを開発したい場合は、開発環境をセットアップできます。

root@kitploit:~
# Clone the repository
git clone https://github.com/synacktiv/sharker.git
cd sharker

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate

# Install in editable mode
pip install -e .

# Now you can run sharker and your changes will be reflected immediately
sharker -h

新しいフィルタの作成

  1. sharker/filters/ ディレクトリに新しいPythonファイルを作成します。
  2. そのファイル内に、FilterConfigBase(sharker/filters/base.py で定義)を継承するクラスを作成します。
  3. 必要な属性(name、description、pcap_filter など)を定義します。
  4. 必要なデータを抽出するために parser() メソッドを実装します。
    • 出力するデータを self.output メソッドに渡して呼び出します。
  5. Sharker は新しいフィルタを自動的に検出して読み込みます。

インスピレーションと参考

このプロジェクトは、以下の素晴らしいオープンソースプロジェクトの作業に触発されました:

  • PCredz
  • CredSLayer
  • Wireshark captures
ツールをダウンロード
オプション説明
-i, --interface <IFACE>ネットワークインターフェースからライブトラフィックをキャプチャします(例: eth0)。
-d, --pcap-dir <DIR>ディレクトリ内のすべてのPCAPファイルを解析します。
-o, --output-dir <DIR>出力ファイルのディレクトリを指定します(デフォルト: ./sharker_out)。
-m, --output-mode <MODE>出力モードを設定します: file、console、both、または develop(デフォルト: both)。
-u, --unique一意な結果のみを出力します。
-F, --fast最速の設定(フィルタの選択には影響しません)。
-A, --allすべてのフィルタを有効にします。遅くなります。
オプション説明
-c, --categories <CATS>実行するフィルタカテゴリのカンマ区切りリスト(例: creds,http)。
-nc, --not-categories <CATS>除外するフィルタカテゴリのカンマ区切りリスト(例: heavy)。デフォルトでは、heavy は除外されます。
-f, --filters <FILTERS>実行する特定のフィルタのカンマ区切りリスト。
-nf, --not-filters <FILTERS>除外する特定のフィルタのカンマ区切りリスト。
-L, --list-all-filters利用可能なすべてのフィルタとその説明の一覧を表示します。
-Lc, --list-all-filter-categories利用可能なすべてのフィルタカテゴリの一覧を表示します。
-l, --list-filters現在のコマンドラインオプションで有効になるフィルタを表示します。
-v, --verboseデバッグ用の詳細ログを有効にします。