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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
dnschef-ng — DNSChef (NG) - DNS proxy for Penetration Testers and Malware Analysts | Kitploit
ツール/GitHubGitHub/byt3bl33d3r/dnschef-ng
Data ExfiltrationInformation GatheringNetwork SecurityMalware AnalysisPenetration TestingRed TeamingDNS Analysis
GitHubbyt3bl33d3r/dnschef-ng

dnschef-ng

DNSChef (NG) - DNS proxy for Penetration Testers and Malware Analysts

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

人気

すべて見る →

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

すべてのツールを探索

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

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

[!NOTE] これは、@iphelix によって元々書かれた DNSChef の更新版です。``` _ _ __
| | v0.7 | | / |
| | __ ___ | | | | ______ _ __ __ _ / | '_ \/ __|/ __| '_ \ / _ \ _|______| '_ \ / _ | | (| | | | _ \ (__| | | | __/ | | | | | (| | _,|
| ||/_|| ||___|| || ||_, | / | |_/ D O C U M E N T A T I O N

root@kitploit:~
DNSChef は、ペネトレーションテスターやマルウェアアナリスト向けの、高度に設定可能な DNS プロキシです。DNS プロキシ(別名「Fake DNS」)は、アプリケーションのネットワークトラフィック解析などに使用されるツールです。例えば、DNS プロキシを使うと、「badguy.com」へのリクエストを偽装して、インターネット上の実際のホストではなく、ローカルマシンに転送し、終端または傍受することができます。

DNS プロキシはいくつか存在します。そのほとんどは、すべての DNS クエリを単一の IP アドレスに向けるか、または初歩的なフィルタリングしか実装していません。DNSChef は、より設定可能なシステムが必要とされたペネトレーションテストの一環として開発されました。その結果、DNSChef はクロスプラットフォームアプリケーションとなり、包含・除外ドメインリストに基づくレスポンスの偽装、複数の DNS レコードタイプのサポート、ワイルドカードによるドメインマッチング、一致しないドメインに対する実際のレスポンスのプロキシ、外部設定ファイルの定義、IPv6 など、多くの機能を備えています。各機能の詳細な説明と推奨される使用法は以下にあります。

DNS プロキシの使用は、アプリケーションに他のプロキシサーバーを直接使用させることができない状況で推奨されます。たとえば、一部のモバイルアプリケーションは OS の HTTP プロキシ設定を完全に無視します。このような場合、DNSChef のような DNS プロキシサーバーを使用すると、そのアプリケーションをだまして、目的の宛先に接続を転送させることができます。

## 新機能 

- Python 3.11+ が必要
- DNS 経由でのファイルステージングをサポート(現時点では `A`、`AAAA`、`TXT` のみ)
- 設定ファイルが TOML になりました
- オプションの HTTP API(ログの照会と設定のリモート更新が可能)
- パフォーマンス向上のための完全非同期(AsyncIO を使用)
- 構造化ロギングと多数の QOL 改善
- Python パッケージになりました
- Docker 化
- 元のリポジトリからの多数の PR と修正が含まれています

## インストール

最新リリースをインストールするには、[pipx](https://pypa.github.io/pipx/) を使用してください(いい加減なステーキが好きなクズでない限り):

    pipx install dnschef-ng

HTTP API を使用したい場合(追加の依存関係が必要):
    
    pipx install dnschef-ng[api]

pipx を使用して Git から最新バージョンをインストール:

     pipx install git+https://github.com/byt3bl33d3r/dnschef-ng.git

pipx を使用して、HTTP API の依存関係を含む Git から最新バージョンをインストール:

     pipx install "git+https://github.com/byt3bl33d3r/dnschef-ng.git#egg=dnschef-ng[api]"


## DNS プロキシのセットアップ

DNSChef を使い始める前に、DNSChef が実行されているマシンを DNS ネームサーバーとして使用するように設定する必要があります。使用する OS に応じていくつかの選択肢があります:

- **Linux** - */etc/resolv.conf* を編集して、先頭にトラフィック解析ホストの行を追加します(ローカルで実行している場合は、たとえば "nameserver 127.0.0.1" を追加します)。あるいは、Network Manager などのツールを使用して DNS サーバーアドレスを追加することもできます。Network Manager 内で IPv4 設定を開き、*Method* ドロップダウンボックスから *Automatic (DHCP) addresses only* または *Manual* を選択し、*DNS Servers* テキストボックスを編集して、DNSChef が実行されている IP アドレスを入力します。

- **Windows** - *コントロールパネル* から *ネットワーク接続* を選択します。次に、いずれかの接続(例: "Local Area Connection")を選択し、右クリックしてプロパティを選択します。表示されたダイアログボックス内で、*Internet Protocol (TCP/IP)* を選択し、プロパティをクリックします。最後に、*Use the following DNS server addresses* ラジオボタンを選択し、DNSChef が実行されている IP アドレスを入力します。たとえば、ローカルで実行している場合は 127.0.0.1 を入力します。

- **OS X** - *システム環境設定* を開き、*ネットワーク* アイコンをクリックします。アクティブなインターフェースを選択し、*DNS サーバー* フィールドに入力します。Airport を使用している場合は、*Advanced...* ボタンをクリックして、そこから DNS サーバーを編集する必要があります。あるいは、*/etc/resolv.conf* を編集して、一番上に偽のネームサーバーを追加することもできます(例: "nameserver 127.0.0.1")。

- **iOS** - *設定* を開き、*一般* を選択します。次に *Wi-Fi* を選択し、リスト内のアクティブなアクセスポイントの右側にある青い矢印をクリックします。DNS エントリを編集して、DNSChef が実行されているホストを指すようにします。Cellular インターフェース(利用可能な場合)が無効になっていることを確認してください。

- **Android** - *設定* を開き、*ワイヤレスとネットワーク* を選択します。*Wi-Fi設定* をクリックし、電話の *オプション* ボタンを押した後、*詳細* を選択します。*Use static IP* チェックボックスを有効にして、カスタム DNS サーバーを設定します。

デバイスの DNS 設定を手動で変更できない場合でも、[ARP Spoofing](http://en.wikipedia.org/wiki/ARP_spoofing)、[Rogue DHCP](http://www.yersinia.net/doc.htm)、その他の創造的な方法などのテクニックを含むいくつかの選択肢があります。

最後に、DNSChef がすべてのリクエストを向ける偽のサービスを設定する必要があります。たとえば、Web トラフィックを傍受しようとしている場合、ポート 80 で実行されている別の Web サーバーを立ち上げるか、トラフィックを傍受するための Web プロキシ(例: Burp)をセットアップする必要があります。DNSChef は、適切に設定されたサービスが稼働しているプロキシ/サーバーホストにクエリを向けます。

## DNSChef の実行

DNSChef は Python で開発されたクロスプラットフォームアプリケーションであり、Python インタープリターを備えたほとんどのプラットフォームで実行できるはずです。このガイドでは Unix 環境に焦点を当てますが、以下のすべての例は Windows でも動作することを確認済みです。

DNSChef の最も基本的なモニタリング機能を試してみましょう。次のコマンドを root で実行します(ポート 53 でサーバーを起動するために必要です):

    # ./dnschef.py
        
              _                _          __  
             | | version 0.2  | |        / _| 
           __| |_ __  ___  ___| |__   ___| |_ 
          / _` | '_ \/ __|/ __| '_ \ / _ \  _|
         | (_| | | | \__ \ (__| | | |  __/ |  
          \__,_|_| |_|___/\___|_| |_|\___|_|  
                       [email protected]  

    [*] DNSChef started on interface: 127.0.0.1 
    [*] Using the following nameservers: 8.8.8.8
    [*] No parameters were specified. Running in full proxy mode

パラメータを指定しない場合、DNSChef はフルプロキシモードで実行されます。つまり、すべてのリクエストは単純にアップストリーム DNS サーバー(デフォルトでは 8.8.8.8)に転送され、クエリ元のホストに返されます。たとえば、ドメインの「A」レコードをクエリして結果を確認してみましょう:

    $ host -t A thesprawl.org
    thesprawl.org has address 108.59.3.64

DNSChef は、時刻、送信元 IP アドレス、要求されたレコードタイプ、そして最も重要なクエリされた名前を示す次のログ行を出力します:

    [23:54:03] 127.0.0.1: proxying the response of type 'A' for thesprawl.org

このモードは、アプリケーションが通信に使用しているドメインを特定する必要がある、単純なアプリケーションモニタリングに役立ちます。

DNSChef は IPv6 を完全にサポートしており、*-6* または *--ipv6** フラグを使用して有効にできます。デフォルトのリッスンインターフェースが ::1 に切り替わり、デフォルトの DNS サーバーが 2001:4860:4860::8888 に切り替わる点を除いて、IPv4 モードとまったく同じように動作します。サンプル出力は次のとおりです:

    # ./dnschef.py -6
              _                _          __
             | | version 0.2  | |        / _|
           __| |_ __  ___  ___| |__   ___| |_
          / _` | '_ \/ __|/ __| '_ \ / _ \  _|
         | (_| | | | \__ \ (__| | | |  __/ |
          \__,_|_| |_|___/\___|_| |_|\___|_|
                       [email protected]

    [*] Using IPv6 mode.
    [*] DNSChef started on interface: ::1
    [*] Using the following nameservers: 2001:4860:4860::8888
    [*] No parameters were specified. Running in full proxy mode
    [00:35:44] ::1: proxying the response of type 'A' for thesprawl.org
    [00:35:44] ::1: proxying the response of type 'AAAA' for thesprawl.org
    [00:35:44] ::1: proxying the response of type 'MX' for thesprawl.org

注: デフォルトでは、DNSChef は UDP リスナーを作成します。代わりに TCP を使用するには、後述する *--tcp* 引数を使用します。

## DNSChef HTTP API の実行

> [!WARNING]
> API には認証がありません。セキュリティグループ、iptables、ファイアウォールなどを使用して、ネットワークレベルでアクセスを許可/拒否してください。

`uvicorn dnschef.api:app`

その後、`http://127.0.0.1:8000/docs` で OpenAPI ドキュメントを表示できます。```
$ uvicorn dnschef.api:app
INFO:     Started server process [28327]
INFO:     Waiting for application startup.
          _                _          __  
         | | version 0.6.0  | |        / _| 
       __| |_ __  ___  ___| |__   ___| |_ 
      / _` | '_ \/ __|/ __| '_ \ / _ \  _|
     | (_| | | | \__ \ (__| | | |  __/ |  
      \__,_|_| |_|___/\___|_| |_|\___|_|  
                @iphelix // @byt3bl33d3r  

2023-09-28 11:24:59 cooking replies                domain=*.thesprawl.org record=192.0.2.1 section=A
2023-09-28 11:24:59 cooking replies                domain=*.thesprawl.org record=2001:db8::1 section=AAAA
-- SNIP --
2023-09-28 11:24:59 cooking replies                domain=*.thesprawl.org record=1 . alpn=h2 ipv4hint=127.0.0.1 ipv6hint=::1 section=HTTPS
INFO:     Application startup complete.
2023-09-28 11:24:59 DNSChef is active              interface=127.0.0.1 ipv6=False nameservers=['8.8.8.8'] port=53 tcp=False
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

すべての応答をインターセプトする

DNSChef の起動方法が分かったところで、--fakeip パラメータを使用して、すべての応答が 127.0.0.1 を指すように偽装する設定をしてみましょう。

root@kitploit:~
# ./dnschef.py --fakeip 127.0.0.1 -q
[*] DNSChef started on interface: 127.0.0.1 
[*] Using the following nameservers: 8.8.8.8
[*] Cooking all A replies to point to 127.0.0.1
[23:55:57] 127.0.0.1: cooking the response of type 'A' for google.com to 127.0.0.1
[23:55:57] 127.0.0.1: proxying the response of type 'AAAA' for google.com
[23:55:57] 127.0.0.1: proxying the response of type 'MX' for google.com

上記の出力から、DNSChef がすべてのリクエストを 127.0.0.1 にプロキシするように設定されていることがわかります。最初のログ行は 08:11:23 に「A」レコードの応答が 127.0.0.1 を指すように「偽装(cooked)」されたことを示しています。ただし、'AAAA' および 'MX' レコードへの以降のリクエストは、実際の DNS サーバーから単にプロキシされます。要求元プログラムの出力を見てみましょう。

root@kitploit:~
$ host google.com localhost
google.com has address 127.0.0.1
google.com has IPv6 address 2001:4860:4001:803::1001
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.

このように、プログラムは IPv4 アドレスとして 127.0.0.1 を使うように騙されました。一方、IPv6(AAAA)およびメール(MX)レコードから得られる情報は完全に正規のものに見えます。DNSChef の目標は、プログラムの正しい動作への影響を最小限にすることです。そのため、アプリケーションが特定のメールサーバーに依存している場合でも、このプロキシされたリクエストを通じて正しくメールサーバーを取得できます。

複数のレコードを同時にターゲットにする方法を示すために、もう 1 つリクエストを偽装してみましょう。

root@kitploit:~
# ./dnschef.py --fakeip 127.0.0.1 --fakeipv6 ::1 -q
[*] DNSChef started on interface: 127.0.0.1 
[*] Using the following nameservers: 8.8.8.8
[*] Cooking all A replies to point to 127.0.0.1
[*] Cooking all AAAA replies to point to ::1
[00:02:14] 127.0.0.1: cooking the response of type 'A' for google.com to 127.0.0.1
[00:02:14] 127.0.0.1: cooking the response of type 'AAAA' for google.com to ::1
[00:02:14] 127.0.0.1: proxying the response of type 'MX' for google.com

--fakeip フラグに加えて、'AAAA' レコードのクエリを偽装するための --fakeipv6 も指定しました。以下が更新後のプログラム出力です。

root@kitploit:~
$ host google.com localhost
google.com has address 127.0.0.1
google.com has IPv6 address ::1
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.

ここでも、アプリケーションによって明示的に上書きされなかったすべてのレコードは、実際の DNS サーバーからプロキシされて返されました。ただし、IPv4(A)と IPv6(AAAA)は両方ともローカルマシンを指すように偽装されました。

DNSChef は複数のレコードタイプをサポートしています:

注: 使いやすさのため、すべての DNS レコードタイプがコマンドラインで公開されているわけではありません。PTR、TXT、SOA などの追加レコードは、--file フラグと適切なレコードヘッダーを使用して指定できます。詳細については、下記の外部定義ファイルセクションを参照してください。

最後に、アプリケーションがタイプ ANY のクエリをどのように処理するか見てみましょう。

root@kitploit:~
# ./dnschef.py --fakeip 127.0.0.1 --fakeipv6 ::1 --fakemail mail.fake.com --fakealias www.fake.com --fakens ns.fake.com -q
[*] DNSChef started on interface: 127.0.0.1 
[*] Using the following nameservers: 8.8.8.8
[*] Cooking all A replies to point to 127.0.0.1
[*] Cooking all AAAA replies to point to ::1
[*] Cooking all MX replies to point to mail.fake.com
[*] Cooking all CNAME replies to point to www.fake.com
[*] Cooking all NS replies to point to ns.fake.com
[00:17:29] 127.0.0.1: cooking the response of type 'ANY' for google.com with all known fake records.

DNS ANY レコードクエリでは、DNSChef は該当するドメインについて知っているすべての偽装レコードを返します。プログラムが表示する出力は次のとおりです。

root@kitploit:~
# host -t ANY google.com localhost
google.com has address 127.0.0.1
google.com has IPv6 address ::1
google.com mail is handled by 10 mail.fake.com.
google.com is an alias for www.fake.com.
google.com name server ns.fake.com.

ドメインのフィルタリング

上記の例を使って、thesprawl.org へのリクエストだけをインターセプトし、webfaction.com などの他のすべてのドメインへのクエリは変更せずにそのまま残したい場合を考えます。次のように --fakedomains パラメータを使用できます。

root@kitploit:~
# ./dnschef.py --fakeip 127.0.0.1 --fakedomains thesprawl.org -q
[*] DNSChef started on interface: 127.0.0.1
[*] Using the following nameservers: 8.8.8.8  
[*] Cooking replies to point to 127.0.0.1 matching: thesprawl.org
[00:23:37] 127.0.0.1: cooking the response of type 'A' for thesprawl.org to 127.0.0.1
[00:23:52] 127.0.0.1: proxying the response of type 'A' for mx9.webfaction.com

上記の例では、thesprawl.org へのリクエストは偽装されましたが、mx9.webfaction.com へのリクエストはそのまま残されました。ドメインフィルタリングは、他のアプリケーションを壊さずに単一のアプリケーションを分離したい場合に非常に便利です。

注: DNSChef は、応答を偽装する前にドメインが存在するかどうかを検証しません。ドメインを指定した場合、実際に存在するかどうかに関係なく、常に偽の値に解決されます。

逆フィルタリング

別の状況では、定義したドメインのリストを除くすべてのリクエストに対して応答を偽装する必要があるかもしれません。このタスクは、次のように --truedomains パラメータを使用して実行できます。

root@kitploit:~
# ./dnschef.py --fakeip 127.0.0.1 --truedomains thesprawl.org,*.webfaction.com -q
[*] DNSChef started on interface: 127.0.0.1
[*] Using the following nameservers: 8.8.8.8  
[*] Cooking replies to point to 127.0.0.1 not matching: *.webfaction.com, thesprawl.org
[00:27:57] 127.0.0.1: proxying the response of type 'A' for mx9.webfaction.com
[00:28:05] 127.0.0.1: cooking the response of type 'A' for google.com to 127.0.0.1

上記の例では、いくつかのことが行われています。まず、ワイルドカード()の使用に注目してください。.webfaction.com に一致するすべてのドメインは逆マッチされ、実際の値に解決されます。'google.com' へのリクエストは、除外ドメインのリストに含まれていないため、127.0.0.1 を返しました。

注: ワイルドカードは位置に依存します。.thesprawl.org タイプのマスクは www.thesprawl.org には一致しますが、www.test.thesprawl.org には一致しません。一方、.*.thesprawl.org タイプのマスクは thesprawl.org、www.thesprawl.org、www.test.thesprawl.org に一致します。

外部定義ファイル

一致するすべてのドメインに対して単一の偽 DNS レコードを定義するだけでは不十分な状況もあるかもしれません。リクエストの送信先を正確に定義した DOMAIN=RECORD ペアの集まりを含む外部ファイルを使用できます。

たとえば、次の定義ファイルを作成し、dnschef.toml という名前を付けましょう。```toml [A] ".google.com"="192.0.2.1" "thesprawl.org"="192.0.2.2" ".wordpress.*"="192.0.2.3"

root@kitploit:~
`[A]`というセクションヘッダーに注目してください。これはDNSChefに対するレコードタイプを定義します。次に、複数のクエリの出力を注意深く観察しましょう。

    # ./dnschef.py --file dnschef.toml -q
    [*] DNSChef started on interface: 127.0.0.1 
    [*] Using the following nameservers: 8.8.8.8
    [+] Cooking A replies for domain *.google.com with '192.0.2.1'
    [+] Cooking A replies for domain thesprawl.org with '192.0.2.2'
    [+] Cooking A replies for domain *.wordpress.* with '192.0.2.3'
    [00:43:54] 127.0.0.1: cooking the response of type 'A' for google.com to 192.0.2.1
    [00:44:05] 127.0.0.1: cooking the response of type 'A' for www.google.com to 192.0.2.1
    [00:44:19] 127.0.0.1: cooking the response of type 'A' for thesprawl.org to 192.0.2.2
    [00:44:29] 127.0.0.1: proxying the response of type 'A' for www.thesprawl.org
    [00:44:40] 127.0.0.1: cooking the response of type 'A' for www.wordpress.org to 192.0.2.3
    [00:44:51] 127.0.0.1: cooking the response of type 'A' for wordpress.com to 192.0.2.3
    [00:45:02] 127.0.0.1: proxying the response of type 'A' for slashdot.org

*google.com* と *www.google.com* はどちらも *\*.google.com* エントリに一致し、正しく *192.0.2.1* に解決されました。一方、*www.thesprawl.org* リクエストは変更されずに単にプロキシされました。最後に、*wordpress.com*、*www.wordpress.org* などのすべてのバリエーションが *\*.wordpress.\** マスクに一致し、正しく *192.0.2.3* に解決されました。最後に、未定義の *slashdot.org* クエリは実際の応答とともに単にプロキシされました。

コマンドラインで明示的に公開されていないものを含め、サポートされている他のすべてのDNSレコードタイプに対してセクションヘッダーを指定できます: [A]、[AAAA]、[MX]、[NS]、[CNAME]、[PTR]、[NAPTR]、[SOA]。たとえば、`dnschef.toml` ファイルに新しい [PTR] セクションを定義してみましょう:```toml
[PTR]
"*.2.0.192.in-addr.arpa"="fake.com"

この新しいレコードタイプに対するDNSChefの動作を見てみましょう:

root@kitploit:~
 ./dnschef.py --file dnschef.toml -q
[sudo] password for iphelix: 
[*] DNSChef started on interface: 127.0.0.1 
[*] Using the following nameservers: 8.8.8.8
[+] Cooking PTR replies for domain *.2.0.192.in-addr.arpa with 'fake.com'
[00:11:34] 127.0.0.1: cooking the response of type 'PTR' for 1.2.0.192.in-addr.arpa to fake.com

逆DNSクエリを実行したときにクライアントが確認できる内容は次のとおりです:

root@kitploit:~
$ host 192.0.2.1 localhost
1.2.0.192.in-addr.arpa domain name pointer fake.com.

一部のレコードは正確な書式を必要とします。良い例はSOAとNAPTRです。```toml [SOA] "*.thesprawl.org" = "ns.fake.com. hostmaster.fake.com. 1 10800 3600 604800 3600"

[NAPTR] ".thesprawl.org" = "100 10 U E2U+sip !^.$!sip:[email protected]! ."

root@kitploit:~
サンプルの `dnschef.toml` ファイルを参照して、追加の例を確認してください。

## ファイルのステージング

DNSChef は DNS を介して任意のファイルを「ステージング」できます。現在、ファイルステージングは `A`、`AAAA`、`TXT` レコードでのみサポートされています(今後追加予定)。DNSChef にファイルをステージングさせるには、`dnschef.toml` に次のセクションを追加します:```toml
[A]
"*.wat.org" = { file = "/home/payload.exe", chunk_size = 4 }

[AAAA]
"*.gorgetowngeronimos.org" = { file = "/home/payload.exe", chunk_size = 16 }

[!NOTE] chunk_size 設定はオプションであり、その動作はクエリタイプに大きく依存します。例: A クエリは IPv4 アドレスを返すため、許可される最大 chunk_size は 4 バイトです。chunk_size を 4 より大きい値に設定しても無視されます。

DNS 名に番号を含む *.wat.org への A クエリは、ファイルの対応するチャンクを返すようになりました。例: ns0.wat.org へのクエリは、ファイルの最初のチャンク(4 バイト)を含む IPv4 アドレスを返します。test1.wat.org へのクエリは、ファイルの2番目のチャンクを返します。

上記の例のようにワイルドカードドメインを使用する場合、"チャンク"番号はどこにでも 配置でき、まとめて配置する必要はありません。例: 1aliens2.wat.org への A クエリは、ファイルの12番目のチャンクを返します。

TXT レコードは、より柔軟性が高いため、ファイルステージングの追加オプションをサポートしています:```toml [TXT] "ns*.dungbeetle.org" = { file = "~/payload.exe", chunk_size = 189, response_format = "{prefix}test-{chunk}", response_prefix_pool = ["atlassian-domain-verification=", "onetrust-domain-verification=", "docusign=" ] }

root@kitploit:~
この構成では、`ns*.dungbeetle.org` への `TXT` クエリは、ローカルのファイルシステム上にある `~/payload.exe` のチャンクを返します。

`response_format` と `response_prefix_pool` の設定はオプションですが、DNS `TXT` 応答をさらにカスタマイズできます。

`response_format` 設定は `TXT` 応答の形式を定義します:

- `{prefix}` 変数は、`response_prefix_pool` 配列で定義された値のいずれかでランダムに置き換えられます。

- `{chunk}` 変数はファイルチャンクに置き換えられます。

上記の構成では、`ns1.dungbeetle.org` への `TXT` クエリは次の応答を返します:```
docusign=test-<BASE64_ENCODED_FILE_CHUNK_N1>

別の TXT クエリ(例:ns10.dungbeetle.org)を実行すると、プレフィックスが変化することがわかります:``` atlassian-domain-verification=test-<BASE64_ENCODED_FILE_CHUNK_N10>

root@kitploit:~
## 高度なフィルタリング

ファイルとコマンドラインからの入力を組み合わせて使用できます。例えば、次のコマンドは `--file` と `--fakedomains` の両方のパラメータを使用しています:

    # ./dnschef.py --file dnschef.toml --fakeip 6.6.6.6 --fakedomains=thesprawl.org,slashdot.org -q
    [*] DNSChef started on interface: 127.0.0.1 
    [*] Using the following nameservers: 8.8.8.8
    [+] Cooking A replies for domain *.google.com with '192.0.2.1'
    [+] Cooking A replies for domain thesprawl.org with '192.0.2.2'
    [+] Cooking A replies for domain *.wordpress.* with '192.0.2.3'
    [*] Cooking A replies to point to 6.6.6.6 matching: *.wordpress.*, *.google.com, thesprawl.org
    [*] Cooking A replies to point to 6.6.6.6 matching: slashdot.org, *.wordpress.*, *.google.com, thesprawl.org
    [00:49:05] 127.0.0.1: cooking the response of type 'A' for google.com to 192.0.2.1
    [00:49:15] 127.0.0.1: cooking the response of type 'A' for slashdot.org to 6.6.6.6
    [00:49:31] 127.0.0.1: cooking the response of type 'A' for thesprawl.org to 6.6.6.6
    [00:50:08] 127.0.0.1: proxying the response of type 'A' for tor.com

コマンドラインパラメータで指定した *thesprawl.org* の定義が *dnschef.toml* よりも優先されていることに注意してください。これは、設定ファイル内の値を上書きしたい場合に便利です。slashdot.org は *--fakedomains* パラメータで指定されているため、引き続き偽の IP アドレスに解決されます。tor.com のリクエストは、コマンドラインと設定ファイルのどちらにも指定されていないため、単にプロキシされます。

## その他の設定

セキュリティ上の理由から、DNSChef はデフォルトでローカルの 127.0.0.1 (IPv6 の場合は ::1) インターフェースをリッスンします。*--interface* パラメータを使用すると、DNSChef を別のインターフェースでリッスンさせることができます:

    # ./dnschef.py --interface 0.0.0.0 -q
    [*] DNSChef started on interface: 0.0.0.0
    [*] Using the following nameservers: 8.8.8.8 
    [*] No parameters were specified. Running in full proxy mode
    [00:50:53] 192.0.2.105: proxying the response of type 'A' for thesprawl.org

または IPv6 の場合:

    # ./dnschef.py -6 --interface :: -q
    [*] Using IPv6 mode.
    [*] DNSChef started on interface: ::
    [*] Using the following nameservers: 2001:4860:4860::8888
    [*] No parameters were specified. Running in full proxy mode
    [00:57:46] 2001:db8::105: proxying the response of type 'A' for thesprawl.org

デフォルトでは、DNSChef はプロキシリクエストを行うために Google のパブリック DNS サーバーを使用します。ただし、*--nameservers* パラメータを使用して、カスタムのネームサーバーリストを定義できます:

    # ./dnschef.py --nameservers 4.2.2.1,4.2.2.2 -q
    [*] DNSChef started on interface: 127.0.0.1 
    [*] Using the following nameservers: 4.2.2.1, 4.2.2.2
    [*] No parameters were specified. Running in full proxy mode
    [00:55:08] 127.0.0.1: proxying the response of type 'A' for thesprawl.org

IP#PORT 表記を使用して、標準以外のネームサーバーポートを指定することもできます:

    # ./dnschef.py --nameservers 192.0.2.2#5353 -q
    [*] DNSChef started on interface: 127.0.0.1 
    [*] Using the following nameservers: 192.0.2.2#5353
    [*] No parameters were specified. Running in full proxy mode
    [02:03:12] 127.0.0.1: proxying the response of type 'A' for thesprawl.org

また、`-p port#` パラメータを使用して、DNSChef 自体を別のポートで起動することもできます:

    # ./dnschef.py -p 5353 -q
    [*] Listening on an alternative port 5353
    [*] DNSChef started on interface: 127.0.0.1 
    [*] Using the following nameservers: 8.8.8.8
    [*] No parameters were specified. Running in full proxy mode

DNS プロトコルは、UDP (デフォルト) または TCP で使用できます。DNSChef は、`--tcp` フラグで有効化できる TCP モードを実装しています。
ツールをダウンロード
RecordDescriptionArgumentExample
AIPv4 address--fakeip--fakeip 192.0.2.1
AAAAIPv6 address--fakeipv6--fakeipv6 2001:db8::1
MXMail server--fakemail--fakemail mail.fake.com
CNAMECNAME record--fakealias--fakealias www.fake.com
NSName server--fakens--fakens ns.fake.com