How etcetra7n/cleopatra works
At the same time, there’s a “worker” component (with Node.js scripts in worker/prod and worker/dev) hosted externally (mentioned to be hosted on Cloudflare in the README) that supplies jobs and collects results. In addition, the presence of the .HASHER directory and files such as bcrypt.cpp, blowfish.cpp, and related headers/assets suggests that security (likely for password hashing or integrity checks) is embedded into part of the project, further supported by the inclusion of rapidjson (for JSON handling) and libcurl (for HTTP communication) among other dependencies.
Main Components
• Client-Side Daemon: Represent the Cleopatra Daemon running on the user’s PC. Indicate its submodules:
• Command Executor: (runner.cpp) which processes and executes jobs.
• Communication Module: (using libcurl and rapidjson) that interacts with the remote APIs.
• Logger/Utility Modules: (logger.cpp, send_results.cpp) handling execution output and logging.
• Security/Hasher Component: Modules inside the .HASHER directory handling bcrypt, blowfish, etc.
• Worker Server: Represent the remote Cleopatra Worker, likely run with Node.js (as seen in worker/prod and worker/dev), which hosts two RESTful API endpoints:
• /api/fetch-daemon-job to supply jobs.
• /api/send-results-to-worker to collect the execution results.
• External Libraries/Frameworks: Show the use of rapidjson for JSON parsing, libcurl for HTTP requests, and other security libraries (bcrypt) integrated into the daemon.
Relationships and Data Flow
• The Worker Server sends a job request (through the fetch API) to the client daemon.
• The Daemon processes and executes the received command locally.
• The results (output and exit code) are then returned from the Daemon to the Worker Server via the send-results API.
Architectural Patterns and Design Principles
• Client–Server Pattern: Clearly separate the client (daemon) and server (worker) components.
• Modular Design: Emphasize the separation of concerns in daemon modules (communication, logging, job execution, security).
• Secure Communication: Note the integration of security libraries (bcrypt, blowfish) and protocols (protocols folder for password change checklist) in ensuring data integrity and secure authentication.