How yogeshwar-2004y/trojan works
Project type and purpose
• This is not a typical client-server app or microservice suite, but rather a collection of Python-based trojan modules:
• Keylogger (captures keystrokes & mouse clicks)
• Anti-analysis detector (self-termination under suspicious activity)
• Screenshot capturer (full-screen capture + base64 encoding)
• Shellcode executor (downloads & runs arbitrary shellcode via Windows API)
• All modules target Windows, leverage ctypes and pywin32 for low-level API access, and pynput for input hooks.
File structure
• Top-level Python scripts each implement a standalone capability.
• No config files; parameters (URLs, thresholds) are likely hard-coded or passed via CLI.
Key points from the README
• Each script has its own “Overview” and “Requirements.”
• Common dependencies: Python 3.x, pywin32, pynput, ctypes.
Main components
a. Controller / Launcher (conceptual): orchestrates module execution or runs all in parallel
b. Keylogger module
c. Anti-analysis Detector module
d. Screenshot Capture module
e. Shellcode Execution module
f. Windows OS / WinAPI (ctypes, pywin32)
g. External Server (for shellcode download or exfiltration of logs/screenshots, if applicable)
h. Storage (local files or in-memory buffers)
Relationships & interactions
• Controller → invokes Keylogger, Anti-analysis, Screenshot, Shellexec
• Keylogger & Screenshot → generate data → pass to Storage or Network layer
• Shellcode Execution → network call to fetch payload → WinAPI allocate & execute
• Anti-analysis monitors input volume → if threshold exceeded → terminates its own process or signals Controller
Architectural patterns & design principles
• Modular design: each capability is a separate script/module
• Single-responsibility: each script handles one facet of the trojan
• Low-level API integration: highlight the use of ctypes and pywin32 for stealth and power
Technologies & frameworks
• Python 3.x runtime
• pynput (keyboard/mouse hooks)
• pywin32 (clipboard, screen capture)
• ctypes (memory allocation, function calls in native DLLs)
• Base64 encoding library (built-in)