Github Kaynak Kodu: https://go.emrecb.com/secure-php-link-shortener-github
🚀 Temel Teknik Özellikler
Bu proje, herhangi bir hazır framework kullanılmadan Saf (Native) PHP ile geliştirilmiş, yüksek performanslı ve siber güvenlik odaklı bir URL kısaltma servisidir. Geleneksel veritabanı sunucularına (MySQL/PostgreSQL) ihtiyaç duymadan, SQLite (WAL Modu) mimarisi üzerinde çalışan sistem; milisaniyeler mertebesinde yönlendirme hızı sunarken, aynı zamanda gelişmiş bir Saldırı Tespit Sistemi (IDS) gibi davranır.
📄 Proje Özeti
1. Mimari ve Performans
- Frameworksüz Yapı: PHP 8.x motoru üzerinde “Zero-Dependency” (sıfır bağımlılık) prensibiyle yazılarak işlem yükü (overhead) minimize edildi.
- Veritabanı Optimizasyonu: SQLite3 veritabanı WAL (Write-Ahead Logging) modunda yapılandırılarak, yüksek trafik altında eş zamanlı okuma/yazma performansı maksimize edildi.

2. Gelişmiş Güvenlik Katmanı (WAF & IDS)
- Kademeli Erişim Kontrolü (ACL): Link bazlı şifreleme (Bcrypt), son kullanma tarihi (TTL) ve IP Whitelist/Blacklist yönetimi.
- Anti-Flood Koruması: Oturum tabanlı (Session-based) hız sınırlama algoritması ile DoS saldırıları ve bot trafiği engelleme.
- Brute-Force Koruması: Şifreli linklere yapılan denemelerde gecikmeli yanıt mekanizması.
- CSRF & XSS Koruması: Yönetim panelinde token tabanlı form doğrulama ve çıktı filtreleme.


3. Olay Güdümlü Bildirim Sistemi (Event-Driven Notifications)
- Gerçek Zamanlı İzleme: Sistemdeki kritik olaylar Telegram Bot API entegrasyonu ile anlık olarak yöneticiye raporlanır.
- Saldırı Tespiti: Şifreli linklere yapılan hatalı giriş denemeleri, saldırganın IP adresi, denediği şifre ve User-Agent bilgisiyle birlikte raporlanır.
- Aktivite Logları: API veya Panel üzerinden oluşturulan yeni linkler ve başarılı girişler anlık bildirilir.

4. Forensic Loglama ve İstatistikler
- Detaylı Trafik Analizi: Her ziyaretçinin IP adresi, Tarayıcı Parmak İzi (User-Agent), Referrer bilgisi ve tüm HTTP Header detayları ham veri olarak saklanır.
- Admin Dashboard: Logların ve tıklama istatistiklerinin görselleştirildiği yönetim paneli.

5. RESTful API Entegrasyonu
- Token Authentication: 3. parti yazılımlar ve otomasyon araçları (örn. Apple Shortcuts) için güvenli API uç noktası.
- Esnek Parametreler: API üzerinden özel link adı (slug), şifre, süre ve hedef URL tanımlama yeteneği.



🛠️ Kullanılan Teknolojiler
- Backend: PHP 8 (Native), cURL
- Database: SQLite3 (WAL Mode Enabled)
- Frontend: HTML5, CSS3 (Responsive Admin UI)
- API: Telegram Bot API, RESTful Custom Endpoint
High-Performance Custom Link Shortener & Security Engine
Github Source Code: https://go.emrecb.com/secure-php-link-shortener-github
📄 Executive Summary
A lightweight, secure, and framework-free link management system built with Native PHP. Designed to operate without heavy database servers like MySQL, this project utilizes a highly optimized SQLite (WAL Mode) architecture. It serves not only as a URL shortener but also as a traffic monitoring tool with integrated Intrusion Detection (IDS) capabilities, ensuring ultra-low latency redirection.
🚀 Key Technical Features
1. Architecture & Performance
- Zero-Dependency Core: Built with pure PHP 8.x to eliminate framework overhead, ensuring maximum execution speed.
- Database Optimization: Configured with SQLite Write-Ahead Logging (WAL) mode to handle high concurrency and prevent database locks during peak traffic.

2. Security Architecture (WAF & IDS)
- Granular Access Control: Features per-link password protection (Bcrypt hashing), Time-to-Live (TTL) expiration, and IP-based Whitelisting/Blacklisting.
- Anti-Flood Mechanism: Implements a session-based rate-limiting algorithm to mitigate DoS attacks and abusive bot traffic.
- Brute-Force Mitigation: Artificial delay injection for failed authentication attempts on protected links.
- CSRF & XSS Protection: Token-based validation for all administrative actions and strict output sanitization.


3. Event-Driven Notification System
- Real-Time Intelligence: Integrated with Telegram Bot API via cURL to push instant alerts for critical system events.
- Intrusion Detection: Detects and reports failed password attempts on protected links, capturing the intruder’s IP address, the attempted password payload, and device fingerprint.
- Activity Monitoring: Instant alerts for new link generation (via API/Admin) and successful access events.

4. Forensic Logging & Analytics
- Deep Traffic Analysis: Captures and stores granular visitor data including IP addresses, User-Agents, Referrers, and full HTTP Headers for security auditing.
- Admin Dashboard: A centralized panel for visualizing click-through rates (CTR), logs, and system health.

5. RESTful API Integration
- Token-Based Authentication: Secure API endpoint designed for third-party integrations and automation tools (e.g., Apple Shortcuts).
- Flexible Parameterization: Supports custom slug creation, password assignment, expiration setting, and URL targeting via API requests.



🛠️ Tech Stack
- Backend: PHP 8 (Native), cURL Library
- Database: SQLite3 (WAL Mode Enabled)
- Frontend: HTML5, CSS3 (Responsive Admin UI)
- Integration: Telegram Bot API, Custom REST API



Bir yanıt yazın