Chinese IP Camera Firmware Extraction and Analysis for IoT Pentesting

Matt Brown

Summary:

This video demonstrates the process of extracting and analyzing firmware from a Chinese IP camera as part of an IoT penetration test. The presenter disassembles the camera, identifies a Winbond flash chip, and desolders it from the PCB using a hot air gun.

The disassembled IP camera on the workbench with the PCB exposed.
The disassembled IP camera on the workbench with the PCB exposed. [ 00:01:20 ]
He uses an XGecu universal programmer with its proprietary software to read the firmware from the removed chip, emphasizing the importance of verifying multiple reads for data integrity via MD5 hashes.
Terminal output comparing MD5 hashes of two firmware reads, confirming data integrity.
Terminal output comparing MD5 hashes of two firmware reads, confirming data integrity. [ 00:12:07 ]
The extracted firmware is then transferred to a Linux machine and analyzed using Binwalk, which successfully identifies and extracts various file systems, including JFFS2, SquashFS, and a U-boot kernel.
Binwalk output showing the successful extraction of uImage, SquashFS, and JFFS2 file systems from the firmware.
Binwalk output showing the successful extraction of uImage, SquashFS, and JFFS2 file systems from the firmware. [ 00:14:17 ]
Initial analysis of the extracted files includes searching for hardcoded credentials (like in the /etc/shadow file) and identifying custom binaries and open-source components such as mini_httpd.
The `/etc/shadow` file from the extracted firmware, revealing a hardcoded password hash.
The `/etc/shadow` file from the extracted firmware, revealing a hardcoded password hash. [ 00:15:27 ]
By extracting version information from mini_httpd (version 1.19, from 2003) and cross-referencing it with its changelog and CVE databases, a critical information disclosure vulnerability (CVE-2015-1548) is identified, which will be targeted in future network-based testing.
The strings command output for `mini_httpd` clearly showing version 1.19 and its compilation date.
The strings command output for `mini_httpd` clearly showing version 1.19 and its compilation date. [ 00:18:56 ]

Introduction to IoT Pentesting and Device Overview [0:00]

The video initiates a series on IoT hacking, focusing on extracting firmware from a Chinese IP camera acquired in Southeast Asia. The objective is to perform static firmware analysis for security vulnerability assessment.

Hardware Identification and Preparation [1:14]

The presenter moves to the workbench to examine the camera's circuit board, identifying key components and the specific flash chip to be extracted.

Flash Chip Extraction [3:12]

The presenter demonstrates the physical process of removing the flash chip from the PCB.

Firmware Extraction with a Universal Programmer [4:22]

The extracted flash chip is then prepared and connected to a universal programmer for reading its contents.

Ensuring Data Integrity: Professional Paranoia [9:43]

To guarantee the integrity of the extracted firmware, the presenter demonstrates rigorous verification steps.

Static Firmware Analysis with Binwalk [13:02]

The extracted and verified firmware is now subjected to static analysis using Binwalk.

Exploring Extracted Files and Identifying Vulnerabilities [14:48]

The presenter navigates the extracted file systems to uncover interesting files and potential vulnerabilities.

Correlating Software Versions with Known Vulnerabilities [19:17]

The discovered mini_httpd version is cross-referenced with its project website and vulnerability databases.

Preparing for Network-Based Exploitation [21:00]

With key binaries and a known vulnerability identified, the next steps for network-based penetration testing are outlined.