How urban20/backdoor works
Project type and purpose
• This is a client-server “backdoor” / remote-access tool for Windows machines.
• Purpose: run a host process on a Windows target (the backdoor) that automatically tries to persist itself on startup, listens on a TCP port (default 999), executes incoming commands (shell commands, screenshots, etc.), and returns results to a client program.
File structure
• Top-level folders V1.0 (Python) and V2.0 (Go) contain two independent subprojects each:
• backdoorV2.0 (server)
– conexiones/ (socket handling)
– ejecuciones/ (command execution logic)
– main.go (entry point, config/initialization)
• clienteV2.0 (client)
– colores/ (UI coloring)
– input/ (user input parsing)
– conex/ (network commands, subpackages comandos/ and comandos/ss for screenshots)
– main.go (entry point, CLI flags)
• Important config/build files: go.mod, go.sum.
Insights from the README
• Architecture is a simple TCP client–server.
• Backdoor auto-copies to Windows startup (Python V1.0), silent on failure in GUI mode.
• Client issues both hardcoded automated commands (msg, shutdown, cls, ss) and arbitrary shell commands.
• Screenshots: captured on host, encoded to binary, streamed over socket to client, then saved to disk.
a. Main components:
• Client UI & CLI layer (golang client)
• Client Connection Manager (dialer, socket read/write)
• Command Dispatcher (maps user input to network payloads)
• Network Transport (TCP channel over IP:port 999)
• Server Listener (accepts connections)
• Server Connection Handler (reads payloads, routes to executors)
• Execution Modules:
• Shell Executor (executes arbitrary OS commands)
• Screenshot Module (captures, encodes, streams)
• Built-in Command Module (msg, shutdown, cls)
• File System (persistence, screenshot storage on client)
• Windows OS (target host environment)
b. Relationships and interactions:
• User → Client UI → Connection Manager → TCP Socket → Server Listener
• Server Handler → Execution Module → OS → Returns stdout/binary → back the same socket → Client
• Client receives data → if binary screenshot, writes to disk; else prints to console.
c. Architectural patterns/design principles:
• Modular separation by functionality (network, execution, IO)
• Single responsibility per package (conexiones vs ejecuciones vs comandos)
• CLI flag parsing at entry point, dependency injection of modules for testability
d. Key technologies/frameworks:
• Golang net package for sockets
• os/exec for command execution
• image encoding libraries (for screenshot binary transfer)
• Windows system calls (for startup persistence in Python V1.0)
Diagrammatic conventions
• Use clear, descriptive labels (e.g., “Client.CommandDispatcher”, “Server.ScreenshotModule”).