How gh0stkey/hae works
Project Type and Purpose
• HaE is a cybersecurity framework that focuses on processing HTTP traffic to help ethical hackers and analysts quickly sort and extract high-value message data.
• The README emphasizes its role in vulnerability discovery by reducing noise and highlighting significant HTTP/WebSocket messages.
• It is designed to integrate with tools like BurpSuite (using the Montoya API), and it is structured as a modular Java project.
Analyzing the File Structure
• The top-level “src/main/java/hae” directory is organized into sub-packages:
• Core classes: “HaE.java” and “Config.java” (in the root and component directories) serve as the application’s main entry points and configuration handlers.
• “component” package: Includes modules like “board”, “rule”, and utility components. For example, the board submodules (Databoard, MessageRenderer, etc.) manage the data display panels, while rule packages manage parsing and applying rules.
• “instances” package: Contains specialized handlers for different protocols:
o “http”: With editors and handlers (for both active and passive HTTP message processing).
o “websocket”: For managing WebSocket-specific messages.
• “utils” packages: Provide shared functionality (configuration loading, data management, string processing, and HTTP utilities).
• “cache” package: Implements caching (e.g., MessageCache) to temporarily store and manage HTTP message data.
• Also, external resources such as the rules file (Rules.yml) and logos are stored under “src/main/resources” for dynamic configuration and UI elements.
a. Main Components:
• Core Application Module:
• Entry Point (HaE.java) and Main Configuration (Config.java) which initialize the system and load settings.
• Component-Based Modules:
• Board Components: Databoard, Datatable, and message display classes that manage UI display – responsible for showing annotated and extracted HTTP messages.
• Rule Engine Components: Classes under “component/rule” and utilities under “utils/rule” that parse, process, and apply extraction rules using regular expressions.
• Protocol-Specific Instances:
• HTTP Modules: Including editors (RequestEditor, ResponseEditor), message handlers (ActiveHandler, PassiveHandler), and processing utilities that work on HTTP requests/responses.
• WebSocket Module: Manages WebSocket-specific data flow through the WebSocketMessageHandler.
• Utility and Support Modules:
• Caching (under “cache” module), configuration loading (ConfigLoader), data management (DataManager), UI enhancements, and string processing mechanisms.
• External Integration:
• Integration hooks providing seamless data storage with BurpSuite’s project data management.
b. Relationships and Data Flow:
• HTTP/WS traffic flows from external sources into the “Instances” layer, where messages are captured.
• Captured messages then pass to the Rule Engine, where multi-engine regex matching (using DFA and NFA engines) is applied.
• Processed data is forwarded to Board Components, which then display and annotate messages. Concurrently, the Message Cache holds interim results.
• Utility modules support all layers by providing configuration, logging, and data management.
• Integration with BurpSuite is highlighted by showing how project data is stored/updated on message processing.
c. Architectural Patterns and Design Principles:
• Modular “Lego brick” approach – each component is loosely coupled and interchangeable.
• Use of common design patterns, for example:
• MVC-like separation within the board components (data model vs. visual rendering).
• A clear separation between protocol handling (HTTP and WebSocket) and business logic (rule processing).
• How the multi-engine regex support (DFA/NFA) is abstracted within rule processing components.
d. Relevant Technologies and Frameworks:
• Java as the primary language with Gradle as the build tool (indicated by build.gradle and settings.gradle).
• Integration and dependency on the Montoya API and BurpSuite as part of its deployment environment.
• Use of YAML configuration (Rules.yml) to allow dynamic rule loading.
• Standard Java libraries and custom utilities for HTTP processing and UI enhancements.