How 0xspyy/devilstealer works
1. The actual stealer (found in the “devilStealer” directory) – this is the functional payload that gathers data from a victim’s machine.
2. The builder (found in the “devilStealer-Builder” directory) – this script assists in packaging/building the stealer (for example turning it into an executable via tools like nuitka or pyinstaller) and may include additional steps like configuration and customization.
Main Components
• Stealer Module:
• Files: bot.py, stealer.py (under devilStealer folder)
• Core Functions: Data collection from browsers (cookies and passwords), capturing screenshots, gathering system info (IP, MAC, hostname, CPU, GPU, RAM, disk, etc.), and sending harvested data via Telegram bot.
• Builder Module:
• Files: builder.py, cache.json, and the duplicate stealer/bot.py and stealer.py (under devilStealer-Builder)
• Purpose: Provide a user interface for configuration and automated build process, which includes steps like embedding configurable parameters (e.g., file paths, Telegram token, admin ID) and using build tools like Nuitka or PyInstaller.
• Telegram Bot (External Service):
• Interaction: The stealer uses Telegram’s API (via pyTelegramBotAPI) to send the collected data.
• External Libraries/Dependencies:
• Pillow, browser-cookie3, psutil, pywin32, and pyTelegramBotAPI (for stealer functionality).
• Additional library “colorama” for builder console UI.
• Local System/Environment:
• The Windows OS environment (since the stealer works only on Windows as per README).
• The data directories (defined in stealer.py) which are used for temporary storage.
Relationships and Interactions
• The Builder allows a user to customize settings and then compiles the stealer module for deployment.
• Once built and executed on a Windows machine, the Stealer collects data from various sources (browsers, system info, screenshots) and then routes this data to a Telegram Bot via API calls.
• The builder may also generate a cache (cache.json) during its build process to store user options and build settings.
• Flow from the victim’s machine (data sources) → stealer collection routines → packaging/transmission via Telegram Bot to the attacker’s Telegram account.
Architectural Patterns and Design Principles
• Separation of Concerns: The design neatly separates the build process from actual data theft functionality.
• Modular Design: Although code duplication exists between builder and stealer folders, the components have defined purposes (building vs. execution).
• External Dependency Integration: Usage of third-party libraries to interact with external systems (e.g., Telegram API, browser data extraction).
Technology Highlights
• Python 3.11 (as tests indicate) with specified dependencies.
• Use of Telegram for data exfiltration, which is a key integration point.
• Packaging tools (Nuitka/pyinstaller) to generate an executable from Python scripts.