
悪意のあるホストのインテリジェンスを収集するためのモジュール型Pythonアプリケーション。
このツールは、ホストに関する様々なインテリジェンス情報を収集するために使用されます。 Hostintelはモジュール方式で書かれているため、新しいインテリジェンスソースを簡単に追加できます。
ホストはFQDNホスト名、ドメイン、またはIPアドレスで識別されます。このツールは現時点ではIPv4のみをサポートしています。出力はCSV形式でSTDOUTに送られるため、データを保存したり、別のプログラムにパイプしたりできます。CSV形式で出力されるため、Excelなどのスプレッドシートやデータベースシステムで簡単にインポートできます。
このツールの短い紹介動画をYouTubeで作成しました: https://youtu.be/aYK0gILDA6w
Python v2およびPython v3で動作します。Python v3で動作しない場合は、issueを投稿してください。
$ python hostintel.py -h
usage: hostintel.py [-h] [-a] [-d] [-v] [-p] [-s] [-c] [-t] [-o] [-i] [-r]
ConfigurationFile InputFile
Modular application to look up host intelligence information. Outputs CSV to
STDOUT. This application will not output information until it has finished all
of the input.
positional arguments:
ConfigurationFile Configuration file
InputFile Input file, one host per line (IP, domain, or FQDN
host name)
optional arguments:
-h, --help show this help message and exit
-a, --all Perform All Lookups.
-d, --dns DNS Lookup.
-v, --virustotal VirusTotal Lookup.
-p, --passivetotal PassiveTotal Lookup.
-s, --shodan Shodan Lookup.
-c, --censys Censys Lookup.
-t, --threatcrowd ThreatCrowd Lookup.
-o, --otx OTX by AlienVault Lookup.
-i, --isc Internet Storm Center DShield Lookup.
-r, --carriagereturn Use carriage returns with new lines on csv.
まず、設定ファイルがお使いのコンピュータ/インストール環境に合っていることを確認してください。設定ファイルにAPIキーとユーザー名を適切に追加してください。このツールを実行するにはPythonとPipが必要です。GitHubからインストールしなければならないモジュールがあるため、gitコマンドがコマンドラインで使用可能であることを確認してください。Gitはどのプラットフォームでも簡単にインストールできます。次に、Pythonの要件をインストールします(このリポジトリをgit pullするたびにこれも実行してください):
$ pip install -r requirements.txt
Mac OSXの標準のPythonではいくつか問題が報告されています (http://stackoverflow.com/questions/31649390/python-requests-ssl-handshake-failure)。 次のコマンドでrequestsライブラリのセキュリティ部分をインストールする必要があるかもしれません:
$ pip install requests[security]
最後に、私はPythonのvirtualenvが好きです。このツールを実行するためのカスタマイズされたローカルなPythonインストールを作成するには、以下をお読みになることをお勧めします: http://docs.python-guide.org/en/latest/dev/virtualenvs/
$ python hostintel.py myconfigfile.conf myhosts.txt -a > myoutput.csv
myoutput.csvは任意のデータベースやスプレッドシートプログラムにインポートできるはずです。
ネットワーク環境、APIキーの制限、検索対象のデータによっては、このスクリプトが非常に長い時間実行される可能性があることに注意してください!各モジュールは控えめに使用してください!長い待ち時間と引き換えに、手動でデータを収集する手間を省くことができます。
"sampledata"ディレクトリにいくつかのサンプルデータがあります。IP、ドメイン、ホストはランダムに選ばれており、特定の組織や個人を対象としたものではありません。サンプルデータでこのツールを実行すると、次のように動作します:
$ python hostintel.py local/config.conf sampledata/smalllist.txt -a > sampledata/smalllist.csv
*** Processing 8.8.8.8 ***
*** Processing 8.8.4.4 ***
*** Processing 192.168.1.1 ***
*** Processing 10.0.0.1 ***
*** Processing google.com ***
*** Processing 212.227.247.242 ***
*** Writing Output ***
$ python hostintel.py local/config.conf sampledata/largerlist.txt -a > sampledata/largerlist.csv
*** Processing 114.34.84.13 ***
*** Processing 116.102.34.212 ***
*** Processing 118.75.180.168 ***
*** Processing 123.195.184.13 ***
*** Processing 14.110.216.236 ***
*** Processing 14.173.147.69 ***
*** Processing 14.181.192.151 ***
*** Processing 146.120.11.66 ***
*** Processing 163.172.149.131 ***
...
*** Processing 54.239.26.180 ***
*** Processing 62.141.39.155 ***
*** Processing 71.6.135.131 ***
*** Processing 72.30.2.74 ***
*** Processing 74.125.34.101 ***
*** Processing 83.31.179.71 ***
*** Processing 85.25.217.155 ***
*** Processing 93.174.93.94 ***
*** Writing Output ***
設定ファイル用のAPIキーは以下のサイトで取得できます。
大まかなメモはこちらから入手できます。
このアプリケーションはCreative Commons BY-SAライセンスの対象です。
This product includes GeoLite2 data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
Contributing.mdをお読みください。