Coder Social home page Coder Social logo

dfirsec / blacklist_check Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 42.9 MB

Simple script to download and query IP address reputation lists from various sources.

License: MIT License

Python 100.00%
python3 blacklisted-ips blacklist-check download-blacklists blacklist blacklist-feed re blacklists reputation

blacklist_check's Introduction

IP Blacklist Check

Generic badge Twitter

Python script that downloads IP reputation blacklists from various sources and queries an IP address, or multiple IPs, against those lists. Utilizes the FreeGeopIP Live service for IP geolocation - ref: https://freegeoip.live/

API Key (add to settings.ini file) required for the following:

  • AbuseIPDB
  • Shodan
  • VirusTotal

Installation

git clone https://github.com/dfirsec/blacklist_check.git
cd blacklist_check
pip install -r requirements.txt

Usage

        ____  __           __   ___      __     ________              __
       / __ )/ /___ ______/ /__/ (_)____/ /_   / ____/ /_  ___  _____/ /__
      / __  / / __ `/ ___/ //_/ / / ___/ __/  / /   / __ \/ _ \/ ___/ //_/
     / /_/ / / /_/ / /__/ ,< / / (__  ) /_   / /___/ / / /  __/ /__/ ,<
    /_____/_/\__,_/\___/_/|_/_/_/____/\__/   \____/_/ /_/\___/\___/_/|_|

usage: blacklist_check.py [-h] [-t [threads]] [-v] [-a] [-s] [-u | -fu | -sh] [-q query [query ...] | -f file | -i | -r]

IP Blacklist Check

optional arguments:
  -h, --help            show this help message and exit
  -t [threads]          threads for rbl check (default 25, max 50)
  -v                    check virustotal for ip info
  -a                    check abuseipdb for ip info
  -s                    check shodan for ip info
  -u                    update blacklist feeds
  -fu                   force update of all feeds
  -sh                   show blacklist feeds
  -q query [query ...]  query a single or multiple ip addrs
  -f file               query a list of ip addresses from file
  -i                    insert a new blacklist feed
  -r                    remove an existing blacklist feed

Example Run

alt text

blacklist_check's People

Contributors

dfirsec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pospelov-v

blacklist_check's Issues

doesnt work lot of url

Traceback (most recent call last):
File "/root/blacklist_check/utils/main_worker.py", line 199, in fetch
resp.raise_for_status()
File "/usr/local/lib/python3.6/site-packages/httpx/_models.py", line 1510, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '503 Service Temporarily Unavailable' for url 'https://www.threatcrowd.org/feeds/ips.txt'
For more information check: https://httpstatuses.com/503

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "blacklist_check.py", line 239, in
main()
File "blacklist_check.py", line 104, in main
pbl.update_list()
File "/root/blacklist_check/utils/main_worker.py", line 256, in update_list
bl_dict["Blacklists"][name] = self.get_feeds(url)
File "/root/blacklist_check/utils/main_worker.py", line 212, in get_feeds
results = trio.run(self.fetch, feed)
File "/usr/local/lib/python3.6/site-packages/trio/_core/_run.py", line 1932, in run
raise runner.main_task_outcome.error
File "/root/blacklist_check/utils/main_worker.py", line 205, in fetch
print(f" {Tc.error}{Tc.dl_error} {Tc.gray}{url}{Tc.rst}")
File "/usr/local/lib/python3.6/site-packages/colorama/ansitowin32.py", line 47, in write
self.__convertor.write(text)
File "/usr/local/lib/python3.6/site-packages/colorama/ansitowin32.py", line 172, in write
self.wrapped.write(text)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2716' in position 9: ordinal not in range(128)

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.