Asnap : Tool To Render Recon Phase Easier

Asnap aims to render recon phase easier by providing regularly updated data about which companies owns which ipv4 or ipv6 addresses and allows the user to automate initial port and service scanning.

Installation

  • Precompiled Binary

If you have Go installed and configured in your $PATH enviroment variable, simply run:

go get -u github.com/paradoxxer/asnap

If you want to use precompiled binary, you also need to download “move.sh” and “nmap.sh” files and place them in the same directory with asnap.

To download the database that asnap searches from, you need to provide a key. To get your free key, sign up here -> https://www.maxmind.com/en/geolite2/signup after signing up navigate -> services -> My license key and create new key. Then create “asnap_conf.txt” inside the same directory with asnap, and paste your key to first line of “asnap_conf.txt”:

echo ‘insert key’ > asnap_conf.txt

To be able to use port scanning functionality, you need to install nmap to your machine:

* Debian Based Distros:
sudo apt install nmap

* MacOS
brew install nmap

* Arch Based Distros
sudo pacman -S nmap

Build Yourself (Recommended)

Download the source code:

git clone git@github.com:paradoxxer/asnap.git

Install golang here -> https://golang.org/doc/install or you can install go if it is available in your package manager:

sudo apt install golang

After downloading the source code, navigate through the project directory and run:

go build

This will produce asnap binary. After you build it, create asnap_conf.txt inside the same directory with the asnap, insert your key to first line and you are good to go.

echo ‘insert key’ > asnap_conf.txt

Usage and Examples

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.

Use Cases

While you can use asnap manually, you can automate this whole process with cron jobs(see -> https://en.wikipedia.org/wiki/Cron). For example after you supplied an input file with -infile argument, All you have to do is check the output file and regularly modify input file to your needs. By default output file named: “MM-DD-YYYY_out.txt”.

R K

Recent Posts

groupdel Command in Linux: Remove a Group and Audit Files

The groupdel command in Linux removes a group from the system. It deletes the group's entry from /etc/group and /etc/gshadow,…

13 hours ago

wc Command in Linux: Count Lines, Words, Characters, and Bytes

The wc command in Linux counts lines, words, characters, and bytes in files or standard input. It…

13 hours ago

top Command in Linux: Monitor Processes and Resource Usage

The top command in Linux provides a real-time view of running processes and system resource usage. From…

14 hours ago

usermod Command in Linux: Modify User Accounts and Groups

The usermod command in Linux modifies existing user account attributes. You can use it to manage group…

14 hours ago

sort Command in Linux: Sort Text, Numbers, Columns, and More

The sort command in Linux reads lines from files or standard input and writes them to standard…

2 days ago

wall Command in Linux: Broadcast Messages to Logged-In Users

The wall command in Linux sends a message to the terminals of all currently logged-in users. The…

2 days ago