No Description

andre 35e561d147 extend readme 4 years ago
README.md 35e561d147 extend readme 4 years ago
action.php 7630efec66 add protection 4 years ago
admin.php 462b8bcb6e remove reporting 4 years ago
ban.sql 1c3df9b110 add admin view 4 years ago
db.php 3603047484 split classes to files 4 years ago
index.php 462b8bcb6e remove reporting 4 years ago
list.php 462b8bcb6e remove reporting 4 years ago
stats.php 3e12b444ae add protection 4 years ago
token.php 17a9b4909e add admin view 4 years ago

README.md

blacklister

IP collector for blacklists

Installation

Abhängigkeiten

apt-get install libapache2-mod-php default-mysql-server php7.4-mysql git

Source Code

cd WEBROOT git clone https://git.symbionet.de/andre/blacklister.git .

Konfiguration

MySQL

create database DATABASE;
create user 'DBUSER'@localhost identified by 'DBPASS';
grant all privileges on DATABASE.* to 'DBUSER'@localhost;

db.php

Anpassung der Datanbank Zugansdaten in db.php
private $host = 'localhost';
private $user = 'DBUSER';
private $pass = 'DBPASS';
private $db = 'DATABASE';

Admin User anlegen

Token erzeugen

echo "<?php echo bin2hex(random_bytes(16)) . PHP_EOL; ?>" | php
0097fe8900

Token in der Datenbank einpflegen

mysql
use DATABASE;
INSERT INTO clients values('0097fe8900','admin','NAME O. BESCHREIBUNG');

Anwendung

Clients anlegen

Im Webinterface unter /admin.php mit dem Admin Token anmelden:
Role admin: Zugriffsrecht auf das admin Interface
Role reporter: kann IP Adressen eintragen und 3x von der Liste entfernen Role consumer: kann Blocklisten abfragen

IP Adressen reporten

IP Adressen melden kann z.B. als Aktion für fail2ban konfiguriert werden. Über eine REST API können die Adressen via GET Request reportet werden.
wget http(s)://URI/?token=REPORTERTOKEN&ip=IPADRESSE

Blockliste abfragen

Blocklisten werden via REST API ausgeliefert.
wget http(s)://URI/list.php?token=CONSUMERTOKEN