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

English

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.

Türkçe

Amaç

Daily AbuseIP Collector (Günlük AbuseIP Toplayıcı), bir Docker konteyneri içinde arka plan servisi olarak çalışmak üzere tasarlanmış bir .NET 9.0 konsol uygulamasıdır. Temel amacı, halka açık bir kara listeden (blocklist) zararlı IP adreslerini otomatik olarak çekmek, filtrelemek ve bir MongoDB veritabanında saklamaktır. Bu sayede, analiz veya engelleme işlemleri için potansiyel olarak kötü niyetli IP adreslerinin güncel bir yerel kopyasına sahip olursunuz.

Nasıl Çalışır?

  1. Veri Çekme: Uygulama her 24 saatte bir borestad/blocklist-abuseipdb deposuna bağlanır ve abuseipdb-s100-1d.ipv4 listesini indirir.
  2. Veri Temizleme: İndirilen içeriği ayrıştırır, yorum satırlarını filtreler ve geçerli IPv4 adreslerini ayıklar.
  3. Veritabanı Güncelleme:
    • Yerel bir MongoDB örneğine bağlanır.
    • Eski verileri kaldırmak için mevcut AbuseIPDB_DailyInfo koleksiyonunu temizler.
    • Yeni çekilen IP adreslerini lastUpdated (son güncelleme) zaman damgasıyla birlikte veritabanına ekler.
  4. Döngü: Bu işlem 1 günlük aralıklarla süresiz olarak tekrarlanır.

Gereksinimler

  • Docker
  • Docker Compose

Kurulum ve Kullanım

  1. Bu depoyu klonlayın.
  2. Proje ana dizinine gidin.
  3. Hem uygulamayı hem de MongoDB veritabanını başlatmak için aşağıdaki komutu çalıştırın:
    docker-compose up -d --build
    
  4. Uygulama hemen veri çekmeye başlayacak ve ardından 24 saat boyunca uyku moduna geçecektir.

Yapılandırma

  • Veritabanı Kimlik Bilgileri: Uygulama, MongoDB'ye admin kullanıcı adı ve Strong_Password_1881 şifresi ile bağlanacak şekilde yapılandırılmıştır. Bu kimlik bilgileri, docker-compose.yml dosyası aracılığıyla uygulama ve MongoDB Docker konteyneri arasında senkronize edilmiştir.
Source Code Explorer
/
Select a file
2024 © Tağmaç Han