Python C2 Server & Client

Overview

A lightweight Command and Control server written in Python to allow remote access, file uploading and downloading, as well as persistence.

How features were implemented

  • Communications are encrypted using the Python library PyCryptodome to implement AES encryption and decryption.
  • I used the Pillow library to take screenshots from the client and upload them to the server.
  • I used Python's winreg library to interact with the Windows registry; I used this to add an entry to the Windows registry under:
    HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run
    so the script ran automatically on startup.

Infrastructure

  • I rented a VPS to offload user traffic, preventing it from overwhelming my home network's bandwidth and ensuring a stable connection.
  • The VPS also acted as a layer of protection, preventing any users from interfering with my personal network.

Remote Access Capabilities

  • The C2 server was capable of running admin-level commands on the client's machine without requiring user intervention.
  • The server was able to monitor what the user was looking at by taking screenshots of the user's computer.
  • The server had a built-in logging system to keep track of the user's actions in User-id.log and server commands in C2CMDS.log.
  • I also utilized FTP and AES encryption to upload selected files to the client and to copy files from the client back to the server securely, without client-side intervention.