Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🛡️ Lightweight Async SSH Honeypot & Intrusion Detection System (IDS)

English | العربية


🇬🇧 Project Description

A lightweight, dependency-free SSH Honeypot and Intrusion Detection System (IDS) built from scratch using native Node.js and pure asynchronous JavaScript (ES6+).

Unlike heavy security frameworks, this custom defense tool leverages Node.js non-blocking architecture (net and fs.promises modules) to catch, log, and mitigate brute-force attempts in real-time. It features an automated IP Banning mechanism, making it highly optimized for resource-constrained environments like mobile Termux setups or low-end cloud VPS.

🎯 Engineering & Architectural Highlights

  • Zero-Dependency Architecture: Engineered purely on native Node.js core system modules (net, fs, path) ensuring maximum performance and execution speed.
  • Smart Cyber Deception: Mimics a vulnerable Ubuntu Linux SSH terminal banner (OpenSSH_8.9p1) to trick attackers into executing brute-force attacks.
  • Asynchronous Network Auditing & Persistent Logging: Streams attacker payloads (usernames, passwords, and commands) into a persistent honeypot_activity.log file using asynchronous writing without blocking the event loop.
  • Automated IP Banning (DevSecOps Alignment): Features a state-of-the-art memory-efficient tracking layer. If an IP exceeds 3 failed authentication attempts, the core socket automatically executes .destroy(), bans the IP, and auto-releases it after 60 seconds.

🚀 Quick Start & Testing (Termux / Linux)

  1. Clone and Run:
    node honeypot.js
  2. Simulate an Attack (Open a New Terminal):
    nc localhost 8022
  3. Verify the Cyber Defense Logs:
    cat honeypot_activity.log

🇸🇦 وصف المشروع (باللغة العربية)

مشروع مصيدة مخترقين (Honeypot) ونظام كشف اختراق (IDS) ذكي وخفيف للغاية، تم بناؤه بالكامل من الصفر باستخدام لغة JavaScript وبيئة Node.js الأصلية دون الاعتماد على أي مكتبات خارجية (Dependency-Free).

يقوم المشروع بمحاكاة خادم لخطوط اتصال SSH وهمية لخداع المتسللين والمهاجمين في الشبكة، ورصد محاولاتهم وتخميناتهم لخدمات النظام وتخزينها في سجلات أمنية فورية، مع ميزة الحظر التلقائي الذكي (IP Banning) للأجهزة المهاجمة لحماية موارد النظام وتوفير أعلى أداء ممكن داخل البيئات محدودة الموارد مثل تطبيق Termux على الهاتف أو الخوادم السحابية الضعيفة.

🎯 الابتكار الهندسي والمعماري للمشروع

  • برمجة نقيّة بدون مكتبات (Zero Dependencies): يعتمد الكود كلياً على الوحدات الأساسية للنظام (net, fs, path) لضمان سرعة معالجة قصوى وخفة متناهية.
  • الخداع السيبراني الذكي (Cyber Deception): يقوم السيرفر بإرسال راية نظام تشغيل وهمية لـ Ubuntu Linux لإغراء المهاجمين وأدوات الفحص التلقائي بجعلهم يعتقدون أنه نظام حقيقي قابل للاختراق.
  • إدارة الاتصالات غير الحاصرة (Async Events): معالجة مئات الاتصالات المتزامنة والقراءة من البافر (Buffers) وحفظ السجلات بشكل غير متزامن تماماً لضمان عدم توقف الـ JavaScript Event Loop.
  • نظام الحظر التلقائي (IP Banning): تتبع عناوين الـ IP في الذاكرة بشكل ذكي؛ بمجرد تجاوز المهاجم لـ 3 محاولات فاشلة، يقوم النظام بتدمير السوكيت فوراً (socket.destroy()) وحظر عنوانه لمده 60 ثانية قبل فكه تلقائياً.

🛠️ طريقة التشغيل والاختبار داخل Termux

  1. تشغيل المصيدة الأمنية:
    node honeypot.js
  2. محاكاة هجوم تخمين (في نافذة جديدة):
    nc localhost 8022
  3. استعراض تقرير الأداء ورصد الاختراق:
    cat honeypot_activity.log

About

A high-performance, dependency-free SSH/Telnet Honeypot and Intrusion Detection System (IDS) built from scratch using native Node.js asynchronous architecture. Features non-blocking TCP socket management, plain-text payload parsing, and automated memory-efficient IP banning. Highly optimized for resource-constrained environments like Terminal

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages