You can watch the full video with setup instructions on YouTube
How to prevent a BeEF Attack?
Disabling Java in your Browser is the best way to prevent this type of Java attack. You can enable Java on the trusted sites that require Java.
Internet Explorer
Change Security for Internet to High
Internet Options, Security, Security Level for this Zone, Adjust to High
Add Site to Trusted Site that need Java Support.
Microsoft Edge
edge://settings/content/javascript?search=java
Allowed – Turn Off
Allow – Add sites that need Java Support
Chrome
chrome://settings/content/javascript?search=java
Default Behavior
Don’t Allow site to use Javascript – Enable
Allow to use Javascript – Add Site
Opera
opera://settings/content/javascript?search=java
Default Behavior
Don’t Allow Sites to use Javascript – Enable
Allowed to use Javascript – Add Site
Firefox
about:config
search for javascript.enabled
Toggle to False