How onionj/pybotnet works
Main Components
• BotNet Core: At the heart is the BotNet class (located in pybotnet/botnet.py) which acts as the central orchestrator.
• Engines: Under the pybotnet/engines directory you have various engine implementations (for example, TelegramEngine in telegram_engine.py and a test engine in test_engine.py). These translate incoming commands and messages between the admin (or control panel) and the botnet.
• Scripts: Situated in the pybotnet/scripts directory are multiple default scripts (reverse shell, screenshot, keylogger, put/get file, etc.). They represent the actions your botnet can perform on a controlled system.
• Utilities: Comprising helper functions, proxies, serializers, and even third-party proxy integrations located in pybotnet/utils.
• Exception Handling & Package Info: Additional modules (like exceptions.py and package_info.py) provide support and metadata for the system.
Relationships and Interactions
• The BotNet Core instantiates and manages an Engine (e.g., TelegramEngine) that provides the communication interface.
• The Engine receives incoming commands (for example, through Telegram messages) and forwards these to the BotNet Core.
• BotNet then selects and invokes the appropriate script (like reverse shell, screenshot, etc.) from the scripts repository.
• Utilities (e.g., proxy or serializer modules) are used by both the Enginess and Scripts for data processing, network communication, or logging.
• The relationship between custom scripts (which can be added or imported easily) and the core engine emphasizes extensibility.
Architectural Patterns and Principles
• Modularity: Each major feature is separated into distinct modules (engines, scripts, utilities) which enables maintainability and extensibility.
• Plug-In Architecture: The use of engine and script classes indicates that the system is designed to allow custom extensions (for instance swapping the Telegram engine with an alternative custom control panel).
• Clear Separation of Concerns: The core BotNet functionality, engine interface, and script functionalities are well-isolated.
• "Telegram Engine" receiving commands and passing them onto the "BotNet Core".
• The "BotNet Core" should then be split out into:
• A controller for managing client connections.
• An interface with the "Scripts Module" (listing scripts like reverse_shell, screenshot, keylogger, etc.).
• An "Utilities" block connected to both the Engine and Scripts for shared services like proxy handling and serialization.
• Optionally, add supporting components like configuration files or installation scripts to show the deployment side—though these are secondary to the runtime architecture.