
GeoLite2 데이터베이스를 사용하여 IPv4/IPv6 주소를 조직에 매핑함으로써 정찰을 자동화하며, 통합된 nmap 포트 스캔 및 입력 파일을 통한 배치 처리를 지원합니다.
Asnap은 정기적으로 업데이트된 데이터를 제공하여 어떤 회사가 어떤 IPv4 또는 IPv6 주소를 소유하고 있는지 쉽게 파악하고, 사용자가 초기 포트 및 서비스 스캔을 자동화할 수 있도록 하여 정찰 단계를 더 쉽게 만드는 것을 목표로 합니다.
█████╗ ███████╗███╗ ██╗ █████╗ ██████╗
██╔══██╗██╔════╝████╗ ██║██╔══██╗██╔══██╗
███████║███████╗██╔██╗ ██║███████║██████╔╝
██╔══██║╚════██║██║╚██╗██║██╔══██║██╔═══╝
██║ ██║███████║██║ ╚████║██║ ██║██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝
Author : Mehmet Berkay Yuksel | twitter -> @paradoxxer
Go가 설치되어 있고 $PATH 환경 변수에 구성되어 있다면, 다음 명령어를 실행하세요:
go get -u github.com/yukselberkay/asnap
사전 컴파일된 바이너리를 사용하려면 "move.sh" 및 "nmap.sh" 파일을 다운로드하여 asnap과 같은 디렉토리에 배치해야 합니다.
asnap이 검색하는 데이터베이스를 다운로드하려면 키를 제공해야 합니다. 무료 키를 얻으려면 여기 -> https://www.maxmind.com/en/geolite2/signup 에서 가입하세요. 가입한 후 서비스 -> My license key로 이동하여 새 키를 만드세요. 그런 다음 asnap과 같은 디렉토리에 "asnap_conf.txt" 파일을 만들고 키를 "asnap_conf.txt"의 첫 번째 줄에 붙여넣으세요:
echo 'insert key' > asnap_conf.txt
포트 스캔 기능을 사용하려면 nmap을 시스템에 설치해야 합니다:
* Debian Based Distros:
sudo apt install nmap
* MacOS
brew install nmap
* Arch Based Distros
sudo pacman -S nmap
소스 코드 다운로드:
git clone [email protected]:yukselberkay/asnap.git
Go 언어 설치: https://golang.org/doc/install 또는 패키지 매니저에서 Go를 사용할 수 있다면 다음 명령어로 설치할 수 있습니다:
sudo apt install golang
소스 코드를 다운로드한 후, 프로젝트 디렉토리로 이동하여 다음을 실행하세요:
go build
이렇게 하면 asnap 바이너리가 생성됩니다. 빌드한 후, asnap과 같은 디렉토리에 asnap_conf.txt를 만들고 키를 첫 번째 줄에 입력하면 준비가 완료됩니다.
echo 'insert key' > asnap_conf.txt
사용법 및 예제
Usage of ./asnap:
-download Download database for the first usage.
-update Update downloaded database. (Geolite databases updates once a week.).
-search Specify search.
-ipv4 Specify ipv4 database to search.
-ipv6 Specify ipv6 database to search.
-company Search by company name.
-asn Search by as number.
-outfile Specifies a name for the output text. By default, output file is named: MM-DD-YYYY_out.txt
-infile Use specified .txt file as input. Asnap will iterate every line, and treats them as company names and searches specified database with given inputs.
-nmap Passes found ip addresses to nmap.
Examples:
"$asnap -download" -> Downloads database with given key, for the first time.
"$asnap -update" -> Updates database.
"$asnap -search -ipv4 -company="example" " -> Search ipv4 database by company name "example"
"$asnap -search -ipv6 -asn 13337" -> Search ipv6 database by as number "13337"
"$asnap -search -ipv4 -company="github" -outfile /path/to/output/file" -> Search ipv4 database by company name "test" and save output to specified path.
"$asnap -search -ipv4 -infile /path/to/input/file.txt -nmap" -> Give a list of company names as input, search it inside ipv4 database and pass found ip addresses to nmap for port scanning.
asnap을 수동으로 사용할 수 있지만, cron 작업(참고: https://en.wikipedia.org/wiki/Cron)을 통해 이 전체 과정을 자동화할 수 있습니다. 예를 들어 -infile 인자로 입력 파일을 제공한 후에는 출력 파일을 확인하고 필요에 따라 입력 파일을 정기적으로 수정하기만 하면 됩니다. 기본 출력 파일 이름은 "MM-DD-YYYY_out.txt"입니다.
질문이나 추가하고 싶은 기능이 있으면 언제든지 연락 주세요. 트위터 -> https://twitter.com/paradoxxer 링크드인 -> https://www.linkedin.com/in/mehmet-berkay-y%C3%BCksel-ab78aa153/ 웹사이트 -> https://yukselberkay.me