Reverse Engineering & Binary Analysis Basics · 课时

从固件中提取并分析文件系统

提取、识别并挂载隐藏在固件映像中的嵌入式文件系统,恢复其中包含的二进制文件、配置和密钥。

第 4 / 4 课13 个步骤

从固件中提取并分析文件系统 是 CoddyKit 上的免费 Reverse Engineering & Binary Analysis Basics 课时。 这是第 4 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Reverse Engineering & Binary Analysis Basics 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Reverse Engineering & Binary Analysis Basics 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

Inside the Firmware Blob

You can analyze firmware images, emulate embedded binaries, and use hardware-assisted debugging. Most firmware is more than code: it embeds entire filesystems holding executables, web pages, and secrets.

Extracting them is often where the real findings live.

Firmware Layout

A typical image is a stack of regions:

  • Bootloader
  • Kernel
  • One or more root filesystems
  • Configuration / NVRAM areas

Each region may use a different format and compression.

Identifying Contents with binwalk

binwalk scans for known magic signatures and reports what is inside and where.

binwalk firmware.bin
# 0x40   uImage header
# 0x1A00 Squashfs filesystem, gzip

Carving Out Sections

Once you know offsets, you can extract a region. binwalk can do this automatically, or you can carve with dd.

binwalk -e firmware.bin
# or carve manually:
dd if=firmware.bin of=rootfs.sqsh bs=1 skip=6656

Common Embedded Filesystems

Embedded devices favor compact, sometimes read-only filesystems:

  • SquashFS (compressed, read-only)
  • JFFS2 / UBIFS (flash-aware)
  • CramFS (older, read-only)

Each needs the matching tool to unpack.

Unpacking SquashFS

SquashFS is the most common. Extract it with unsquashfs to get a normal directory tree.

unsquashfs rootfs.sqsh
# creates ./squashfs-root with /bin /etc /www ...

What to Look For

Inside the root filesystem, hunt for high-value files:

  • /etc/passwd and hardcoded credentials
  • Web admin scripts in /www
  • TLS keys and certificates
  • Startup scripts revealing services
grep -rIn 'password' squashfs-root/etc 2>/dev/null

Finding Hardcoded Secrets

Vendors frequently embed backdoor accounts or API keys. Scan strings across the whole tree and inspect config files.

These secrets are the most common firmware vulnerability you will report.

Connecting to Your Other Skills

Extracted binaries feed back into your earlier work: emulate a recovered service binary, or attach hardware-assisted debugging to a running device executing that same code.

Filesystem extraction unlocks the targets for those techniques.

When Extraction Fails

If binwalk finds nothing, the image may be encrypted or use a proprietary container.

  • Check entropy: uniformly high suggests encryption
  • Look for the bootloader's decryption routine
  • Try vendor update tools or known keys

Repacking After Modification

For dynamic testing you sometimes patch a filesystem and put it back. Repack with the matching tool and fix the firmware header checksum, or the device rejects the image.

Always work on copies and keep the pristine original for reference.

mksquashfs squashfs-root rootfs_new.sqsh -comp gzip

Quick Check

Which tool is commonly used to scan a firmware image for embedded filesystems and other known structures by their signatures?

Recap

You can now mine firmware for its real contents:

  • Map the layout, then identify regions with binwalk
  • Carve sections and unpack SquashFS/JFFS2/UBIFS
  • Hunt for credentials, keys, and admin scripts
  • Feed recovered binaries into emulation and debugging
免费开始

用 AI 导师学习 Assembly — 免费

在浏览器中编写并运行真实代码,获得全天候 AI 导师的即时帮助,并在网页或应用中继续学习。

课程
12
课程
48

常见问题解答

「从固件中提取并分析文件系统」课时是免费的吗?

是的 — 「从固件中提取并分析文件系统」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Reverse Engineering & Binary Analysis Basics 课程的其余内容,请升级到 CoddyKit PRO。 Reverse Engineering & Binary Analysis Basics 课程共包含 4 节课。

「从固件中提取并分析文件系统」这节课中我会学到什么?

提取、识别并挂载隐藏在固件映像中的嵌入式文件系统,恢复其中包含的二进制文件、配置和密钥。 你通过在浏览器中直接运行的动手代码来练习 Reverse Engineering & Binary Analysis Basics,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 Reverse Engineering & Binary Analysis Basics 需要有经验吗?

无需任何先前经验。CoddyKit 上的 Reverse Engineering & Binary Analysis Basics 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 4 节课,共 4 节。

「从固件中提取并分析文件系统」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 Reverse Engineering & Binary Analysis Basics 课中编写并运行代码吗?

能。每节 Reverse Engineering & Binary Analysis Basics 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 分析固件镜像
  2. 模拟嵌入式二进制文件
  3. 硬件辅助调试
  4. 从固件中提取并分析文件系统
← 返回 Reverse Engineering & Binary Analysis Basics