GithubHelp home page GithubHelp logo

anthrax3 / asnlookup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yassineaboukir/asnlookup

0.0 1.0 0.0 56 KB

Leverage ASN to look up IP addresses (IPv4 & IPv6) owned by a specific organization for reconnaissance purposes, then run port scanning on it.

Python 90.98% Dockerfile 9.02%

asnlookup's Introduction

                            ____ ____ _  _ _    ____ ____ _  _ _  _ ___
                            |__| [__  |\ | |    |  | |  | |_/  |  | |__]
                            |  | ___] | \| |___ |__| |__| | \_ |__| |

                                     Author: Yassine Aboukir

Description

An autonomous system number (ASN) is a unique number assigned to an autonomous system (AS) by the Internet Assigned Numbers Authority (IANA). An AS consists of blocks of IP addresses which have a distinctly defined policy for accessing external networks and are administered by a single organization

This tool will search an updated database for a specific organization's ASN then use the latter to look up all IP addresses (IPv4 and IPv6) registered and owned by the organization.


As of Jan 3rd, 2020.

A web application version of this tool which was built with Flask is live on http://asnlookup.com/

Objective

This script should be used during reconnaissance phase to identify properties owned by the company, and run a port scan on it to identify open ports and publicly exposed services.

Usage

  • Tested on Python >= 2.7 and Python 3.5. Execute the following:
$ git clone https://github.com/yassineaboukir/Asnlookup && cd Asnlookup
$ pip install -r requirements.txt (or pip3 install -r requirements.txt if you're using Python3)
  • Sign up for a free account on Maxmind: https://www.maxmind.com/en/geolite2/signup
  • Sign in and browse to https://www.maxmind.com/en/accounts/1 > My License Key > Generate new license key > Check No for Will this key be used for GeoIP Update?.
  • Open config.py with a text editor, and replace key_here placeholder with the license key you generated.

To use, execute:

$ python asnlookup.py -o <Organization>`

Port Scanning

The tool exports the list of IP addresses as a text file which you can use with other tools such as Masscan. On the other hand, the tool supports Nmap and Masscan port scanning but it requires you to already have both installed on your machine. How to?

  • For Nmap:
- On CentOS

yum install nmap

- On Debian

apt-get install nmap

- On Ubuntu

sudo apt-get install nmap

- Mac OS

brew install nmap
  • For Masscan: NOTE THAT MASSCAN DOESN'T SUPPORT IPV6 PORT SCANNING

Please refer to https://github.com/robertdavidgraham/masscan/

To scan the IP addresses, append to the command -m arugment for Masscan or -n for Nmap:

$ python asnlookup.py -m -o <Organization>

You can also pass your own Nmap/Masscan arguments (Default for nmap: -p 1-65535 -T4 -A -v; default for Masscan: -p0-65535 --rate 200).

$ python asnlookup.py -m="<Masscan arguments>" -o <Organization>

Example using Nmap with custom arguments:

$ python asnlookup.py -n="--top-ports 65535" -o twitter

It will export the result to a text file in the output directory (E.g: ./output/salesforce.txt) then run Nmap.

Limitation

For smaller organizations the ASN will usually be that of their ISP whereas the hostname might not. One example of this is 207.97.227.245, a GitHub IP address. The ASN is AS27357 (Rackspace Hosting), but the hostname is pages.github.com.

Support

If you appreciate my work and wish to support it, feel free to:

asnlookup's People

Contributors

yassineaboukir avatar vortexau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.