【注意】このサイトに記載されていることを他人に試すことは「不正アクセス禁止法」に該当する場合があります。詳しくはこちらから

ハッカーはDSNenumでドメイン情報を収集する(Kali Linuxツール説明)

ホワイトハッカーの知識座学,DNS,Kali Linuxツール,DSNenum

ドメイン情報を収集するDSNenumのツールを理解するためにまとめてみました。
このDSNenumの動作確認は自分のドメインでテストを行っています。

DNSenumとは

DNSenumを使用してDNS(ドメインネームシステム)サーバーに問い合わせを行い、公開されているDNSの一覧情報を収集するツールです。

機能

  • ホストのアドレス(Aレコード)を取得します。
  • ネームサーバーを取得します。(スレッド化)
  • MXレコードを取得します。(スレッド化)
  • ネームサーバのaxfrクエリを実行して、BIND VERSIONを取得します。(スレッド化)
  • グーグル・スクレイピングで追加の名前とサブドメインを取得します。(グーグル・クエリ = “allinurl: -www site:domain")
  • ファイルからサブドメインを抽出し、NSレコードを持つサブドメインの再帰を実行することができます、(すべてのスレッド)
  • Cクラスドメインのネットワークレンジを計算して、そのネットワークレンジに対してwhoisクエリを実行します。(スレッド化)
  • ネットランジ(Cクラスまたはwhoisネットランジ)の逆引きを実行します。(スレッド化)
  • domain_ips.txtファイルにip-blockを書き込みます。

ツールの場所

[Applications]→[01-Information Gathering]→[DNS Analysis]→[dnsenum] 

ツールと使用方法

dnsenum [オプション] [ドメイン名]
例 dnsenum -r www.yahoo.co.jp

オプション(GENERAL OPTIONS)

–dnsserver <server>

Use this DNS server for A, NS and MX queries.
Aリソースレコード、NSリソースレコード、MXリソースレコードクエリの問い合わせにこのDNSサーバーを使用します。
【実行イメージ】少し端折って整形しています。

┌──(root__kali)-[/home/kali]
└─# dnsenum --dnsserver 8.8.8.8 ****.com
dnsenum VERSION:1.2.6

----- ****.com -----
Host's addresses:

****.com. 3599 IN A ***.***.***.***
Wildcard detection using: ixakagqaonha

ixakagqaonha.****.com. 3599 IN A ***.***.***.***
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Wildcards detected, all subdomains will point to the same IP address
Omitting results containing ***.***.***.***.
Maybe you are using OpenDNS servers.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Name Servers:
ns1.*******.jp. 2649 IN A ***.***.***.001

Mail (MX) Servers:

Trying Zone Transfers and getting Bind Versions:

Trying Zone Transfer for ****.com on ns1.*******.jp ...
AXFR record query failed: NOTAUTH

Brute forcing with /usr/share/dnsenum/dns.txt:

****.com class C netranges:

***.***.***.***/24
Performing reverse lookup on 256 ip addresses:

0 results out of 256 IP addresses.

done.

–enum

Shortcut option equivalent to –threads 5 -s 15 -w.
–threads 5 -s 15 -w と同等のショートカットオプションです。

-h, –help

Print this help message.
このヘルプメッセージを印刷します。

–noreverse

Skip the reverse lookup operations.
逆引き(IPアドレスからドメイン)の操作をスキップします。

–nocolor

Disable ANSIColor output.
ANSIColor出力を無効にします。

–private

Show and save private ips at the end of the file domain_ips.txt.
domain_ips.txtというファイルの末尾にプライベートIPを表示・保存します。

–subfile <file>

Write all valid subdomains to this file.
すべての有効なサブドメインをこのファイルに書き込みます。

-t, –timeout <value>

The tcp and udp timeout values in seconds (default: 10s).
tcpおよびudpのタイムアウト値を秒単位で指定します。(デフォルト:10秒)

–threads <value>

The number of threads that will perform different queries.
さまざまなクエリを実行するスレッドの数です。

-v, –verbose

Be verbose: show all the progress and all the error messages.
詳細な情報を表示します:すべての進捗状況とすべてのエラーメッセージを表示します。

グーグルスクレイピングオプション(GOOGLE SCRAPING OPTIONS)

-p, –pages <value>

The number of google search pages to process when scraping names,the default is 5 pages,the -s switch must be specified.
名前のスクレイピング時に処理するGoogle検索ページの数を指定します。デフォルトは5ページで、-sスイッチを指定する必要があります。

-s, –scrap <value>

The maximum number of subdomains that will be scraped from Google (default 15).
Googleからスクレイピングされるサブドメインの最大数です。(デフォルトは15です)

ブルートフォースオプション(BRUTE FORCE OPTIONS)

-f, –file <file>

Read subdomains from this file to perform brute force. (Takes priority over default dns.txt)
このファイルからサブドメインを読み取り、ブルートフォースを実行します。(デフォルトのdns.txtよりも優先されます。)

-u, –update <a|g|r|z>

Update the file specified with the -f switch with valid subdomains.
-fスイッチで指定したファイルを有効なサブドメインで更新します。
① a (all)
Update using all results.
すべての結果を使って更新します。
② g
Update using only google scraping results.
googleのスクレイピング結果だけで更新します。
③ r
Update using only reverse lookup results.
逆引きした結果のみを使って更新します。
④ z
Update using only zonetransfer results.
ゾーン転送の結果のみを使って更新します。
⑤ -r, –recursion
Recursion on subdomains, brute force all discovered subdomains that have an NS record.
サブドメインの再帰、NSレコードを持つ発見されたすべてのサブドメインをブルートフォースします。

WHOIS NETRANGEオプション(WHOIS NETRANGE OPTIONS)

-d, –delay <value>

The maximum value of seconds to wait between whois queries, the value is defined randomly, default:
whoisクエリの間に待機する秒数の最大値で、値はランダムに定義されます。(デフォルト)

-w, –whois

Perform the whois queries on c class network ranges.
**Warning**: this can generate very large netranges and it will take lot of time to perform reverse lookups.
cクラスのネットワーク範囲でwhoisクエリを実行します。
**警告**: これは非常に大きなネットワークを生成する可能性があり、逆引きの実行には多くの時間がかかります。

リバースルックアップオプション(REVERSE LOOKUP OPTIONS)

-e, –exclude <regexp>

Exclude PTR records that match the regexp expression from reverse lookup results, useful on invalid hostnames.
regexp式に一致するPTRレコードを逆引き結果から除外します。無効なホスト名の場合に有効です。

出力オプション(OUTPUT OPTIONS)

-o –output <file>

Output in XML format. Can be imported in MagicTree (www.gremwell.com).
XML形式で出力します。MagicTree(www.gremwell.com)でのインポートが可能です。

dnsenumツールのまとめ

DNS(ドメイン・ネーム・システム)を理解していないと、このツールは使えませんね。
いままで、DNSなんて全然気にしていなかったですが深く勉強する必要があります。(^^;
それと・・・語学力が無いのがつらいです。

whitemarkn
whitemarkn
DNSの書籍を購入して勉強します。