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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
xtor | Kitploit
ツール/GitHubGitHub/khalidelborai/xtor
スクリプトと自動化ネットワークセキュリティプライバシーユーティリティとフレームワーククローラー
GitHubkhalidelborai/xtor

xtor

リポジトリを見るウェブサイト
116ヶ月前未レビュー

人気

すべて見る →

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

すべてのツールを探索

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

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

xtor

Tor インスタンスをプログラムから管理するための Python ライブラリ。

PyPI version Python 3.10+ License: GPL-3.0-or-later CI

特徴

  • 新しい Tor プロセスの起動、または既存のプロセスへの接続
  • SOCKS5 プロキシ付きの事前設定済み httpx クライアント(同期 + 非同期)
  • 新しい IP の待機オプション付き ID ローテーション
  • トラフィック分離のためのストリーム分離
  • サーキットとストリームの管理
  • 出口ノード情報(国、帯域幅、フラグ)
  • 一時的な隠れサービス(.onion)
  • イベントリスナー(サーキット、ストリーム、帯域幅イベント)
  • ラウンドロビンとランダム選択で複数インスタンスを管理する TorPool
  • CLI 管理付き名前付きインスタンス
  • 正確なエラーハンドリングのためのカスタム例外階層

インストール

前提条件

Linux (Debian/Ubuntu):

root@kitploit:~
sudo apt-get install tor obfs4proxy

Windows:

torproject.org から Tor Expert Bundle をダウンロードしてください。

Python パッケージ

root@kitploit:~
pip install xtor
# or
uv add xtor

クイックスタート

root@kitploit:~
from xtor import Tor

with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    print(f"Connected through IP: {tor.ip}")
    resp = tor.client.get("https://api.ipify.org")
    print(resp.text)

使い方

新しい Tor プロセスを起動する

root@kitploit:~
from xtor import Tor
from xtor.exceptions import TorNotFoundError, PortInUseError

try:
    with Tor.start(port=9052, control_port=9053, host="127.0.0.1", password="mypass") as tor:
        print(tor.ip)
        resp = tor.client.get("https://api.ipify.org")
        print(resp.text)
except TorNotFoundError:
    print("Tor not found on PATH")
except PortInUseError as e:
    print(f"Port in use: {e}")

注記: 後方互換性のため、Tor.start() のエイリアスとして Tor.startTor() を利用できます。

既存のインスタンスに接続する

root@kitploit:~
with Tor(password="mypass", port=9050, control_port=9051) as tor:
    print(tor.ip)

新しい ID

root@kitploit:~
with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    print(tor.ip)
    tor.new_identity(wait=True, timeout=30)
    print(tor.ip)  # New IP

非同期クライアント

root@kitploit:~
import asyncio
from xtor import Tor

async def main():
    with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
        async with tor.async_client as client:
            resp = await client.get("https://api.ipify.org")
            print(resp.text)

asyncio.run(main())

ストリーム分離

root@kitploit:~
with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    # Each key gets its own circuit
    client_a = tor.isolated_client("session-a")
    client_b = tor.isolated_client("session-b")
    # Requests through client_a and client_b use different circuits

サーキット管理

root@kitploit:~
with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    circuits = tor.get_circuits()
    for c in circuits:
        print(f"Circuit {c.id}: {c.status}, path: {c.path}")

    # Close a specific circuit
    tor.close_circuit(circuits[0].id)

出口ノード情報

root@kitploit:~
with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    info = tor.exit_node
    if info:
        print(f"Exit: {info.nickname} ({info.country})")
        print(f"Flags: {info.flags}")

隠れサービス

root@kitploit:~
with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    service = tor.create_hidden_service({80: 8080})
    print(f"Service: {service.onion_address}")

    # Remove when done
    tor.remove_hidden_service(service)

イベントリスナー

root@kitploit:~
with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
    def on_bandwidth(event):
        print(f"Read: {event.read}, Written: {event.written}")

    tor.add_event_listener("BW", on_bandwidth)
    # ... do work ...
    tor.remove_event_listener(on_bandwidth)

TorPool

root@kitploit:~
from xtor import TorPool

with TorPool(size=3, base_port=9100, password="secret") as pool:
    # Round-robin
    tor = pool.next()
    print(tor.client.get("https://api.ipify.org").text)

    # Rotate all identities
    pool.rotate_all()

    # Random selection
    tor = pool.random()

名前付きインスタンス (Python)

root@kitploit:~
from xtor import Tor

# Start named instance
tor = Tor.start(port=9052, control_port=9053, host="127.0.0.1", name="my-tor")

# Later, reconnect by name
tor = Tor.from_name("my-tor")
with tor:
    print(tor.ip)

CLI リファレンス

xtor CLI は、名前付き Tor インスタンスをバックグラウンドプロセスとして管理します。

root@kitploit:~
# Start a named instance
xtor start my-tor --port 9052 --control-port 9053

# List instances
xtor list

# Connection details
xtor connect my-tor

# Stop instance
xtor stop my-tor

# Remove instance and data
xtor remove my-tor

カスタム例外

root@kitploit:~
XtorError (base)
├── TorNotFoundError
├── PortInUseError
├── IdentityChangeTimeout
├── ConnectionError
└── AuthenticationError

包括的なキャッチパターン:

root@kitploit:~
from xtor.exceptions import XtorError

try:
    with Tor.start(port=9052, control_port=9053, host="127.0.0.1") as tor:
        ...
except XtorError as e:
    print(f"xtor error: {e}")

ライセンス

GPL-3.0-or-later

ツールをダウンロード