Skip to content

hbourget/IPDBAbuseAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPDBAbuse Checker

License Python Version

Overview

This python tool allows you to verify a list of IP addresses against the AbuseIPDB API. It checks each IP for reported abuse incidents, provides a detailed report, and saves the results in both a CSV file and a formatted table in the console.

Prerequisites

  • Python 3.7 or higher
  • A IPDBAbuse API API key (register on abuseipdb.com)

Installation

  1. Clone the Repository

    https://github.com/hbourget/IPDBAbuseAPI.git
    cd IPDBAbuseAPI
  2. Create a Virtual Environment (Optional but Recommended)

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install Dependencies

    pip install -r requirements.txt

Configuration

  1. Obtain an AbuseIPDB API Key

  2. Set Up Environment Variables

    • Create a .env file in the project root directory:

      touch .env
    • Add your API key to the .env file:

      IPDBABUSE_API_KEY=your_abuseipdb_api_key_here

    Note: Ensure that .env is listed in your .gitignore to prevent exposing your API key.

Usage

  1. Prepare the IPs to check

    • Create a file named ips_to_check.txt in the project root directory.

    • List the IP addresses you want to check, one per line. For example:

      192.168.1.1
      8.8.8.8
      1.1.1.1
  2. Run the Script

    python main.py
  3. View the Results

    • The script will display a formatted table in the console.
    • Results will also be saved to results.csv in the project directory.

Output

CSV File:

  • File name: results.csv
  • Columns:
    • Timestamp
    • IP Address
    • Reported?
    • Report Count
    • Abuse Confidence Score

Example:

Timestamp,IP Address,Reported?,Report Count,Abuse Confidence Score
2025-01-22 14:30:00,192.168.1.1,No,0, 0
2025-01-22 14:30:01,8.8.8.8,Yes,5,75
2025-01-22 14:30:02,1.1.1.1,No,0,0

License

This project is licensed under the MIT License.

About

Easily bulk request the IPDBAbuse API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages