
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 サインアップ後、services -> 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"です。
質問や追加してほしい機能があれば、お気軽にご連絡ください。 twitter -> https://twitter.com/paradoxxer linkedin -> https://www.linkedin.com/in/mehmet-berkay-y%C3%BCksel-ab78aa153/ Web Site -> https://yukselberkay.me