Skip to content
The Chat Archive
o3-mini· OpenAI LMArena Human Preference 140K

<instruction> As an experienced translator and native Simplified Chinese speaker,…

  1. User

    III. SYSTEM DESIGN

    Penguin generates a configuration file that specifies the details of a rehosting environment. The initial configuration combines established defaults with information learned from static analysis of the target filesystem. A configuration is then realized into a rehosting environment and filesystem. This rehosting is executed and dynamic analysis results are recorded for the user. Through observation of the rehosting's runtime behavior, failures can be identified and the configuration file can be refined to address those failures. Using this iterative rehosting process, Penguin aims to be a framework for tailoring a rehosting to a specific firmware. To reproduce or share a rehosting a user simply needs the configuration file and original firmware image. The stages of the Penguin rehosting framework are shown in Fig. 1.

    A. Filesystem Analysis

    We perform a series of static analyses to identify the firmware's filesystem and derive an initial rehosting configuration. Once a filesystem is generated, it is necessary to identify

    [image: img-0.jpeg]

    Fig. 1: Rehosting a firmware with Penguin.

    The original system's architecture, bit-width, and endianness to select appropriate parameters for CPU emulation. Additionally, the init program is identified.

    Penguin extends the static analyses from both Firmadyne and FirmAE as well as supports several new analyses. While some analyses from Firmadyne and FirmAE are tailored to specific vendors (or even firmware), our novel analyses are designed to be firmware agnostic. The (configurable) suite of filesystem analyses in Penguin are summarized in Table I and given more detailed treatment in Appendix C.

    B. Rehosting as a Configuration

    After the filesystem analyses are complete, the Penguin user has an initial rehosting configuration. A Penguin rehosting is a YAML file that is paired with a repackaged filesystem to precisely specify that rehosting. The configuration capabilities can be broadly categorized into three groups: static filesystem modifications, runtime environment, and dynamic analyses. A brief example of a configuration is in Appendix B.

    1) Static Filesystem Modifications: Users can define a set of modifications to make this file filesystem before the rehosting starts. Files can be added, deleted, or moved.

    2) Runtime Environment: The configuration specifies the emulated environment that the rehosting will execute under. This includes emulator configuration (e.g., which CPU architecture), Linux boot arguments, network device names, and initial NVRAM values. Additionally, the configuration can specify new pseudofiles in /proc, /dev, and /sys as well as models for how those pseudofiles should behave.

    3) Dynamic Analyses: While a rehosting runs it can be analyzed to identify failures and inform future refinement to the rehosting configuration. Beyond the rehosting process, dynamic analyses of a rebooted system can also be leveraged to reverse engineer system behavior, identify vulnerabilities, or otherwise exercise the functionality of a system.

  2. Assistant

    III. 系统设计

    企鹅生成一个配置文件,该文件指定了重构环境的详细信息。最初的配置结合了已建立的默认值和从目标文件系统的静态分析中得到的信息。然后,一个配置被实现为一个重构环境和文件系统。此重构被执行,并为用户记录动态分析结果。通过观察重构的运行时行为,可以识别失败,并且可以对配置文件进行细化以解决这些失败。通过这种迭代的重构过程,企鹅旨在成为一个将重构针对特定固件量身定制的框架。要复制或共享一个重构,用户只需要配置文件和原始固件映像。企鹅重构框架的阶段如图1所示。

    A. 文件系统分析

    我们执行一系列静态分析来识别固件的文件系统,并推导出初始重构配置。一旦生成了文件系统,就有必要识别

    [image: img-0.jpeg]

    图1:使用企鹅对固件进行重构。

    需要识别原系统的架构、位宽和字节序,以便为CPU仿真选择合适的参数。此外,还需要识别init程序。

    企鹅扩展了Firmadyne和FirmAE的静态分析,并支持几种新的分析。虽然Firmadyne和FirmAE的一些分析是针对特定的供应商(甚至固件)量身定制的,但我们的新型分析设计上与固件无关。企鹅中(可配置的)文件系统分析套件在表I中总结,并在附录C中作了更详细的说明。

    B. 重构作为一种配置

    在文件系统分析完成后,企鹅用户就拥有了一个初始的重构配置。一个企鹅重构是一个YAML文件,该文件与重新打包的文件系统配对,以精准地指定该重构。配置功能大致可以分为三类:静态文件系统修改、运行时环境和动态分析。附录B中有一个配置的简要示例。

    1) 静态文件系统修改: 用户可以定义一组修改,来在重构开始之前对文件系统进行修改。文件可以被添加、删除或移动。

    2) 运行时环境: 配置指定了重构将要执行的仿真环境。这包括仿真器配置(例如,哪种CPU架构)、Linux启动参数、网络设备名称以及初始NVRAM值。此外,配置还可以指定*/proc*、/dev和*/sys*中的新的伪文件以及这些伪文件应如何表现的模型。

    3) 动态分析: 在重构运行时,可以进行分析以识别失败并为未来的重构配置细化提供信息。除了重构过程之外,对重启系统的动态分析也可以用于逆向工程系统行为,识别漏洞,或以其他方式测试系统的功能。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.