Disclaimer: The tutorials in our blog are solely for educational purposes. They do not substitute professional advice or services.
Please wait 0 seconds...
Scroll Down and click on CONTINUE➡️ for destination
Congrats! Your Link is Generated

How to use BeEF Over WAN using AWS?

How to use BeEF Over WAN using Amazon Web Sevices. Learn how to install Kali Linux and BeEf on cloud using free aws tier.
How to use BeEF over WAN?

If you want to use Browser Exploitation Framework (BeEF) across  WAN without forwarding any ports, the simplest method to do so is to install it on an Amazon Cloud Infrastructure AWS EC2 (Elastic computing) Instance by following the instructions here.

We can install beef straight from the marketplaces on Linode, but in the case of AWS we have to install it on any linux distribution.

We'll be installing it on Kali Linux here.

So, to begin, here are the steps:

Installation of Kali Linux on Amazon AWS Ec2

Step 1: Log in to Amazon Management Console.
If you are new to the AWS cloud, you must first sign up for an account with this cloud computing service provider. A one-year free trial of the service is also available. As a result, newbies can use it to try out the service for free.


Step 2: Once you are in the Management Console, click Ec2 from the Service Menu to view the Dashboard dedicated to managing instances, storage, and services.

Step 3: On the left side of the Ec2 Dashboard, find the Instances option and click it. Then, click the "Launch Instance" button.
BeEF over wan


Step 4: Fill in the "Name and tags" field with a relevant  tag or name.
Beef Over WAN

Step 5: Scroll down to find the "Choose an Amazon Machine Image (AMI)" option. Enter Kali in the Search box and press the Enter key. The pre-built Kali Linux Image provided by Offensive Security will appear first in the search results. Click on the "Select" button.
beef over wan


Step 6: Click on "Continue".
beef over the wan


Step 7: Now we must configure the Kali Linux Instance or Virtual Hardware. Simply choose the free instance type "t2.micro" or the one that best suits your needs.
beef over WAN


Step 8: If there are no current key pairs, users can create new ones. Simply pick the "Create a new key pair" option.
beef over wan


Step 9: Now give some name to your "Key Pair" and hit "create key pair".
beef without port forwarding


Step 10: The key pair will get downloaded automatically. Keep it somewhere secure since we'll need it to remotely access to our Kali Linux Ec2 Instance through SSH.
beef over wan


Step 11: The storage space is set to 12 GB by default, but you may expand it if necessary. Otherwise, leave the default settings unchanged.
beef framework


Step 12: Now just click on the "Advance details" and find "Shutdown behavior" and change the type to "Stop". Then Launch the instance by clicking "Launch instance".
beef using aws


Step 13: Wait for the procedure to be completed!
Beef over wan


Step 14: Then click on the "View all instances" button.
beef over the wan


Step 15: Click on the instance.
beef instance


Step 16: Open the Command Prompt or Terminal on your local machine and locate the downloaded Keypair. You may use use any SSH client to accomplish this.

Then Run this command :  ssh -i "your-key-pair.pem" kali@public-ip-address

beef in kali


Note - Use the username Kali. Replace the bold elements in the the above command with appropriate values as well.
beef over the wan network


You can also use the Public IPv4 DNS in place of Public IP Address 

Step 17: After successfully connecting to the machine just update and upgrade it by simply using the commands - sudo apt-get update && upgrade -y

beef update



Installation of Browser Exploitation Framework (BeEF)

Step 1: To install BeEF simply go to the github page of BeEF or you can simply copy the command from below and paste it on your Kali Terminal.

Command To Run : git clone https://github.com/beefproject/beef.git

Step 2: Now change directory into beef and execute the command ./install
beef installation


Step 3: Then press Y and hit enter to continue.
beef on aws


Step 4: After the completion of the dependency installation process, change the default credentials of BeEF by editing the config.yaml file using any editor. I am using nano.

Command To Run : nano config.yaml
beef over wan on aws


Step 5: Now simply try to execute BeEF by using the command: ./beef
beef on aws cloud


After executing the command it may through some errors showing that some gems are not installed.

Step 6: To fix the error just execute the command: bundle install
beef on cloud


Step 7: The bundle installation may be terminated by several gems, which you must manually install by using the instructions listed below.

beef errors fixed


Commands To Run : sudo gem install unf
                                    sudo gem install domain_name
                                    sudo gem install http-cookie
                                    sudo gem install xmlrpc
                                    bundle install


Step 8: Now just run the command ./beef
beef execution over wan using aws

Note - The IP Address shown in the terminal is the Private IPv4 address. We have to use the Public IPv4 Address of our instance.

Step 9: Now we have to go to our AWS instances dashboard to add a security rule to enable the port 3000 which is used by BeEF.
how to enable port 3000 in aws


Click on "Add rule" and type 3000 in the "port range" section. Then save it.
beef over wan


Step 10: Open your browser and then type in your AWS instance's IPv4 Address followed by port 3000/ui/panel.
beef over the wan

For example: http://your-ipv4-address:3000/ui/panel

Step 11: Log in by using your credentials.
beef on cloud using aws


Step 12: Now you can simply send the the demo link to your victims and you will be able to hook their browser. If you want to make the link look like legitimate to the victims then you can simply get a free hosting and host a website/webpage with legit looking design.

Sign up with Free2Host to take advantage of our Lifetime Free Hosting Service.
Free2Host - Lifetime Free Hosting.


Step 13: After hosting your website, just include the BeEF javascript file within the </body> element.
beef js codes


Step 14: Now send the legit looking malicious link to your victims and hook their browsers.
Hooked Browser using BeEF over WAN


So, Thats all for Today! I hope you have successfully installed the BeEF on Amazon Web Server and have hooked lots of browsers over WAN! And if yes, then please share this with your friends & loved ones who are facing problems to use BeEF over WAN. If you have faced any kinds of error during the installation process feel free to leave a comment down below. Have a wonderful day!

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.