If socat isnβt installed, youβre not out of luck. There are standalone binaries that can be downloaded from this awesome Github repo:
https://github.com/andrew-d/static-binaries
With a command injection vuln, itβs possible to download the correct architecture socat binary to a writable directoy, chmod it, then execute a reverse shell in one line:
openssl req -newkey rsa:2848 -nodes -keyout shell.key -x509 -days 365 -out shell.crt
req: initiate a new certificate signing request
-newkey: generate a new private key
rsa:2848: use RSA encryption with a 2,048-bit key length.
-nodes: store the private key without passphrase protection
-keyout: save the key to a file
-xse9: output a self-signed certificate instead of a certificate request
-days: set validity period in days
-out: save the certificate to a file
merge two files to create a usable pem file for socat: