Skip to content
KitploitKITPLOIT
ツールエクスプロイトブログ
Log in
提出
ツールエクスプロイトブログ
提出

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
mqattack — MQTTペネトレーションテスト用のRust CLI:subscribe/publish、ブローカーフィンガープリンティング、ACLプロービング、トピック列挙、認証情報ブルートフォース、およびTLS/mTLS経由のLast Willインジェクション。 | Kitploit
ツール/GitHubGitHub/affolter-engineering/mqattack
偵察IoTセキュリティパスワード攻撃脆弱性分析情報収集ネットワークセキュリティペネトレーションテストユーティリティとフレームワークハードウェアとIoTセキュリティ認証
GitHubaffolter-engineering/mqattack
1154日前未レビュー

人気

すべて見る →

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

すべてのツールを探索

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

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

mqattack

MQTTペネトレーションテスト用のRust CLI:subscribe/publish、ブローカーフィンガープリンティング、ACLプロービング、トピック列挙、認証情報ブルートフォース、およびTLS/mTLS経由のLast Willインジェクション。

リポジトリを見る

mqattack

コマンドライン向けのRustベースのMQTTペネトレーションテストツール。

機能

  • Subscribe - 1つ以上のトピックフィルターをリッスンする
  • Publish - トピックにペイロードを送信する
  • Fingerprinting - MQTTブローカーを識別できる
  • Check ACL - 1つのトピックまたはワードリストに対してsubscribe/publish権限をプローブする
  • TLS - システムまたはカスタムCAによるブローカー検証
  • mTLS - クライアント証明書と秘密鍵による相互TLS
  • JWT authentication - MQTTパスワードとしてJWTトークンを送信する
  • Insecure mode - 迅速なテストのために証明書検証をスキップする

インストール

ソースから (Nixを使用)

$ nix-shell
$ cargo build --release

バイナリは target/release/mqattack に配置されます。

ソースから (Nixを使用しない)

Rust 1.80+、Cコンパイラ、OpenSSL開発ヘッダーが必要です。

$ cargo build --release

Nixpkgs

NixまたはNixOSユーザー向けにパッケージが利用可能です。最新リリースは unstable チャンネルにのみ存在する可能性があることに注意してください。

 $ nix-env -iA nixos.mqattack

使用方法

すべてのコマンドは共通の接続および認証オプションを共有します:

Connection options:
  -H, --host <HOST>        Broker hostname or IP        [default: localhost]
  -p, --port <PORT>        Broker port                  [default: 1883]
  -u, --username <USER>    Username
  -P, --password <PASS>    Password (mutually exclusive with --jwt)
      --jwt <TOKEN>        JWT token sent as MQTT password
      --client-id <ID>     MQTT client identifier       [default: mqattack]
      --keepalive <SECS>   Keep-alive interval          [default: 60]

TLS options:
      --tls                Enable TLS with system root CAs
      --cafile <PATH>      Custom CA certificate in PEM format (implies --tls)
      --cert <PATH>        Client certificate for mTLS in PEM format (requires --key)
      --key <PATH>         Client private key for mTLS in PEM format (requires --cert)
      --insecure           Disable certificate verification — for testing only

Subscribe

$ mqattack subscribe [OPTIONS] -t <TOPIC>...

  -t, --topic <TOPIC>    Topic filter, repeatable
  -q, --qos <QOS>        QoS level 0/1/2         [default: 0]
  -C, --count <N>        Exit after N messages
      --hex              Print payload as hexadecimal
# Subscribe to all topics
$ mqattack subscribe -t '#'

# Subscribe to multiple filters, exit after 5 messages
$ mqattack subscribe -t 'home/#' -t 'sensors/#' -C 5

# Plaintext with credentials
$ mqattack subscribe -H 192.168.1.10 -u admin -P secret -t '#'

# TLS using system root CAs (default port 8883)
$ mqattack subscribe --tls -H broker.example.com -p 8883 -t '#'

# TLS with a custom CA
$ mqattack subscribe --cafile ca.crt -H broker.example.com -p 8883 -t '#'

# mTLS with client certificate
$ mqattack subscribe --cert client.crt --key client.key --cafile ca.crt \
  -H broker.example.com -p 8883 -t '#'

# JWT authentication over TLS
$ mqattack subscribe --tls --jwt 'eyJhbGci...' -H broker.example.com -p 8883 -t '#'

# Self-signed cert — skip verification
$ mqattack subscribe --insecure -H 192.168.1.10 -p 8883 -t '#'

# Collect for 5 seconds, print a grouped summary
$ mqattack sys-info -H 192.168.1.10

# Longer collection window
$ mqattack sys-info -H broker.example.com --tls -p 8883 -w 15

# Stream values live
$ mqattack sys-info -H 192.168.1.10 --live

Publish

$ mqattack publish [OPTIONS] -t <TOPIC> -m <MESSAGE>

  -t, --topic <TOPIC>    Target topic
  -m, --message <MSG>    Payload; use '-' to read from stdin
  -q, --qos <QOS>        QoS level 0/1/2         [default: 0]
  -r, --retain           Set the retain flag
# Publish a simple message
$ mqattack publish -t test/topic -m 'hello'

# Publish with QoS 1 and retain flag
$ mqattack publish -H 192.168.1.10 -t alerts/door -m 'open' -q 1 -r

# Pipe payload from stdin
$ echo '{"cmd":"reboot"}' | mqattack publish -t device/1/cmd -m -

# Publish over TLS with JWT
$ mqattack publish --tls --jwt 'eyJhbGci...' \
  -H broker.example.com -p 8883 -t device/1/cmd -m 'reboot'

# mTLS publish
$ mqattack publish --cert client.crt --key client.key --cafile ca.crt \
  -H broker.example.com -p 8883 -t test -m 'hello'

Fingerprint

$SYS/# を購読し、収集したメッセージを分析することでブローカーのソフトウェアとバージョンを識別します。標準のSUBSCRIBE以外のパケットは送信されません — ブローカーは自身が発行する内容を通じて自らを明かします。

認識されるブローカーとその検出シグナル:

BrokerDetection signal
Mosquitto$SYS/broker/version の値が mosquitto version で始まる
HiveMQ$SYS/broker/version の値が HiveMQ で始まる
VerneMQ$SYS/broker/version の値が VerneMQ で始まる
EMQX$SYS/brokers/ (複数形) 配下のトピック; ノード名はトピックパスから抽出
NanoMQ$SYS/nanomq/ 名前空間配下のトピック
RabbitMQ$SYS/broker/version の値に rabbitmq が含まれる

信頼度は、既知のシグネチャが一致した場合は high、$SYS/broker/version は存在するが認識できない場合は low、$SYSにアクセスできるが識別情報が得られない場合は unknown として報告されます。

$ mqattack fingerprint [OPTIONS]

  -w, --wait <SECS>   Collection window in seconds   [default: 5]
      --verbose        Print all collected $SYS messages after the summary

例

# Fingerprint a broker on the default port
$ mqattack fingerprint -H 192.168.1.10

# Longer collection window for slow brokers, then dump everything
$ mqattack fingerprint -H 192.168.1.10 -w 10 --verbose

# Fingerprint over TLS with credentials
$ mqattack fingerprint --cafile ca.crt -H broker.example.com -p 8883 \
  -u admin -P secret

出力例 (Mosquitto):

[+] Broker Fingerprint
    Software:              Mosquitto
    Version:               2.0.18
    Confidence:            high
    Build info:            With OpenSSL 3.0.2 15 Mar 2022

    Uptime:                12345 seconds
    Clients connected:     3
    Clients total:         47
    Messages received:     1082
    Messages sent:         2341

[*] 47 $SYS message(s) collected (use --verbose to see all)

Check ACL

1つのトピックまたはトピックのリストに対してsubscribeおよび/またはpublish権限をプローブします。各テストはブローカーに新規接続し、返されたSubAck/PubAckを検査します。結果は ALLOWED、DENIED、INCONCLUSIVE (確認応答を受信しなかった)、または SKIPPED として報告されます。

Note: publishプローブはブローカーの確認応答を得るためにQoS 1または2 (-q 1 または -q 2) が必要です。QoS 0はpublishに対して常に INCONCLUSIVE を返します。

$ mqattack check-acl [OPTIONS] (-t <TOPIC> | -w <FILE>)

  -t, --topic <TOPIC>     Single topic to probe (mutually exclusive with --wordlist)
  -w, --wordlist <FILE>   File with one topic per line (mutually exclusive with --topic)
      --no-subscribe      Skip subscribe permission tests
      --no-publish        Skip publish permission tests
      --payload <TEXT>    Payload used for publish probes    [default: mqattack]
  -q, --qos <QOS>         QoS for publish probes (1 or 2)   [default: 1]
      --wait <SECS>       Seconds to wait for a broker response per test [default: 5]
# Test a single topic (both subscribe and publish)
$ mqattack check-acl -H 192.168.1.10 -u admin -P secret -t 'home/lights/1'

# Test all topics from a wordlist, subscribe only
$ mqattack check-acl -H 192.168.1.10 -w topics.txt --no-publish

# Test publish permissions only with QoS 2
$ mqattack check-acl -H 192.168.1.10 -t 'cmd/device/1' --no-subscribe -q 2

# Check ACL over TLS with a custom CA
$ mqattack check-acl --cafile ca.crt -H broker.example.com -p 8883 -w topics.txt

# Use a custom payload and a longer wait window
$ mqattack check-acl -H 192.168.1.10 -t 'sensor/temp' --payload 'test' --wait 10

Enumerate topics

# Wordlist enumeration
mqattack enum-topics -H 192.168.1.10 -w mqtt-topics.txt

# Brute-force single-level topics under "home/"
mqattack enum-topics -H 192.168.1.10 --brute --prefix home --max-length 4

# Two-level brute-force (home/word/word) with longer window
mqattack enum-topics -H 192.168.1.10 --brute --prefix home --depth 2 -t 10

Brute-force authentication

ブローカーに対してユーザー名/パスワードの組み合わせをテストします。4つの攻撃モードがサポートされており、いずれもブローカーのConnAck戻りコードを使用して成功と失敗を区別します (例: BadUserNamePassword と NotAuthorized)。

ModeFlagsUse case
Credential pairs-c FILE事前に構築された username:password リストをテスト
Single-user brute-force-u USER -W FILE1つのアカウントに対する辞書攻撃
Password spray-U FILE -P PASS多数のユーザーに対して1つのパスワード
Cross-product-U FILE -W FILEすべての組み合わせ (上限10 000、--force で上書き)

--try-anonymous はワードリスト試行の前に資格情報なしの接続をプローブします。

ツールをダウンロード