How tommy811/jcat works
Project Components
• JCat-web: This is the frontend part of the system. It’s built with Vue.js (as seen from files like App.vue, main.js, components, router, and store). Its responsibility is to present a web UI (developer console) very similar to Chrome’s dev tools.
• agent-adapter: A Java module (with Gradle build) that likely acts as a bridge between the agent and external functions (or possibly between the frontend and the agent).
• jCat-agent: This module contains the core Java agent functionality. It has both Groovy and Java sources. It implements the core of the agent including:
• Agent attachment (see Agent.java).
• Console functionalities and command handling (packages for console and groovyLsp).
• Service components (for HTTP server, resource explorer, etc.).
• jcat-boot: This is the bootstrap/loader module. It provides the executable jar (jcat-boot.jar) that a user runs to start the process. It handles selecting the target JVM and injecting the agent (as indicated by classes like BootstrapAgent.java and JCatLoader.java).
• test-spring: A sample Spring application meant for testing or demonstration of the agent’s integration with a running Java application.
Interactions and Data Flow
• The user starts the system by launching jcat-boot.jar. This bootloader is responsible for attaching or injecting the agent (jCat-agent) into a target JVM process.
• Once injected, the agent module (jCat-agent) likely starts an HTTP server (via DefaultHttpServer.java) or other communication mechanism so that external components can communicate with the target JVM.
• The web console (JCat-web) provides the user interface. It communicates (via APIs, found in the src/api folder) with backend services to send commands or scripts (Groovy scripts, for example) that are executed inside the loaded agent in the target JVM.
• The agent-adapter may act as a supporting layer to transform or handle communications between these layers, ensuring that commands from the web console are correctly executed within the agent.
• The test-spring module serves as an example of a target application that exists in the JVM when the agent is attached.
Architectural Patterns and Key Technologies
• Java Agent Injection: The system uses the Javaagent approach to integrate with another JVM process.
• Web-based UI (Frontend/Backend separation): Visual presentation is handled by the Vue.js-based frontend (JCat-web) while the backend agent functionalities reside within jCat-agent and the boot process in jcat-boot.
• Gradle-based project builds: Multiple modules are built using Gradle.
• Service and API layers: The backend creates endpoints and services (e.g., DefaultHttpServer in jCat-agent) for command execution and result delivery.