A basic Command and Control (C2) server implementation using Python's socket module.
This script sets up a simple C2 server that listens for incoming connections from clients. It accepts commands from the server operator and sends them to the connected clients, receiving their responses.
- Python 3.x
- Clone the repository or download the script.
- Open a terminal or command prompt.
- Run the server script:
python py_server_c2.py --host <your_host> --port <your_port>
python py_client.py --server-host <server_host> --server-port <server_port>
Once the client is connected to the server, it waits for commands. Commands received from the server will be executed in the client's environment. The output of the executed commands is sent back to the server.
This Python script retrieves the HTTPS banner of a specified host and port by establishing an SSL/TLS connection using the ssl
and socket
modules.
The script initiates an SSL/TLS connection to the specified host and port using the ssl.create_default_context()
method and socket.create_connection()
function. It sends an HTTP GET request to the server and retrieves the banner information.
- Python 3.x
- Clone the repository or download the script.
- Open a terminal or command prompt.
- Run the script with the target host and port:
python py_https_banner.py example.com 443
This is a basic demonstration and might lack security and advanced features. Use it in controlled environments for educational purposes only.