632 lines
14 KiB
Markdown
632 lines
14 KiB
Markdown
# SPOOFHOST - Mascarea Hostname-urilor Utilizatorilor
|
|
|
|
## 📋 CE ESTE SPOOFHOST?
|
|
|
|
**Spoofhost** (Spoof Host = Host Fals) este un sistem care permite **mascarea hostname-urilor reale** ale utilizatorilor cu **hostname-uri custom** pentru:
|
|
- **Protecția identității** (ascunderea IP-ului real)
|
|
- **Organizare** (hostname-uri distinctive pentru staff/VIP)
|
|
- **Branduri custom** (ex: `admin.underchat.org`, `vip.underchat.org`)
|
|
|
|
Este o funcționalitate de **securitate și personalizare** pentru utilizatori autorizați.
|
|
|
|
---
|
|
|
|
## 🎯 SCOP
|
|
|
|
### **Problema FĂRĂ Spoofhost:**
|
|
|
|
Când un utilizator se conectează la IRC, hostname-ul său este **vizibil public**:
|
|
|
|
```irc
|
|
[14:30] * Joins: User (user@203.0.113.45)
|
|
/WHOIS User
|
|
User is user@203.0.113.45 * Real Name
|
|
# ^^^^^^^^^^^ IP VIZIBIL!
|
|
```
|
|
|
|
**Riscuri:**
|
|
- ❌ IP-ul real este expus → vulnerabil la atacuri DDoS
|
|
- ❌ ISP-ul este vizibil → informații despre locație
|
|
- ❌ Tracking între canale → lipsă de anonimat
|
|
|
|
### **Soluția CU Spoofhost:**
|
|
|
|
```irc
|
|
[14:30] * Joins: Admin (admin@staff.underchat.org)
|
|
/WHOIS Admin
|
|
Admin is admin@staff.underchat.org * Network Admin
|
|
# ^^^^^^^^^^^^^^^^^^^^^ HOSTNAME CUSTOM!
|
|
```
|
|
|
|
**Avantaje:**
|
|
- ✅ IP-ul real este ascuns
|
|
- ✅ Identitate profesională (staff.underchat.org)
|
|
- ✅ Protecție împotriva DDoS
|
|
- ✅ Brandind custom
|
|
|
|
---
|
|
|
|
## 🔧 CUM FUNCȚIONEAZĂ?
|
|
|
|
### **Mecanismul:**
|
|
|
|
1. **Autentificare:** User se conectează normal
|
|
2. **Aplicare Spoofhost:** Fie automat (autoapply), fie manual cu `/SETHOST`
|
|
3. **Transformare:** `user@realip.com` → `user@custom.underchat.org`
|
|
4. **Vizibilitate:** Toată lumea vede hostname-ul fals
|
|
|
|
---
|
|
|
|
## 📝 SINTAXĂ ÎN ircd.conf
|
|
|
|
### **Formatul de bază:**
|
|
|
|
```conf
|
|
Spoofhost "hostname.custom.org" {
|
|
pass = "parola_secreta";
|
|
host = "*@*.provider.com";
|
|
autoapply = no;
|
|
ismask = no;
|
|
matchusername = yes;
|
|
};
|
|
```
|
|
|
|
### **Parametri:**
|
|
|
|
| Parametru | Obligatoriu | Descriere |
|
|
|-----------|-------------|-----------|
|
|
| `"hostname"` | ✅ DA | Hostname-ul fals care va fi afișat (poate include username: `user@host`) |
|
|
| `pass` | ❌ NU | Parola pentru `/SETHOST hostname` (dacă user aplică manual) |
|
|
| `host` | ✅ DA | Hostmask care se potrivește (pentru autoapply sau restricție acces) |
|
|
| `autoapply` | ❌ NU | `yes` = aplicare automată, `no` = necesită `/SETHOST` (default: `no`) |
|
|
| `ismask` | ❌ NU | `yes` = hostname-ul conține wildcards (`*`, `?`), `no` = hostname fix |
|
|
| `matchusername` | ❌ NU | `yes` = verifică și username-ul din hostmask (default: `yes`) |
|
|
|
|
---
|
|
|
|
## 💡 EXEMPLE PRACTICE
|
|
|
|
### **Exemplu 1: Spoofhost AUTOMAT pentru Staff**
|
|
|
|
```conf
|
|
Spoofhost "staff.underchat.org" {
|
|
host = "*@10.0.0.*";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
|
|
**Funcționare:**
|
|
- Oricine se conectează de pe `10.0.0.*` (IP-uri interne/VPN)
|
|
- Primește AUTOMAT hostname: `user@staff.underchat.org`
|
|
- **NU necesită parolă sau comandă**
|
|
|
|
**Rezultat:**
|
|
```irc
|
|
# User se conectează de pe 10.0.0.25:
|
|
[14:30] * Joins: Admin (admin@staff.underchat.org)
|
|
# ^^^^^^^^^^^^^^^^^^^^^^^^ AUTOMAT!
|
|
```
|
|
|
|
---
|
|
|
|
### **Exemplu 2: Spoofhost MANUAL cu Parolă**
|
|
|
|
```conf
|
|
Spoofhost "vip.underchat.org" {
|
|
pass = "parola_vip_123";
|
|
host = "*";
|
|
autoapply = no;
|
|
};
|
|
```
|
|
|
|
**Funcționare:**
|
|
- Orice user poate solicita acest hostname
|
|
- Trebuie să folosească comanda: `/SETHOST vip.underchat.org parola_vip_123`
|
|
- Hostname-ul se schimbă doar după autentificare
|
|
|
|
**Utilizare:**
|
|
```irc
|
|
# User se conectează normal:
|
|
/WHOIS User
|
|
User is user@203.0.113.45
|
|
|
|
# User aplică spoofhost manual:
|
|
/SETHOST vip.underchat.org parola_vip_123
|
|
|
|
# Serverul confirmă:
|
|
:server NOTICE User :Activated host: vip.underchat.org
|
|
|
|
# Acum hostname-ul este schimbat:
|
|
/WHOIS User
|
|
User is user@vip.underchat.org
|
|
# ^^^^^^^^^^^^^^^^^ SCHIMBAT!
|
|
```
|
|
|
|
---
|
|
|
|
### **Exemplu 3: Spoofhost cu USERNAME Custom**
|
|
|
|
```conf
|
|
Spoofhost "admin@admin.underchat.org" {
|
|
host = "adminuser@*";
|
|
autoapply = yes;
|
|
matchusername = yes;
|
|
};
|
|
```
|
|
|
|
**Funcționare:**
|
|
- Potrivește doar user-i cu username `adminuser`
|
|
- Aplică automat hostname: `admin@admin.underchat.org`
|
|
- **Include și user-ul în spoofhost!**
|
|
|
|
**Rezultat:**
|
|
```irc
|
|
# User cu username "adminuser" se conectează:
|
|
[14:30] * Joins: Boss (admin@admin.underchat.org)
|
|
# ^^^^^^^^^^^^^^^^^^^^^^^^^ user+host custom!
|
|
```
|
|
|
|
---
|
|
|
|
### **Exemplu 4: Spoofhost cu WILDCARD (ismask)**
|
|
|
|
```conf
|
|
Spoofhost "*.underchat.org" {
|
|
pass = "parola_wildcard";
|
|
host = "*@trusted.provider.com";
|
|
autoapply = no;
|
|
ismask = yes;
|
|
};
|
|
```
|
|
|
|
**Funcționare:**
|
|
- `ismask = yes` → hostname-ul conține wildcards
|
|
- User poate alege: `staff.underchat.org`, `vip.underchat.org`, `anything.underchat.org`
|
|
- **PERICOL:** User poate evada ban-uri dacă nu e supervizat!
|
|
|
|
**Utilizare:**
|
|
```irc
|
|
# User solicită hostname custom:
|
|
/SETHOST myname.underchat.org parola_wildcard
|
|
|
|
# Hostname se schimbă în ce a ales:
|
|
/WHOIS User
|
|
User is user@myname.underchat.org
|
|
# ^^^^^^^^^^^^^^^^^^^^ Ales de user!
|
|
```
|
|
|
|
⚠️ **ATENȚIE:** Folosește `ismask` doar pentru utilizatori de încredere (operatori)!
|
|
|
|
---
|
|
|
|
### **Exemplu 5: Spoofhost pentru ISP Specific**
|
|
|
|
```conf
|
|
Spoofhost "protected.underchat.org" {
|
|
host = "*@*.dial-up.provider.com";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
|
|
**Funcționare:**
|
|
- Oricine se conectează de pe `*.dial-up.provider.com`
|
|
- Primește automat: `user@protected.underchat.org`
|
|
- Protecție pentru utilizatori de pe ISP cunoscut
|
|
|
|
---
|
|
|
|
## 🎓 CAZURI DE UTILIZARE COMUNE
|
|
|
|
### **1. Staff și Operatori**
|
|
|
|
```conf
|
|
# Administratori
|
|
Spoofhost "admin.underchat.org" {
|
|
host = "*@10.0.0.*";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# Moderatori
|
|
Spoofhost "moderator.underchat.org" {
|
|
host = "*@172.16.0.*";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# Operatori globali
|
|
Spoofhost "staff.underchat.org" {
|
|
pass = "staff_password";
|
|
host = "*";
|
|
autoapply = no;
|
|
};
|
|
```
|
|
|
|
---
|
|
|
|
### **2. Utilizatori VIP/Premium**
|
|
|
|
```conf
|
|
# VIP manual (cu parolă)
|
|
Spoofhost "vip.underchat.org" {
|
|
pass = "vip_secret_2026";
|
|
host = "*";
|
|
autoapply = no;
|
|
};
|
|
|
|
# Premium automat (pe baza IP-ului)
|
|
Spoofhost "premium.underchat.org" {
|
|
host = "*@premium-vpn.service.com";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
|
|
---
|
|
|
|
### **3. Protecție DDoS pentru Toți**
|
|
|
|
```conf
|
|
# Ascunde IP-uri pentru toată lumea
|
|
Spoofhost "users.underchat.org" {
|
|
host = "*";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
|
|
⚠️ **NOTĂ:** Acest lucru ascunde TOATE IP-urile! Poate face debugging-ul dificil.
|
|
|
|
---
|
|
|
|
### **4. Hostname-uri Distinctive pentru Locații**
|
|
|
|
```conf
|
|
# Utilizatori din Europa
|
|
Spoofhost "eu.users.underchat.org" {
|
|
host = "*@*.eu";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# Utilizatori din US
|
|
Spoofhost "us.users.underchat.org" {
|
|
host = "*@*.us";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
|
|
---
|
|
|
|
## ⚙️ CONFIGURARE ÎN ircd.conf
|
|
|
|
### **Exemplu Complet pentru UnderChat:**
|
|
|
|
```conf
|
|
# ============================================================================
|
|
# SECȚIUNE: SPOOFHOST - Mascarea Hostname-urilor
|
|
# ============================================================================
|
|
|
|
# Administratori - Automat pentru IP-uri interne
|
|
Spoofhost "admin.underchat.org" {
|
|
host = "*@10.0.0.*";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# Staff - Manual cu parolă
|
|
Spoofhost "staff.underchat.org" {
|
|
pass = "staff_password_2026";
|
|
host = "*";
|
|
autoapply = no;
|
|
};
|
|
|
|
# VIP - Manual cu parolă
|
|
Spoofhost "vip.underchat.org" {
|
|
pass = "vip_secret";
|
|
host = "*";
|
|
autoapply = no;
|
|
};
|
|
|
|
# Protecție utilizatori - Automat pentru toată lumea
|
|
Spoofhost "users.underchat.org" {
|
|
host = "*";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# Operatori cu hostname custom (freeform pentru operatori)
|
|
# Necesită privilege "freeform" în Operator block
|
|
Spoofhost "*.underchat.org" {
|
|
host = "*@trusted.network.*";
|
|
autoapply = no;
|
|
ismask = yes;
|
|
};
|
|
```
|
|
|
|
---
|
|
|
|
## 🔐 PERMISIUNI OPERATOR (freeform)
|
|
|
|
Pentru ca operatorii să poată folosi `/SETHOST` cu hostname-uri arbitrare (fără Spoofhost pre-configurat), trebuie să aibă privilegiul **`freeform`**:
|
|
|
|
```conf
|
|
Operator {
|
|
name = "AdminUser";
|
|
password = "$MD5$...";
|
|
host = "*@*";
|
|
class = "Opers";
|
|
|
|
# Permisiuni
|
|
privileges = "freeform"; # Permite /SETHOST fără restricții
|
|
};
|
|
```
|
|
|
|
**Cu `freeform`:**
|
|
```irc
|
|
/SETHOST anything.i.want.org
|
|
# Funcționează! (fără să fie configurat în Spoofhost block)
|
|
```
|
|
|
|
---
|
|
|
|
## 🔍 COMENZI UTILIZATOR
|
|
|
|
### **1. /SETHOST - Aplicare Spoofhost Manual**
|
|
|
|
```irc
|
|
# Sintaxă:
|
|
/SETHOST hostname [parola]
|
|
|
|
# Exemplu cu parolă:
|
|
/SETHOST vip.underchat.org vip_secret
|
|
|
|
# Exemplu fără parolă (pentru operatori cu freeform):
|
|
/SETHOST custom.underchat.org
|
|
```
|
|
|
|
### **2. /WHOIS - Verificare Hostname**
|
|
|
|
```irc
|
|
/WHOIS User
|
|
User is user@vip.underchat.org * VIP User
|
|
# ^^^^^^^^^^^^^^^^^ Spoofhost activ
|
|
```
|
|
|
|
---
|
|
|
|
## 📊 AVANTAJE vs DEZAVANTAJE
|
|
|
|
### ✅ **AVANTAJE:**
|
|
|
|
1. **Protecție IP** - Ascunde IP-uri reale împotriva DDoS
|
|
2. **Brandind** - Hostname-uri professional (staff.underchat.org)
|
|
3. **Organizare** - Diferențiază staff/VIP/users
|
|
4. **Flexibilitate** - Automat sau manual, cu/fără parolă
|
|
5. **Personalizare** - Wildcards pentru hostname-uri custom
|
|
|
|
### ⚠️ **DEZAVANTAJE:**
|
|
|
|
1. **Dificultate debugging** - IP-uri ascunse → mai greu de identificat abuzatori
|
|
2. **Risc ismask** - Wildcard-uri pot fi abuzate pentru evadarea ban-urilor
|
|
3. **Configurare necesară** - Trebuie planificat și configurat manual
|
|
4. **Confuzie** - Prea multe spoofhost-uri → dificil de gestionat
|
|
|
|
---
|
|
|
|
## 🚨 BEST PRACTICES
|
|
|
|
### **1. Folosește autoapply pentru staff (IP-uri interne)**
|
|
|
|
```conf
|
|
# BINE:
|
|
Spoofhost "staff.underchat.org" {
|
|
host = "*@10.0.0.*";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
|
|
### **2. Folosește parole PUTERNICE pentru spoofhost-uri publice**
|
|
|
|
```conf
|
|
# EVITĂ:
|
|
pass = "123456"; # ❌ SLAB!
|
|
|
|
# BINE:
|
|
pass = "vip_Str0ng_P@ssw0rd_2026"; # ✅ PUTERNIC!
|
|
```
|
|
|
|
### **3. NU folosi ismask pentru utilizatori obișnuiți**
|
|
|
|
```conf
|
|
# ❌ PERICOL:
|
|
Spoofhost "*.underchat.org" {
|
|
host = "*"; # Oricine poate!
|
|
ismask = yes;
|
|
};
|
|
|
|
# ✅ SIGUR:
|
|
Spoofhost "*.underchat.org" {
|
|
host = "*@trusted.admin.network"; # Doar admini
|
|
ismask = yes;
|
|
};
|
|
```
|
|
|
|
### **4. Documentează în MOTD hostname-urile disponibile**
|
|
|
|
```
|
|
# În ircd.motd:
|
|
-
|
|
- Hostname-uri disponibile:
|
|
- staff.underchat.org (automat pentru staff)
|
|
- vip.underchat.org (manual, contactează admin)
|
|
- users.underchat.org (automat pentru toți)
|
|
-
|
|
- Pentru /SETHOST contactează: admin@underchat.org
|
|
-
|
|
```
|
|
|
|
### **5. Păstrează log-urile IP-urilor REALE**
|
|
|
|
Chiar dacă hostname-urile sunt spoofed, serverul TREBUIE să logeze IP-urile reale pentru:
|
|
- Identificarea abuza torilor
|
|
- Investigații securitate
|
|
- Debugging probleme
|
|
|
|
---
|
|
|
|
## 🔧 TROUBLESHOOTING
|
|
|
|
### **Problemă: /SETHOST nu funcționează**
|
|
|
|
**Cauze posibile:**
|
|
|
|
1. **Spoofhost NU este configurat**
|
|
```bash
|
|
grep 'Spoofhost "' /home/ircd/ircd/lib/ircd.conf
|
|
# Dacă nu găsește → Trebuie adăugat
|
|
```
|
|
|
|
2. **Parola greșită**
|
|
```irc
|
|
/SETHOST vip.underchat.org wrong_password
|
|
# Output:
|
|
:server NOTICE nick :Invalid password for spoofhost
|
|
```
|
|
|
|
3. **User nu se potrivește cu host pattern**
|
|
```conf
|
|
# Config:
|
|
Spoofhost "vip.underchat.org" {
|
|
host = "*@specific.provider.com";
|
|
pass = "secret";
|
|
};
|
|
|
|
# User de pe alt ISP:
|
|
user@other.provider.com
|
|
# → NU se potrivește → BLOCAT!
|
|
```
|
|
|
|
4. **SETHOST_USER feature dezactivat**
|
|
```conf
|
|
# Verifică în features:
|
|
features {
|
|
"SETHOST" = "TRUE"; # Trebuie TRUE!
|
|
};
|
|
```
|
|
|
|
### **Soluție generală:**
|
|
|
|
```bash
|
|
# 1. Verifică că Spoofhost există
|
|
grep -A 4 'Spoofhost "vip' /home/ircd/ircd/lib/ircd.conf
|
|
|
|
# 2. Verifică că SETHOST este activat
|
|
grep SETHOST /home/ircd/ircd/lib/ircd.conf
|
|
|
|
# 3. Testează cu hostmask corect
|
|
# În IRC:
|
|
/SETHOST vip.underchat.org parola_corecta
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 INTEGRARE CU HOST HIDING
|
|
|
|
**Spoofhost** și **Host Hiding** (feature-ul built-in) sunt **diferite**:
|
|
|
|
### **Host Hiding (Built-in):**
|
|
```conf
|
|
features {
|
|
"HOST_HIDING" = "TRUE";
|
|
"HIDDEN_HOST" = "Users.UnderChat";
|
|
"HOST_HIDING_PREFIX" = "UnderChat";
|
|
};
|
|
```
|
|
- Ascunde AUTOMAT IP-uri cu hash
|
|
- Format: `UnderChat-HASH.domain.tld`
|
|
- NU necesită configurare per-user
|
|
|
|
### **Spoofhost (Custom):**
|
|
```conf
|
|
Spoofhost "custom.underchat.org" {
|
|
host = "*";
|
|
autoapply = yes;
|
|
};
|
|
```
|
|
- Hostname-uri CUSTOM specifice
|
|
- Control granular per-user/grup
|
|
- Necesită configurare manuală
|
|
|
|
**Pot fi folosite ÎMPREUNĂ:**
|
|
- Host Hiding pentru utilizatori normali
|
|
- Spoofhost pentru staff/VIP
|
|
|
|
---
|
|
|
|
## 📚 REFERINȚE
|
|
|
|
- **Cod sursă:** `ircd/s_conf.c` (funcția `find_shost_conf`)
|
|
- **Exemplu config:** `doc/example.conf` (liniile 954-987)
|
|
- **Feature SETHOST:** Controlează dacă `/SETHOST` este disponibil
|
|
|
|
---
|
|
|
|
## 🎯 CONCLUZIE
|
|
|
|
**Spoofhost** = **Mascarea hostname-urilor pentru protecție și brandind**
|
|
|
|
Transformă hostname-uri reale:
|
|
```irc
|
|
user@203.0.113.45 → user@staff.underchat.org
|
|
user@isp.provider → user@vip.underchat.org
|
|
```
|
|
|
|
Este o funcționalitate **esențială** pentru:
|
|
- ✅ Protecția identității utilizatorilor
|
|
- ✅ Brandind profesional pentru staff
|
|
- ✅ Organizare ierarhică (admin/staff/vip/users)
|
|
- ✅ Securitate împotriva DDoS
|
|
|
|
---
|
|
|
|
**Data:** 14 Februarie 2026
|
|
**Versiune:** 1.0
|
|
**Pentru:** UnderChat IRCd v1.4.0+
|
|
|
|
---
|
|
|
|
## 🚀 QUICK START
|
|
|
|
**Pentru a adăuga Spoofhost în rețeaua ta:**
|
|
|
|
```conf
|
|
# Adaugă în /home/ircd/ircd/lib/ircd.conf:
|
|
|
|
# Staff automat
|
|
Spoofhost "staff.underchat.org" {
|
|
host = "*@10.0.0.*";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# VIP manual
|
|
Spoofhost "vip.underchat.org" {
|
|
pass = "vip_password";
|
|
host = "*";
|
|
autoapply = no;
|
|
};
|
|
|
|
# Protecție toți utilizatorii
|
|
Spoofhost "users.underchat.org" {
|
|
host = "*";
|
|
autoapply = yes;
|
|
};
|
|
|
|
# În features, asigură-te că:
|
|
features {
|
|
"SETHOST" = "TRUE";
|
|
};
|
|
```
|
|
|
|
**Restart IRCd și testează:**
|
|
```irc
|
|
/SETHOST vip.underchat.org vip_password
|
|
/WHOIS YourNick
|
|
```
|
|
|
|
**GATA!** ✅
|
|
|