Video and lab - The Browser Exploitation Framework (BeEF)

19 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€92.78
List Price:  €129.90
You save:  €37.11
£79.40
List Price:  £111.16
You save:  £31.76
CA$136.11
List Price:  CA$190.56
You save:  CA$54.44
A$154.13
List Price:  A$215.78
You save:  A$61.65
S$135.08
List Price:  S$189.12
You save:  S$54.03
HK$782.28
List Price:  HK$1,095.23
You save:  HK$312.94
CHF 90.61
List Price:  CHF 126.85
You save:  CHF 36.24
NOK kr1,085.23
List Price:  NOK kr1,519.37
You save:  NOK kr434.13
DKK kr692.01
List Price:  DKK kr968.84
You save:  DKK kr276.83
NZ$167.80
List Price:  NZ$234.94
You save:  NZ$67.13
د.إ367.19
List Price:  د.إ514.08
You save:  د.إ146.89
৳10,976.08
List Price:  ৳15,366.96
You save:  ৳4,390.87
₹8,339.52
List Price:  ₹11,675.66
You save:  ₹3,336.14
RM473.25
List Price:  RM662.57
You save:  RM189.32
₦141,842.81
List Price:  ₦198,585.61
You save:  ₦56,742.80
₨27,810.04
List Price:  ₨38,935.18
You save:  ₨11,125.13
฿3,647.70
List Price:  ฿5,106.92
You save:  ฿1,459.22
₺3,232.12
List Price:  ₺4,525.11
You save:  ₺1,292.98
B$499.21
List Price:  B$698.91
You save:  B$199.70
R1,908.54
List Price:  R2,672.04
You save:  R763.49
Лв180.65
List Price:  Лв252.92
You save:  Лв72.26
₩135,197.71
List Price:  ₩189,282.20
You save:  ₩54,084.49
₪368.63
List Price:  ₪516.10
You save:  ₪147.47
₱5,633.91
List Price:  ₱7,887.71
You save:  ₱2,253.79
¥15,144.47
List Price:  ¥21,202.86
You save:  ¥6,058.39
MX$1,659.40
List Price:  MX$2,323.22
You save:  MX$663.82
QR364.31
List Price:  QR510.04
You save:  QR145.73
P1,370.91
List Price:  P1,919.33
You save:  P548.42
KSh13,148.68
List Price:  KSh18,408.68
You save:  KSh5,260
E£4,729.52
List Price:  E£6,621.52
You save:  E£1,892
ብር5,680.63
List Price:  ብር7,953.11
You save:  ብር2,272.48
Kz83,612.74
List Price:  Kz117,061.18
You save:  Kz33,448.44
CLP$97,978.20
List Price:  CLP$137,173.40
You save:  CLP$39,195.20
CN¥722.95
List Price:  CN¥1,012.16
You save:  CN¥289.21
RD$5,921.50
List Price:  RD$8,290.34
You save:  RD$2,368.83
DA13,490.83
List Price:  DA18,887.70
You save:  DA5,396.87
FJ$226.12
List Price:  FJ$316.58
You save:  FJ$90.46
Q779.86
List Price:  Q1,091.83
You save:  Q311.97
GY$20,923.51
List Price:  GY$29,293.76
You save:  GY$8,370.24
ISK kr13,946.60
List Price:  ISK kr19,525.80
You save:  ISK kr5,579.20
DH1,013.19
List Price:  DH1,418.51
You save:  DH405.32
L1,763.34
List Price:  L2,468.75
You save:  L705.40
ден5,702.11
List Price:  ден7,983.18
You save:  ден2,281.07
MOP$805.89
List Price:  MOP$1,128.28
You save:  MOP$322.39
N$1,893.44
List Price:  N$2,650.90
You save:  N$757.45
C$3,681.15
List Price:  C$5,153.75
You save:  C$1,472.60
रु13,335.63
List Price:  रु18,670.42
You save:  रु5,334.78
S/370.84
List Price:  S/519.19
You save:  S/148.35
K382.72
List Price:  K535.82
You save:  K153.10
SAR375
List Price:  SAR525.01
You save:  SAR150.01
ZK2,522.76
List Price:  ZK3,531.96
You save:  ZK1,009.20
L461.43
List Price:  L646.02
You save:  L184.59
Kč2,350.75
List Price:  Kč3,291.15
You save:  Kč940.39
Ft36,729.02
List Price:  Ft51,422.10
You save:  Ft14,693.08
SEK kr1,071.30
List Price:  SEK kr1,499.86
You save:  SEK kr428.56
ARS$85,766.82
List Price:  ARS$120,076.98
You save:  ARS$34,310.16
Bs691.04
List Price:  Bs967.48
You save:  Bs276.44
COP$387,583.68
List Price:  COP$542,632.66
You save:  COP$155,048.97
₡50,832.34
List Price:  ₡71,167.31
You save:  ₡20,334.97
L2,468.78
List Price:  L3,456.40
You save:  L987.61
₲737,805.73
List Price:  ₲1,032,957.54
You save:  ₲295,151.80
$U3,781.90
List Price:  $U5,294.82
You save:  $U1,512.91
zł400.73
List Price:  zł561.05
You save:  zł160.31
Already have an account? Log In

Transcript

Greetings and initial video presentation, we're going to take a look at how we go about conducting a client side attack using the browser exploitation framework, commonly referred to as beef. Beef is short for browser exploitation framework. It is a penetration tool that focuses on the web browser. And unlike other security frameworks, V flicks past the hardened network perimeter and client system and examines exploitability within the context of the one true open door, the web browser, be equal hook one or more web browsers and use them as a beachhead for launching direct command modules and further attacks against the system from what's in the browser context. For this lab demonstration, I'll be using one virtual install of Cali 2.0 that's been updated and upgraded to the latest and the greatest running Apache web server and one Windows operating system with a fresh install of Firefox ESR browser Now you are free to use any version of Windows and browser that you choose fit.

But your results will differ depending on the security and how new and updated both are. Since beef comes pre installed with the latest version of Kali, there's nothing for us to download and install. We can launch the application V, a number of ways, but the most common two are using the applications that we can go up to exploitation tools, and we can launch from within here, or we can use the Cali quick launch, and we can launch it using the V fi icon, and that will open up the V pitch quotation framework. For this demonstration, I'm just going to use the shortcut that's in place inside of the Quick Launch Bar. I'm going to go ahead and just click it. This is going to open up the V services inside of the terminal.

Give it a chance to open up and when it comes back to the prompt, that means that too services for beep have been started, it is important that we read and understand everything that pops up inside of a terminal when we launch a service, because this is going to be our indicator whether or not the actual service started correctly, and everything is working as it should. And the same applies to B. So we know that B services have started. And now we have a couple of lines in here that we need to pay particular attention to. The first line we want to pay attention to is where it says a UI URL. Now this is the web page for the login to access the beef Management Console.

So we can go ahead and take another look at this. So it's telling you that to get to the beef log on page, you would use the loopback address and port 3004 slash UI for slash panel. And if we open up our browser, we see that this is the case the term hooking is used throughout this tutorial. hooking is the process of convincing our victim to click on a link that contains the JavaScript hook file. This JavaScript file will be processed by the victim's browser, tying the remote browser back to the V server. This is what is meant by the hooking process.

And if we look at our terminal, we see that the hook, the script that is going to allow the remote browser to hook back to our V server is given to us here. And we have a couple of things here we're going to have to modify and one of those is going to be the IP address. This is the IP address of our B server, or our Cali server or our Apache web server. They're all the same the three address but we have to modify this address in here. This little item here that has the IP between the brackets has to be replaced with actual IP address of the machine. So the next thing we want to do is discover what our actual IP address is for the beef.

Server. So to do this, we're just going to go up to our terminal, we're going to right click, and we're going to say open new window. Inside this new window, we're going to type in ifconfig. I am concerned with the IP address that is currently assigned to my Ethernet zero. And this is listed under the eye net. And we can see that I'm currently assigned the IP address of 192 dot 168 dot 145 dot one query.

Now I need to remember this because I'm going to use this later on to modify the path to the script. And that's the IP address that's going to go in here. If you launched a beef user interface and you do not see this log on screen, that means that your Firefox browser needs to be updated. And you're going to use the app dash get space upgrade space Firefox, that is our command to go ahead and get the latest version of Firefox ESR. Now that we have the IP address can go ahead and take the next step which is starting the Apache web server to do this, using the same terminal where we launched our beef framework, I have typed service space Apache to space start, I'm going to go ahead and just hit Enter. And if it comes back to the command prompt, we know that service started successfully.

B ties itself in with the Apache web service on our Kali machine, and it uses the default index dot HTML file. So we're going to have to go find this index dot HTML file and we're going to modify it. And we're going to change some text and we're going to put in the path for the hook. And we're going to try to entice our victim to visit this website so that they complete the hooking process and connect their browser back to our B server. To get to the index dot HTML file. We begin by going to the files icon inside of our quick launch.

Once this opens up, we're going to go Down to other locations. Next, we're going to click on computer. And underneath computer, we're going to click on the var directory. We're then going to click on the www directory. And finally, we're presented with the HTML directory. We'll open this up, and you'll see that we have an index dot HTML file.

Now we have to open up this index dot HTML file, and we're going to edit it using a text editor. To do this, I'm just going to right click, and I'm going to say open with other application. Now you'll see that I have the leafpad text editor available to me, but you may not. If you don't see a text editor, just go down where it says View all applications, and choose yourself a text editor. I'm gonna go ahead and say select and this opens up the index dot HTML file. Now you're going to see a lot different than what we see it here.

What you can do here is Modify the HTML inside of the document, leaving this part, the HTML tag at the top, the open head, and the title. And you can modify it with what you see here on the screen, this text, all of it is also available inside of the the lab file, you can just copy it and paste it into this index dot HTML file from the lab file. Now, you'll notice that that script, we're going to modify this here just a little bit. I'm gonna make this small bring up my terminal screen over here. And so you can see what I've done here. So this is the script that I need to put between the two header tags for the HTML building and the closing tags need to have this script in between.

So I'm going to go back over here, and we're going to open this up again. And you'll see where inside the script I took the IP in In the brackets, and I modified it with the IP address of my server. This is the IPA, I addressed that I discovered now your IP address is going to be different. So do not use this IP address, you have to discover your own IP address for your Apache web server, so that the client will know where to send the request for this JavaScript code. Now, once you have the HTML, correct inside of this index dot HTML file, you just go up to File, and then you can just select a save, and it'll close. We're now ready to proceed with the actual hooking of the clients browser back to our vi server.

For this next step, we're going to need to log on to the beef Management Console. So I'm going to bring that back up real quick. And we're going to log on with username of beef and the password of beef. all lowercase, again, the username and the password for the vif Management Console. Login or the authentication is the same deep, all lowercase. I'm gonna go ahead and log in.

Now, it's very important that you read this getting started page. There's a lot of good information in here. And it's going to explain a lot of good stuff to you. So as you see, I've already been playing around with the beat. And I already have one machine that I have hooked into my beef Management Console. What I'm going to do here is I'm going to go ahead and just open this up real quick.

And we're going to look at the commands. And I'm going to go down, and I'm going to remove the hook element, or I'm gonna say unhooked. And to do this. I'm going to say execute. And now my beef management console is going to go out and find my windows seven machine, and it should remove the hook that it established earlier with the Firefox browser. So we're going to go ahead and open up my browser here, and we're going to go ahead and begin launching this beef hooking process and see how it actually works.

So we're now back at my beef Management Console. And what we have here is a completely clean interface with no hook browsers. So I'm gonna go back to my Windows seven machine here. And let's see if I can pull this down and get over to the address. Yes, there it is, how I get the client to launch the web page where this JavaScript is hosted is up to my creativity. Normally, it would be some type of social engineering attempt at phishing email, or whatever the process is.

If you watch the video on how to exploit using Cali across the land, then you'll see that for us to make this actually work, we would have to have port forwarding enabled on our network. Now port forwarding was explained to that first video, so make sure you watch that so You'll understand better how this actually works in the real world. For this demonstration, we're just doing this on my local area network with my two machines seeing each other. So I'm gonna go ahead and select the web server that is hosting my beef service. And it goes back. And remember the HTML file that we modified.

That index dot HTML file is now present here inside of the remote user's browser. We injected the JavaScript code inside of the index dot HTML document between the two head tags, the beginning and the closing, which is where the JavaScript has to be present. This machine is now infected. That's all that's all the user had to do. All he had to do was just open up the web page. Again, how we entice the individual to get to the web page is up to our creativity.

It could be a phishing email. It could Say something that, hey, look at all the great pictures I took on my vacation. It posted up here on this website. Once the individual clicks on that URL for that website, and we have embedded that JavaScript hook, then their web browser becomes infected, and we have access to their machine. So now let's go back over and look at our Cali machine. And now we see that I do have the browser hook back over here to my beef.

So now I can communicate just by clicking on the IP address of that browser, where it's located underneath browsers. And we see that online browsers currently available to me. And if I click on it, I get the first tab that's available to me, which is the detail. It's very important that you understand what kind of a browser you're working with. So just keep looking at and understanding all the different aspects of what's going on with this browser. Because This is going to determine exactly what exploits you can launch against the browser.

Not every exploit is going to work because every browser is different. And every browsers update is going to block some certain exploits from not working. Once we understand what browser it is we're playing around with we put two, we can then go into the commands tab, and we can begin the exploitation process. Now these exploitation that you're seeing here, don't pertain directly to the Mozilla Firefox ESR. These are all the exploits that are available up inside of V. Now, if you remember on the getting start getting started page, we have some information about which of these exploits are deemed as feasible and which aren't. And the ones that are given the green light are most likely to work, but they may not.

There may be something that's not being done. acted correctly, that stopping the exploit from work. And so don't take it as the absolute truth that the exploit will work, it may work. And the same thing down here in the command module does not work against the target, or the command module works against target, but maybe visible to the user. There's a lot of things going on here that you want to understand with these different goal lights. Alright, so make sure you understand that, again, by just clicking on the IP address of our victims browser, we can get into the tabs that allow us to have the ability to the exploit.

So we're going to click on the commands tab now. And again, we're going to start off up here with the browser. So these are all the different exploits that we can take a look at. There's not a whole lot in here that's of interest to us the webcam, the webcam is not going to work. Because we don't have flash installed. We can still play around with it.

So I can click on this. And over here I can change the social engineer Kinda because this is what the user is going to see, this is what's going to pop up inside the browser. So I can say something like you've been hacked. Now, we got to make sure that we spell everything correctly, because we don't want to look totally illiterate. Someone type in the whole word here, you have been hacked. All right, then we can change this down here into something catchy, like, don't be a sore loser.

Go ahead and launch your webcam, give us some webcam, action, whatever you want to type in there. Let's go ahead and fill them some text. So I'm trying to convince the opposite end of this took whoever it is who's ever read this, to go ahead and play along and give me access to their webcam? pretty hard to do. Not everybody's as gullible as you think they are. But I'm just playing around with it here.

So you've been hacked. How about how Boston webcam action, blah, blah, blah. Now down here, you can go ahead and launch the website. exploit by just saying execute. When say execute, we go back on over to my Windows seven machine. And there's what we typed in.

So this could be something catchy, like a free ride or a free ticket or free airplane ticket, whatever it is, and I gotta go back and check my spelling, but you get the idea. So you can't, you can be creative with this. And if you can convince the individual to go ahead and play along, then get access to their webcam, or whatever it is you're trying to get access to. As you can see, there's a lot of different exploits available up inside of the beef Management Console. Another one that we can use as a pen tester is get the visited URLs. So if we're wondering if the user has been visiting some type of inappropriate sites, battle porn, gaming, gambling, whatever they might be, we can check for those sites up here.

Inside This particular exploit and then we just lost it. So I can just leave the project calm there. And we'll see if our browser has any record of this particular URL. I'll go ahead and say execute. Now all I have to do is come back over here to the module results history. And if I click on it, it comes back and it tells me that there is no record of a URL being visited called beef project Comm.

If you would like to know if the browser is susceptible to cross site scripting, you can go ahead and launch this tab here for the cross site scripting arrays. If you'd like to know more about the network, how we're actually connected, you can do that by going to the Network tab, it'll show you the path back to the victim. There's also the logs that are great for troubleshooting. But mostly, you're getting the idea that this is very intuitive. So using the beef work to exploit a someone browser, it's great, because this is the one open door that's available to us by way of the end users. So when the end user opens up their browser, the machine looks at it and says, hey, you're the end user, we're not going to deny you, if you want to go visit this website.

Great. We're going to go there for you. So if the end user clicks on that infected URL, and they come back over to our B server, they're going to pull down that JavaScript code that's going to complete the hook. So in conclusion, it's important that you understand not only what the VI framework is capable of doing, but its limitations. That concludes this short video presentation on how we go about creating a hook back to a remote browser using the beef exploitation framework. If you have any questions or you have any concerns about the contents of this video, please don't hesitate to reach out and contact your instructor.

And I'll see you in my next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.