
모듈식 Python 애플리케이션으로 악성 호스트에 대한 인텔리전스를 수집합니다.
이 도구는 호스트에 대한 다양한 인텔리전스 소스를 수집하는 데 사용됩니다. Hostintel은 모듈 방식으로 작성되어 새로운 인텔리전스 소스를 쉽게 추가할 수 있습니다.
호스트는 FQDN 호스트 이름, 도메인 또는 IP 주소로 식별됩니다. 이 도구는 현재 IPv4만 지원합니다. 출력은 CSV 형식이며 STDOUT으로 전송되어 데이터를 저장하거나 다른 프로그램으로 파이핑할 수 있습니다. 출력이 CSV 형식이므로 Excel과 같은 스프레드시트나 데이터베이스 시스템에서 쉽게 데이터를 가져올 수 있습니다.
이 도구에 대한 짧은 소개 영상을 YouTube에 올렸습니다: https://youtu.be/aYK0gILDA6w
이 도구는 Python v2 및 Python v3에서 작동합니다. Python v3에서 작동하지 않는 경우 이슈를 게시해 주세요.
$ 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를 읽어주세요.