Firewalk
Firewalkの使い方。
Firewalkは、主に対象となるネットワークに対する予備調査に使われます。
ターゲット手前のゲートウェイが、どのレイヤー4プロトコルを通すのか調査できます。
実際の動作は二段階に分かれます。
Ramping Phase
- tracerouteと同じような動作をすることにより、ターゲットまでのホップ数を数える。
Scanning Phase
- Ramping Phaseで入手したホップ数を利用して、TTLを設定したTCP/UDPパケットを送信。ターゲットからのICMP_TIME_EXCEEDEDメッセージを分析し、ターゲットのゲートウェイがどのようなフィルタリングを設定しているのか推測する。
オプション
Firewalk 5.0 [gateway ACL scanner]
Usage : firewalk [options] target_gateway metric
[-d 0 - 65535] destination port to use (ramping phase)
[-h] program help
[-i device] interface
[-n] do not resolve IP addresses into hostnames
[-p TCP | UDP] firewalk protocol
[-r] strict RFC adherence
[-S x - y, z] port range to scan
[-s 0 - 65535] source port
[-T 1 - 1000] packet read timeout in ms
[-t 1 - 25] IP time to live
[-v] program version
[-x 1 - 8] expire vector
実際に使ってみたいのですが、ちょっとテスト環境がないのでサンプル的な結果を表示します。
対象ポートを53と80に設定して、TCPパケットを指定しています。
bt ~ # firewalk -n -S53,80 -pTCP Gateway_IP_address Target_IP_address
Firewalk 5.0 [gateway ACL scanner]
Firewalk state initialization completed successfully.
TCP-based scan.
Ramping phase source port: 53, destination port: 33434
Hotfoot through Gateway_IP_address using Target_IP_address as a metric.
Ramping Phase:
1 (TTL 1): expired [192.168.**.1]
2 (TTL 2): expired [*.*.*.*]
3 (TTL 3): expired [*.*.*.*]
4 (TTL 4): expired [*.*.*.*]
5 (TTL 5): expired [Gateway_IP_address]
Binding host reached.
Scan bound at 5 hops.
Scanning Phase:
port 53: A! open (port not listen) [Target_IP_address]
port 80: A! open (port listen) [Target_IP_address]Scan completed successfully.
Total packets sent: 6
Total packet errors: 0
Total packets caught 6
Total packets caught of interest 6
Total ports scanned 2
Total ports open: 2
Total ports unknown: 0
ゲートウェイとターゲット用のグローバルアドレスがあって、色々設定いじれるファイアーウォールがあるとテストできそうですね。
自分の環境以外に対して使うのは絶対に避けてください。
Firewalkのサイトに資料があるので参考にどうぞ。
ちょっと古いですが、作者の書いたBuilding Open Source Network Security Tools: Components and Techniquesも参考にするといいかもしれません。
Finger Google
Finger Googleの使い方。
Finger Googleは、googleを利用して特定のドメインからアカウント名を探し出してくれるツールです。
bt # cd /pentest/enumeration/google/fingergoogle-1.1
bt # ./fingergoogle.py sample.com
Links a navegar: 2
/search?q=%40sample.com&num=20&hl=es&lr=&ie=UTF-8&as_qdr=all&start=0&sa=N&filter=0
"/search?q=%40sample.com&num=20&hl=es&lr=&as_qdr=all&ie=UTF-8&start=20&sa=N&filter=0"
To search: sample.com
admin
admin
Accounts found: 1
admin
ダミーの結果です。
単純にドメインを入れるだけなので、簡単にメールアドレスが収集できますね。
これで今日からあなたもスパマーの仲間入りです。
DNS Predictor
DNS Predictorの使い方。
DNS Predictorは、通常サーバーネームの付ける人の考えを上手く利用します。
とりあえず名前を付けなければならないときに、earthやmarsなどのように星の名前を使うこともあるかと思います。
星座、神話に登場する神、あるアニメのキャラなど、そのサーバー群を管理する人の趣味も伺えるかもしれません。
引数に二つの関連性のあるキーワード(例えばearthとmars)を入力すると、Google経由してVenus, Mercury, Jupiterなどの星に関するキーワードも調べた上で、さらにそのキーワード群をサブドメインにつけてサーバーを調べてくれます。
DNS Predictor by Jimmy Neutron 0.0.2
Argument Error
DNS Predict by JN
Syntax: dnspredic.pl
- help : Shows this screen
- domain : the domain to search (REQUIRED)
- item1 : first argument for g00gle predict (REQUIRED)
- item2 : second argument for g00gle predict (REQUIRED)
- loglevel=level : The venbosity level
- timeout=seconds : http timeout
- file=filename : the output file for resolved hosts
- dieonerror=int : if set to 1 (the tool dies on fatal erros) 0 overrides this behaviour
- proxy=host:port : the proxy used for contacting g00gle
では実際に使ってみましょう。
いつも通りドメインやIPは架空のものです。
bt #cd /pentest/enumeration/google/dns-predict-v.0.0.2
bt #./dnspredict.pl --domain sample.com --item1 earth --item2 mars
DNS Predictor by Jimmy Neutron 0.0.2Warning: You aren't using a proxy. Remeber that this program is doing a direct g00gle scraping
earth Resolving earth.sample.com 192.168.1.2
mars Resolving mars.sample.com -
jupiter Resolving jupiter.sample.com 192.168.1.5
venus Resolving venus.sample.com 192.168.1.56
saturn Resolving saturn.sample.com -
uranus Resolving uranus.sample.com -
mercury Resolving mercury.sample.com -
neptune Resolving neptune.sample.com -
pluto Resolving pluto.sample.com -
ドメインの調査ついでに関連する英単語も覚えられて便利ですね!
zeus,vinusとか引数を変えてみていろいろ試してみると面白いかもしれません。
サーバーに付けられやすい名前の規則とか目星を付けておくと後で役立つかも。
一応ソースに
for education purposes only
と書かれているのでそのように利用してください。
洋書ですが、Google Hacking for Penetration TestersというGoogleを利用したペネトレ本も出版されていますので参考にどうぞ。
dnsmap
dnsmapの使い方
bt# ./dnsmap
dnsmap - DNS Network Mapper by pagvac
(http://ikwt.com, http://foro.elhacker.net)
Usage: dnsmap[dictionary-file]
Examples:
dnsmap yourtarget.com
dnsmap yourtarget.com yourwordlist.txt
内蔵されているサブドメインリストを使うもよし、独自のワードリストを使うもよし。
bt # ./dnsmap sample.com
dnsmap - DNS Network Mapper by pagvac
(http://ikwt.com, http://foro.elhacker.net)
Searching subhosts on domain sample.com1 subhost(s) found
毎度ながら、サンプルのアウトプットです。
dnsenum
dnsenumの使い方。
どんなツールかというと、dnsenumの公式サイトを簡単に訳すと以下のような感じです。
そのドメインのネームサーバを引っ張り出す
ゾーントランスファーできるか試す
リストを使ってドメインを引っ張り出す
ゾーントランスファーできたIPアドレスの情報を集めて、そのClass Cのアドレスを引き出す
さらにそのClass CのIPアドレスの逆引きをする
bt # cd /pentest/enumeration/dnsenum/
bt # ./dnsenum.pl
Usage: perl dnsenum.pl
dns.txtの中には、とりあえず151個のサンプルドメインが入っているので各自自分の手持ちのリストでもつっこみましょう。
その手の使えるリストある人は僕にください。
bt dnsenum # perl dnsenum.pl sample.com dns.txt
Checking sample.com
------------------------------------------
Nameservers for this domain:
----------------------------------------
------------------------------------------
Trying Zonetransfers
------------------------------------------
------------------------------------------
Looking up names from dns.txt
------------------------------------------
------------------------------------------
Breakdown in C classes
------------------------------------------
192.168.1.1/24
------------------------------------------
doing reverse lookup of 254 addresses
------------------------------------------
いつものことですが、このアウトプットはサンプルです。
zonetransferできちゃうようなサーバーじゃないと情報引き出せませんよ。
作者曰く乱用するなだそうです。
DNSBruteforce
DNSBruteforceの使い方。
http://www.revhosts.net/DNSBruteforce
どんなツールかというと、複数のネームサーバーへ分散して名前解決しかけるという結構強引なツールです。
公式サイトによると、3台のネームサーバーを利用して、9秒で2000クエリーの結果が得られるそうです。
では早速使ってみましょう。
bt # cd /pentest/enumeration/dns-bruteforce/
bt # DNSBruteforce.py
Brute Force DNS (Multithread) Team Revhosts ./script domain servers_list dictionary
ex : ./script domaine.com server.lst hosts-txt
結構短いPythonスクリプトなのですが、Perlしか使えないのでわかる方はこれを題材に僕にPythonのレクチャーしてください。
例を参考にまずは.server.lstを作成して、利用するネームサーバーを好きなだけ書き込んでいきます。
bt # vi server.lst
ついでに標準で入っているホスト名が少ないので、こちらもお好みで好きなだけ書き込みましょう。
bt # vi hosts-txt
どの程度の辞書ファイルまでなら追加できるか試してみたという方がいたらご連絡ください。
対象のドメインを指定して、実行です。
bt # DNSBruteforce.py sample.com server.lst hosts-txt
サーバーの性能やネットワークの太さによってもかかる時間が変わってくると思いますが、以下のような結果が表示されます。
ちなみにこの結果はあくまでもサンプルで本物ではありませんのであしからず。
Information -[*] -- 192.168.1.10
+- thread in progress : 7 hosts of 7
-[*] -- 192.168.1.11
+- thread in progress : 4 hosts of 4- Total in progress : 11
- Find hosts :
['www.sample.com', 'mail.sample.com']
End at : Tue Oct 28 12:44:53 2007
['www.sample.com', 'mail.sample.com']
情報収集というか自分の管理しているドメインの管理にでもお役立てください。
mo2lzm
mo2lzmの使い方。
Slaxの古いモジュール(.mo)をBackTrackで利用できるようにするためのコマンドです。
bt #mo2lzm
Convert old format module .mo (ver < 6) to new .lzm format ( ver >= 6 )
Usage: /usr/bin/mo2lzm oldmod.mo newmod.lzm
このような書式になっています。
例えば、俺はemacsがないとダメなんだみたいな人は、Slaxのモジュールページからまず.moファイルをダウンロードします。
ダウンロードが完了したら、早速lzmファイルに変換してみましょう。
bt # mo2lzm emacs_21_4a_i486_1.mo emacs_21_4a_i486_1.lzm
[==============================================================] 1111/1111 100%
.lzmファイルができたら、uselivemodコマンドでインストールします。
bt # uselivemod emacs_21_4a_i486_1.lzm
module file is stored inside the union, moving to /mnt/live/memory/modules first...
できあがった.lzmファイルで今後も使いそうなものは、自分のFTPサーバーとかにまとめて保存しておくと楽ですね。
日本語入力
BackTrackの開発に日本人はまったく絡んでいないようですが、開発者のmutsさんが日本語勉強したらしくブラウザなどで日本語が入力できるようになっています。
japanese firefox &
というように頭にjapaneseコマンドをつけて、Firefoxを起動します。
その後、Ctrl+Spaceで日本語入力が可能になります。
実際にこのプログラムがどうなっているかというと
Path : /usr/bin/japanese
#!/bin/bash
if [ -z "$1" ]; then
echo "[*] Japanese SCIM Starter Script"
echo "[*] Usage : japanese"
echo "[*] Example : japanese kate "
exit 0
fiif [ -z "$(ps -ef |grep scim |grep -v grep)" ]; then
echo "[*] Scim is not Running"
echo "[*] Starting Scim"
scim -d
fi
echo "[*] Starting $1"
XMODIFIERS="@im=SCIM" LC_ALL=ja_JP.UTF-8 $1 &
このようなシェルスクリプトになっています。
キーボード設定
◆KDEの場合
右下の国旗アイコンを右クリックして、configureを選択
Configure - KDE Control Moduleというウィンドウが開いて、Layoutタブが選択されているはずです。
Keyboard model:japanese 106-key
と選択して
Available layoutsから、【Japan】を選択して、Addボタンを押して利用可能にします。
◆fluxboxの場合
flux自体のメニューには、キー配列の設定がなかった。
Fluxbox documentationに日本語訳ドキュメントあったけど、みあたらず。
直接Xの設定を以下のように修正します。
Option "XkbModel" "jp106"
Option "XkbLayout" "jp"
正直、X Windowとかデスクトップ環境詳しくないので、間違っていたりしたら教えてくださいませ。
VMWare Tools
Backtrack2から、VMWare Toolsが含まれなくなったようで、日頃VMwareから起動させている身からするとちょっと不便に感じるときがあります。
そんなときは、root/toorでログイン後
startx
でKDE起動させて、サイトからvmware-tools.lzmをデスクトップにダウンロードします。
VMWare Tools - Use for BT under VMWare (BT v.2 Final)
http://www.offensive-security.com/downloads.php
ダブルクリックしてモジュールを使えるようにするか、もしくはコマンドラインで
uselivemod vmware-tools.lzm
と入力してモジュールを起動します。
vmware-config-tools.pl
設定をした後、
vmware-toolbox &
とすれば、いちいちCtrl+Altキー押さずにホストOSに移動できて、コピペも楽です。
よかったですね。
VMware Workstation 5 for Windows 日本語版 パッケージ
- 出版社/メーカー: VMware
- 発売日: 2005/04/28
- メディア: CD-ROM
- クリック: 4回
- この商品を含むブログ (16件) を見る
Dmitry
DMitry (Deepmagic Information Gathering Tool)
ターゲットに対する情報をコマンドラインから引き出せるツールです。
bt # dmitry
Deepmagic Information Gathering Tool
"There be some deep magic going on"Usage: dmitry [-winsepfb] [-t 0-9] [-o %host.txt] host
-o Save output to %host.txt or to file specified by -o file
-i Perform a whois lookup on the IP address of a host
-w Perform a whois lookup on the domain name of a host
-n Retrieve Netcraft.com information on a host
-s Perform a search for possible subdomains
-e Perform a search for possible email addresses
-p Perform a TCP port scan on a host
*p1* -f Perform a TCP port scan on a host showing output reporting filtered ports
*p2* -b Read in the banner received from the scanned port
*p3* -t 0-9 Set the TTL in seconds when scanning a TCP port ( Default 2 )
*p4*Requires the -p flagged to be passed
検索エンジンなどから、ターゲットのマシンの情報を引き出したり、簡単なポートスキャンまでできます。
Mor-Pah Studiosからダウンロード可能です。
portsにも入っています。
VNC Server
VNC Serverの使い方。
bt # vncserver
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? nNew 'X' desktop is bt:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bt:1.log
パスワードが短すぎたりすると弾かれるので注意。
RealVNCなどのクライアントソフトを利用して接続すればOK。
・RealVNC
http://www.realvnc.com/
・UltraVNC 日本語版
http://www.vector.co.jp/soft/win95/net/se396437.html
ちょっと話変わりますけど、来月からPacketiX Desktop VPN 無料で使えなくなるのかぁ・・。泣きそう。
http://www.desktopvpn.net/
頼まれたりして、遠隔で知り合いのパソコン操作する時とかルーターの設定いじらなくてもよくて便利だったのに。
hamachi+VNCに切り替えることにしよう。
https://secure.logmein.com/products/hamachi/vpn.asp