How guitmz/ezuri works
Project Type and Purpose
• This project is a Linux ELF runtime crypter – essentially, it encrypts an ELF executable to obfuscate its content and then provides a loader (or “stub”) to decrypt and run it in memory.
Analyzing the File Structure
• Top-Level Go Files: Files such as ezuri.go, aes.go, and utils.go indicate that the core logic for encryption (likely AES-based, given the aes.go file) and utility functions is centralized in these modules.
• The “stub” directory: Contains a main.go file. This is likely the runtime stub that is either appended to the encrypted binary or provided as a separate component that handles decryption and execution.
• GitHub configuration: The .github directory and its workflow files suggest that continuous integration/delivery features exist, though these are peripheral to the runtime architecture.
• go.mod and LICENSE: Standard Go module and licensing files indicate the dependencies and project licensing, respectively.
Key Components
a. Input Component: (e.g., Original Linux ELF Binary) – The file that needs to be encrypted.
b. Core Crypter Module (ezuri.go): The main application that orchestrates the encryption process.
c. AES Encryption Module (aes.go): Handles cryptographic operations – an essential building block that performs the actual encryption.
d. Utility Functions (utils.go): Support functions that might manage file handling, argument parsing, or other operations.
e. Stub/Loader (stub/main.go): This component is responsible for the runtime decryption and execution. It “unpacks” the crypter’s output so that the encrypted ELF can be decrypted in memory and executed.
f. External Dependencies/References: Although not part of the code directly, reference links in the README (e.g., f0wl’s unpacker and related research) can be noted as external influences or complementary tools.
Relationships and Interactions
• A directional flow starting with the original executable entering the crypter.
• The crypter (ezuri.go) uses the AES logic (aes.go) and utility functions (utils.go) to encrypt the input.
• The output is either a self-contained binary that incorporates the “stub” or two separate bundled components (the encrypted payload and the stub loader).
• The stub then takes over at runtime: upon execution, it uses internal logic (mirroring the encryption in reverse) to decrypt the in-memory ELF and execute it.
Architectural Patterns/Principles
• Separation of concerns is clear between the encryption engine (core modules) and the runtime stub/loader.
Relevant Technologies and Frameworks
• Go Language: Highlight that all critical components are written in Go.
• AES Cryptography: The algorithm implemented in aes.go is key, so label that technological detail.