Replace monolithic CLI and web server with route-based Flask API. New routes: api_commands, api_build, api_can, api_monitor, api_ota, api_tunnel. Add honeypot security dashboard with real-time SSE, MITRE ATT&CK mapping, kill chain analysis. New TUI with commander/help modules. Add session management, tunnel proxy core, CAN bus data store. Docker support.
21 lines
966 B
Python
21 lines
966 B
Python
from commands.base import CommandHandler
|
|
|
|
|
|
class RebootCommand(CommandHandler):
|
|
name = "reboot"
|
|
description = "Reboot ESP"
|
|
|
|
def build(self, args):
|
|
# For the new c2_pb2.Command, we need device_id and request_id.
|
|
# These will be filled by the CLI's _send_command method.
|
|
# Here, we just prepare the command_name and argv.
|
|
# The actual c2_pb2.Command object will be constructed in NewCLI._send_command
|
|
# and then serialized, encrypted, and sent.
|
|
# This build method is now primarily for command validation and argument parsing
|
|
# if the command had specific arguments. For reboot, it's simple.
|
|
|
|
# The build method in the old CLI was expected to return serialized bytes.
|
|
# In the new design, the CLI will construct the full c2_pb2.Command.
|
|
# For now, we'll return the command name and args, which NewCLI will use.
|
|
return {"command_name": self.name, "argv": args}
|