Giter VIP home page Giter VIP logo

asnlookup's Introduction

                            ____ ____ _  _ _    ____ ____ _  _ _  _ ___
                            |__| [__  |\ | |    |  | |  | |_/  |  | |__]
                            |  | ___] | \| |___ |__| |__| | \_ |__| |
                                          asnlookup.com
                                     Author: Yassine Aboukir

Notice: The python client is being refactored but you can use asnlookup.com web service or its free/paid API at the moment

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 is a python client which leverages our asnlookup.com free API to find the IP space (IPv4 and IPv6) registered and owned by a specific organization.

ASNLookup searches for the organization ASNs and use the latter to find the IP space. You can also use asnlookup client to run port scanning on the IP space using Nmap or Masscan.

Check out http://asnlookup.com/ for easy use and for the API.

Usage

$ 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)
$ python asnlookup.py -o <Organization>

E.g: python asnlookup.py -o "Capital One"

Port Scanning

The tool supports port scanning using Nmap or Masscan but requires prior installation 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

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 results 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:

Disclaimer

This project is made for educational and ethical testing purposes only. Usage of this tool for attacking targets without prior mutual consent is illegal. Developers assume no liability and are not responsible for any misuse or damage caused by this tool.

asnlookup's People

Contributors

vortexau avatar yassineaboukir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asnlookup's Issues

Error: couldn't connect to asnlookup.com API !

Hello i'm trying to run this script and before python2 i tried this tool with python3 but it's giving me this error:
We couldn't connect to asnlookup.com API. Try again!

So i tried with python2 and the tools sometime works and sometime not nad mostly not! Getting the same error in python2 as python3:
Error:
We couldn't connect to asnlookup.com API. Try again!

Incorrect results for searching "linkedin"

When I request "linkedin" I get many irrelevant IP blocks.
F.e. I've got 185.146.208.0/22 and other blocks from AS134431, which is "News and Entertainment Network Corp", not LinkedIn.

Licence?

Does Asnlookup use some open source licence?

Beautiful Soup Fails with Error

During install, I see:

Requirement already satisfied: requests in /usr/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (2.20.1)
Collecting BeautifulSoup (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-nvbun87p/BeautifulSoup/setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-nvbun87p/BeautifulSoup/

error when i run tool

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

     Author: Yassine Aboukir (@yassineaboukir)

Traceback (most recent call last):
File "asnlookup.py", line 174, in
download_db()
File "asnlookup.py", line 59, in download_db
with open("filesize.txt", "r") as filesize:
IOError: [Errno 2] No such file or directory: 'filesize.txt'

asnlookup.com is down.

Hi,
While running this i got this error :


        ____ ____ _  _ _    ____ ____ _  _ _  _ ___
        |__| [__  |\ | |    |  | |  | |_/  |  | |__]
        |  | ___] | \| |___ |__| |__| | \_ |__| |
                        asnlookup.com
         Author: Yassine Aboukir (@yassineaboukir)

[!] We couldn't connect to asnlookup.com API. Try again!

Thanks.

Passing port list to masscan

I'am unable to pass ports to masscan using the following syntax
python asnlookup.py -m "-p443,80" -o

i get the following error
│asnlookup.py: error: unrecognized arguments: -p443,80

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.