Before compiling, please make sure you have the OpenSSL dev package installed.
Compile using :
gcc -Wall -g -o shell shell.c -lssl -lcrypto
You will probably want to link statically against the library to avoid dependencies issues on the target.
You can either use ncat or any other tool with ssl support to send commands to the client .
To test the client, you can use openssl s_server utility on your server and wait for connections:
openssl s_server -key key.pem -cert cert.pem -accept 443
This script illusrates a simple use case scenario where we deliver our payload using HAK5 Rubber Ducky USB stick.
These tools are made only for educational purposes and can be only used in legitimate penetration tests. Author does not take any responsibility for any actions taken by its users.