Daily AbuseIP Collector | Tağmaç - root@Tagoletta:~#

Daily AbuseIP Collector

Exploit / Project Details

C# Sun Dec 15 2024

The Daily AbuseIP Collector is a .NET 9.0 console application designed to run as a background service within a Docker container. Its primary purpose is to automatically fetch, filter, and store a list of abusive IP addresses from a public blocklist into a MongoDB database.

Detailed Write-up

Purpose

The Daily AbuseIP Collector is a .NET 9.0 console application designed to run as a background service within a Docker container. Its primary purpose is to automatically fetch, filter, and store a list of abusive IP addresses from a public blocklist into a MongoDB database. This ensures that you have an up-to-date local copy of potentially malicious IP addresses for analysis or blocking purposes.

How It Works

  1. Data Fetching: Every 24 hours, the application connects to the borestad/blocklist-abuseipdb repository and downloads the abuseipdb-s100-1d.ipv4 list.
  2. Data Cleaning: It parses the downloaded content, filtering out comments and extracting valid IPv4 addresses.
  3. Database Update:
    • It connects to a local MongoDB instance.
    • It clears the existing AbuseIPDB_DailyInfo collection to remove old data.
    • It inserts the newly fetched IP addresses along with a lastUpdated timestamp.
  4. Cycle: The process repeats indefinitely with a 1-day interval.

Prerequisites

  • Docker
  • Docker Compose

Installation & Usage

  1. Clone this repository.
  2. Navigate to the project root directory.
  3. Run the following command to start both the application and the MongoDB database:
    docker-compose up -d --build
    
  4. The application will start fetching data immediately and then sleep for 24 hours.

Configuration

  • Database Credentials: The application is configured to connect to MongoDB with the username admin and password Strong_Password_1881. These credentials are synchronized between the application and the MongoDB Docker container via docker-compose.yml.

Source Code Explorer
/
Select a file