LoginSignup
3
3

theharvesterインストールと簡単な使い方

Last updated at Posted at 2020-11-13

theharvester って?

  • OSINT(open source intelligence)ツール
  • ドメイン名から内包するホストやメールアドレス、名前、サブドメイン、IP、URLなどを探してくれる。
    自ドメインのメールアドレスが、意図せず公開されていないか調べる時なんかに便利です。
  • KaliLinux だったら追加インストールする事なく利用出来ます。
  • 検索エンジンを使って調べるので、マイナーなドメインだと殆ど情報が得られない事もあります。
  • 沢山の情報ソースを利用できるけど、APIキーの登録が必要なものも多くあります。
    APIキーが必要な検索サービスは 配布元の github:laramies/theHarvesterで確認出来ます。

インストール

MacOSの場合

今回はMacOS Catalina で利用するためにインストールから始めます。
楽をしたいので、brewを使ってインストールしちゃいます。
※最近、私の環境では動かせてません。。。

user01@imac ~ % brew install theharvester

brew: command not found が出る場合、Homebrewがインストールされていないかも知れません。
先に Homebrewのインストール を行いましょう。

Ubuntu 21.10 の場合

user01@user01-ubuntu21:~$ sudo apt install python3-testresources
user01@user01-ubuntu21:~$ sudo apt install git 
user01@user01-ubuntu21:~$ git clone https://github.com/laramies/theHarvester 
user01@user01-ubuntu21:~$ cd theHarvester/ 
user01@user01-ubuntu21:~/theHarvester$ sudo apt install python3-pip 
user01@user01-ubuntu21:~/theHarvester$ python3.9 -m pip install -r requirements/dev.txt
user01@user01-ubuntu21:~/theHarvester$ ./theHarvester.py -h 

Ubuntu 23.04 の場合

user01@ubuntu23:~$ sudo apt install git
user01@ubuntu23:~$ git clone https://github.com/laramies/theHarvester
user01@ubuntu23:~$ cd theHarvester
user01@ubuntu23:~/theHarvester$ sudo apt install python3-venv python3-pip
user01@ubuntu23:~/theHarvester$ python3 -m pip --version
pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)
user01@ubuntu23:~/theHarvester$ python3 -m venv env
user01@ubuntu23:~/theHarvester$ source env/bin/activate
(env) user01@ubuntu23:~/theHarvester$ which python
/home/user01/theHarvester/env/bin/python
(env) user01@ubuntu23:~/theHarvester$ python3 -m pip install -r requirements/dev.txt
(env) user01@ubuntu23:~/theHarvester$ ./theHarvester.py -h

使い終わったら
(env) user01@ubuntu23:~/theHarvester$ deactivate

使い方

オプション一覧

(env) user01@ubuntu23:~/theHarvester$ ./theHarvester.py -h
*******************************************************************
*  _   _                                            _             *
* | |_| |__   ___    /\  /\__ _ _ ____   _____  ___| |_ ___ _ __  *
* | __|  _ \ / _ \  / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *
* | |_| | | |  __/ / __  / (_| | |   \ V /  __/\__ \ ||  __/ |    *
*  \__|_| |_|\___| \/ /_/ \__,_|_|    \_/ \___||___/\__\___|_|    *
*                                                                 *
* theHarvester 4.4.3                                              *
* Coded by Christian Martorella                                   *
* Edge-Security Research                                          *
* cmartorella@edge-security.com                                   *
*                                                                 *
*******************************************************************
usage: theHarvester.py [-h] -d DOMAIN [-l LIMIT] [-S START] [-p] [-s] [--screenshot SCREENSHOT] [-v]
                       [-e DNS_SERVER] [-t] [-r [DNS_RESOLVE]] [-n] [-c] [-f FILENAME] [-b SOURCE]

theHarvester is used to gather open source intelligence (OSINT) on a company or domain.

options:
  -h, --help            show this help message and exit
  -d DOMAIN, --domain DOMAIN
                        Company name or domain to search.
  -l LIMIT, --limit LIMIT
                        Limit the number of search results, default=500.
  -S START, --start START
                        Start with result number X, default=0.
  -p, --proxies         Use proxies for requests, enter proxies in proxies.yaml.
  -s, --shodan          Use Shodan to query discovered hosts.
  --screenshot SCREENSHOT
                        Take screenshots of resolved domains specify output directory: --screenshot
                        output_directory
  -v, --virtual-host    Verify host name via DNS resolution and search for virtual hosts.
  -e DNS_SERVER, --dns-server DNS_SERVER
                        DNS server to use for lookup.
  -t, --take-over       Check for takeovers.
  -r [DNS_RESOLVE], --dns-resolve [DNS_RESOLVE]
                        Perform DNS resolution on subdomains with a resolver list or passed in resolvers,
                        default False.
  -n, --dns-lookup      Enable DNS server lookup, default False.
  -c, --dns-brute       Perform a DNS brute force on the domain.
  -f FILENAME, --filename FILENAME
                        Save the results to an XML and JSON file.
  -b SOURCE, --source SOURCE
                        anubis, baidu, bevigil, binaryedge, bing, bingapi, bufferoverun, brave, censys,
                        certspotter, criminalip, crtsh, dnsdumpster, duckduckgo, fullhunt, github-code,
                        hackertarget, hunter, hunterhow, intelx, netlas, onyphe, otx, pentesttools,
                        projectdiscovery, rapiddns, rocketreach, securityTrails, sitedossier, subdomaincenter,
                        subdomainfinderc99, threatminer, tomba, urlscan, virustotal, yahoo, zoomeye

使用例

apple.com について、調べる場合はこんな感じ

(env) user01@ubuntu23:~/theHarvester$ ./theHarvester.py -d apple.com -b yahoo

実際に調べる時は、いろいろなソースを指定して検索してみるのが良さそうです。
ただ、APIキーが必要になるSOURCE が多いので注意しましょう。(例えば bing もAPIキーが必要です。)

参考にしたサイト

github laramies / theHarvester
pip と仮想環境を使ってパッケージをインストールする
Bing Search の価格

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3